blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 390 | content_id stringlengths 40 40 | detected_licenses listlengths 0 35 | license_type stringclasses 2 values | repo_name stringlengths 6 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 539 values | visit_date timestamp[us]date 2016-08-02 21:09:20 2023-09-06 10:10:07 | revision_date timestamp[us]date 1990-01-30 01:55:47 2023-09-05 21:45:37 | committer_date timestamp[us]date 2003-07-12 18:48:29 2023-09-05 21:45:37 | github_id int64 7.28k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 13 values | gha_event_created_at timestamp[us]date 2012-06-11 04:05:37 2023-09-14 21:59:18 ⌀ | gha_created_at timestamp[us]date 2008-05-22 07:58:19 2023-08-28 02:39:21 ⌀ | gha_language stringclasses 62 values | src_encoding stringclasses 26 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 128 12.8k | extension stringclasses 11 values | content stringlengths 128 8.19k | authors listlengths 1 1 | author_id stringlengths 1 79 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c4da91123de17e7c5d1f94a1fb2bd57c2c9ae00c | b66e3ca567191e9ba650dec06da8a753c13d165c | /app/src/main/java/com/zxn/gaode/mapdemo/overlay/PolylineActivity.java | dd91ae1b470e456c044d3690c0385c724c644880 | [] | no_license | AsaLynn/MyGaoDeDemo | cac629b16a40bfdf2207d6f9cdd8b809e2cd4f2e | 190b1f1a3db58678ec3789a96b2b4cbb06e826da | refs/heads/master | 2021-09-12T23:13:56.478145 | 2018-04-22T12:57:37 | 2018-04-22T12:57:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,289 | java | package com.zxn.gaode.mapdemo.overlay;
import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;
import com.zxn.gaode.R;
import com.amap.api.maps.AMap;
import com.amap.api.maps.CameraUpdateFactory;
import com.amap.api.maps.MapView;
import com.amap.api.maps.model.BitmapDescriptor;
import com.amap.api.maps.model.BitmapDescriptorFactory;
import com.amap.api.maps.model.LatLng;
import com.amap.api.maps.model.Polyline;
import com.amap.api.maps.model.PolylineOptions;
import com.zxn.gaode.mapdemo.util.Constants;
import java.util.ArrayList;
import java.util.List;
/**
* AMapV2地图中简单介绍一些Polyline的用法.
*/
public class PolylineActivity extends Activity implements
OnSeekBarChangeListener {
private static final int WIDTH_MAX = 50;
private static final int HUE_MAX = 255;
private static final int ALPHA_MAX = 255;
private AMap aMap;
private MapView mapView;
private Polyline polyline;
private SeekBar mColorBar;
private SeekBar mAlphaBar;
private SeekBar mWidthBar;
/*
* 为方便展示多线段纹理颜色等示例事先准备好的经纬度
*/
private double Lat_A = 35.909736;
private double Lon_A = 80.947266;
private double Lat_B = 35.909736;
private double Lon_B = 89.947266;
private double Lat_C = 31.909736;
private double Lon_C = 89.947266;
private double Lat_D = 31.909736;
private double Lon_D = 99.947266;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.polyline_activity);
/*
* 设置离线地图存储目录,在下载离线地图或初始化地图设置;
* 使用过程中可自行设置, 若自行设置了离线地图存储的路径,
* 则需要在离线地图下载和使用地图页面都进行路径设置
* */
//Demo中为了其他界面可以使用下载的离线地图,使用默认位置存储,屏蔽了自定义设置
// MapsInitializer.sdcardDir =OffLineMapUtils.getSdCacheDir(this);
mapView = (MapView) findViewById(R.id.map);
mapView.onCreate(savedInstanceState);// 此方法必须重写
init();
addPolylinessoild();//画实线
addPolylinesdotted();//画虚线
addPolylinesWithTexture();//画纹理线
}
/**
* 初始化AMap对象
*/
private void init() {
mColorBar = (SeekBar) findViewById(R.id.hueSeekBar);
mColorBar.setMax(HUE_MAX);
mColorBar.setProgress(10);
mAlphaBar = (SeekBar) findViewById(R.id.alphaSeekBar);
mAlphaBar.setMax(ALPHA_MAX);
mAlphaBar.setProgress(255);
mWidthBar = (SeekBar) findViewById(R.id.widthSeekBar);
mWidthBar.setMax(WIDTH_MAX);
mWidthBar.setProgress(10);
if (aMap == null) {
aMap = mapView.getMap();
setUpMap();
}
}
private void setUpMap() {
mColorBar.setOnSeekBarChangeListener(this);
mAlphaBar.setOnSeekBarChangeListener(this);
mWidthBar.setOnSeekBarChangeListener(this);
aMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(39.300299, 106.347656), 4));
aMap.setMapTextZIndex(2);
}
//绘制一条实线
private void addPolylinessoild() {
LatLng A = new LatLng(Lat_A, Lon_A);
LatLng B = new LatLng(Lat_B, Lon_B);
LatLng C = new LatLng(Lat_C, Lon_C);
LatLng D = new LatLng(Lat_D, Lon_D);
aMap.addPolyline((new PolylineOptions())
.add(A, B, C, D)
.width(10)
.color(Color.argb(255, 1, 255, 255)));
}
// 绘制一条虚线
private void addPolylinesdotted() {
polyline = aMap.addPolyline((new PolylineOptions())
.add(Constants.SHANGHAI, Constants.BEIJING, Constants.CHENGDU)
.width(10)
.setDottedLine(true)//设置虚线
.color(Color.argb(255, 1, 1, 1)));
}
//绘制一条纹理线
private void addPolylinesWithTexture() {
//四个点
LatLng A = new LatLng(Lat_A+1, Lon_A+1);
LatLng B = new LatLng(Lat_B+1, Lon_B+1);
LatLng C = new LatLng(Lat_C+1, Lon_C+1);
LatLng D = new LatLng(Lat_D+1, Lon_D+1);
//用一个数组来存放纹理
List<BitmapDescriptor> texTuresList = new ArrayList<BitmapDescriptor>();
texTuresList.add(BitmapDescriptorFactory.fromResource(R.drawable.map_alr));
texTuresList.add(BitmapDescriptorFactory.fromResource(R.drawable.custtexture));
texTuresList.add(BitmapDescriptorFactory.fromResource(R.drawable.map_alr_night));
//指定某一段用某个纹理,对应texTuresList的index即可, 四个点对应三段颜色
List<Integer> texIndexList = new ArrayList<Integer>();
texIndexList.add(0);//对应上面的第0个纹理
texIndexList.add(2);
texIndexList.add(1);
PolylineOptions options = new PolylineOptions();
options.width(20);//设置宽度
//加入四个点
options.add(A,B,C,D);
//加入对应的颜色,使用setCustomTextureList 即表示使用多纹理;
options.setCustomTextureList(texTuresList);
//设置纹理对应的Index
options.setCustomTextureIndex(texIndexList);
aMap.addPolyline(options);
}
/**
* 方法必须重写
*/
@Override
protected void onResume() {
super.onResume();
mapView.onResume();
}
/**
* 方法必须重写
*/
@Override
protected void onPause() {
super.onPause();
mapView.onPause();
}
/**
* 方法必须重写
*/
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
mapView.onSaveInstanceState(outState);
}
/**
* 方法必须重写
*/
@Override
protected void onDestroy() {
super.onDestroy();
mapView.onDestroy();
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
/**
* Polyline中对填充颜色,透明度,画笔宽度设置响应事件
*/
@Override
public void onProgressChanged(SeekBar seekBar, int progress,
boolean fromUser) {
if (polyline == null) {
return;
}
if (seekBar == mColorBar) {
polyline.setColor(Color.argb(255, progress, 1, 1));
} else if (seekBar == mAlphaBar) {
float[] prevHSV = new float[3];
Color.colorToHSV(polyline.getColor(), prevHSV);
polyline.setColor(Color.HSVToColor(progress, prevHSV));
} else if (seekBar == mWidthBar) {
polyline.setWidth(progress);
}
}
}
| [
"zhang721588@163.com"
] | zhang721588@163.com |
82db7a23777f1d931d5899cb7d8a42ee00d94e0d | be37aa95857f8dcbc627f7cfd5ebfb693f1f79e8 | /org/omg/DynamicAny/NameDynAnyPair.java | 0fe079e8d475a938838c92de67173f8ff5058417 | [] | no_license | woniper/java_source_reading | aca54710b76be4635b197b3594d1c8c77c8eb5d4 | 8e6cfdba5fea15b2d3f0360b12453a3e73f306e8 | refs/heads/master | 2021-01-01T05:29:40.308753 | 2016-05-19T04:06:14 | 2016-05-19T04:06:14 | 59,172,081 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 803 | java | package org.omg.DynamicAny;
/**
* org/omg/DynamicAny/NameDynAnyPair.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from /HUDSON3/workspace/8-2-build-macosx-x86_64/jdk8u66/4988/corba/src/share/classes/org/omg/DynamicAny/DynamicAny.idl
* Tuesday, October 6, 2015 4:10:32 PM PDT
*/
public final class NameDynAnyPair implements org.omg.CORBA.portable.IDLEntity
{
/**
* The name associated with the DynAny.
*/
public String id = null;
/**
* The DynAny value associated with the name.
*/
public org.omg.DynamicAny.DynAny value = null;
public NameDynAnyPair ()
{
} // ctor
public NameDynAnyPair (String _id, org.omg.DynamicAny.DynAny _value)
{
id = _id;
value = _value;
} // ctor
} // class NameDynAnyPair
| [
"lkw1989@wemakeprice.com"
] | lkw1989@wemakeprice.com |
0f03d3878f0d7f2ca6cbbb90551abd587478038d | 6847722d0479548b4069fba18c00358e3ad14676 | /WCCI/src/it/unimi/dsi/fastutil/shorts/AbstractShort2ShortSortedMap.java | 330f8bdb72fa5233b18c9a62ebb5bff17feaa192 | [] | no_license | sfbaqai/racingcar | 90de325ac107f86f7ae862b77e3d132adf721814 | 3b72cfb5b8b49c6683358469cdd52ec073c9b156 | refs/heads/master | 2021-01-10T04:15:03.318224 | 2011-10-12T10:07:07 | 2011-10-12T10:07:07 | 48,247,283 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,646 | java | /* Generic definitions */
/* Assertions (useful to generate conditional code) */
/* Current type and class (and size, if applicable) */
/* Value methods */
/* Interfaces (keys) */
/* Interfaces (values) */
/* Abstract implementations (keys) */
/* Abstract implementations (values) */
/* Static containers (keys) */
/* Static containers (values) */
/* Implementations */
/* Synchronized wrappers */
/* Unmodifiable wrappers */
/* Other wrappers */
/* Methods (keys) */
/* Methods (values) */
/* Methods (keys/values) */
/* Methods that have special names depending on keys (but the special names depend on values) */
/* Equality */
/* Object/Reference-only definitions (keys) */
/* Primitive-type-only definitions (keys) */
/* Object/Reference-only definitions (values) */
/* Primitive-type-only definitions (values) */
/*
* fastutil: Fast & compact type-specific collections for Java
*
* Copyright (C) 2002-2008 Sebastiano Vigna
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
package it.unimi.dsi.fastutil.shorts;
import it.unimi.dsi.fastutil.shorts.ShortCollection;
import it.unimi.dsi.fastutil.shorts.AbstractShortCollection;
import it.unimi.dsi.fastutil.shorts.AbstractShortIterator;
import it.unimi.dsi.fastutil.shorts.ShortIterator;
import it.unimi.dsi.fastutil.objects.ObjectBidirectionalIterator;
import it.unimi.dsi.fastutil.objects.ObjectSortedSet;
import java.util.Map;
/** An abstract class providing basic methods for sorted maps implementing a type-specific interface. */
public abstract class AbstractShort2ShortSortedMap extends AbstractShort2ShortMap implements Short2ShortSortedMap {
public static final long serialVersionUID = -1773560792952436569L;
protected AbstractShort2ShortSortedMap() {}
/** Delegates to the corresponding type-specific method. */
public Short2ShortSortedMap headMap( final Short to ) {
return headMap( ((to).shortValue()) );
}
/** Delegates to the corresponding type-specific method. */
public Short2ShortSortedMap tailMap( final Short from ) {
return tailMap( ((from).shortValue()) );
}
/** Delegates to the corresponding type-specific method. */
public Short2ShortSortedMap subMap( final Short from, final Short to ) {
return subMap( ((from).shortValue()), ((to).shortValue()) );
}
/** Delegates to the corresponding type-specific method. */
public Short firstKey() {
return (Short.valueOf(firstShortKey()));
}
/** Delegates to the corresponding type-specific method. */
public Short lastKey() {
return (Short.valueOf(lastShortKey()));
}
/** Returns a type-specific-sorted-set view of the keys of this map.
*
* <P>The view is backed by the sorted set returned by {@link #entrySet()}. Note that
* <em>no attempt is made at caching the result of this method</em>, as this would
* require adding some attributes that lightweight implementations would
* not need. Subclasses may easily override this policy by calling
* this method and caching the result, but implementors are encouraged to
* write more efficient ad-hoc implementations.
*
* @return a sorted set view of the keys of this map; it may be safely cast to a type-specific interface.
*/
public ShortSortedSet keySet() {
return new KeySet();
}
/** A wrapper exhibiting the keys of a map. */
protected class KeySet extends AbstractShortSortedSet {
public boolean contains( final short k ) { return containsKey( k ); }
public int size() { return AbstractShort2ShortSortedMap.this.size(); }
public void clear() { AbstractShort2ShortSortedMap.this.clear(); }
public ShortComparator comparator() { return AbstractShort2ShortSortedMap.this.comparator(); }
public short firstShort() { return firstShortKey(); }
public short lastShort() { return lastShortKey(); }
public ShortSortedSet headSet( final short to ) { return headMap( to ).keySet(); }
public ShortSortedSet tailSet( final short from ) { return tailMap( from ).keySet(); }
public ShortSortedSet subSet( final short from, final short to ) { return subMap( from, to ).keySet(); }
public ShortBidirectionalIterator iterator( final short from ) { return new KeySetIterator ( entrySet().iterator( new BasicEntry ( from, ((short)0) ) ) ); }
public ShortBidirectionalIterator iterator() { return new KeySetIterator ( entrySet().iterator() ); }
}
/** A wrapper exhibiting a map iterator as an iterator on keys.
*
* <P>To provide an iterator on keys, just create an instance of this
* class using the corresponding iterator on entries.
*/
protected static class KeySetIterator extends AbstractShortBidirectionalIterator {
protected final ObjectBidirectionalIterator<Map.Entry <Short, Short>> i;
public KeySetIterator( ObjectBidirectionalIterator<Map.Entry <Short, Short>> i ) {
this.i = i;
}
public short nextShort() { return ((i.next().getKey()).shortValue()); };
public short previousShort() { return ((i.previous().getKey()).shortValue()); };
public boolean hasNext() { return i.hasNext(); }
public boolean hasPrevious() { return i.hasPrevious(); }
}
/** Returns a type-specific collection view of the values contained in this map.
*
* <P>The view is backed by the sorted set returned by {@link #entrySet()}. Note that
* <em>no attempt is made at caching the result of this method</em>, as this would
* require adding some attributes that lightweight implementations would
* not need. Subclasses may easily override this policy by calling
* this method and caching the result, but implementors are encouraged to
* write more efficient ad-hoc implementations.
*
* @return a type-specific collection view of the values contained in this map.
*/
public ShortCollection values() {
return new ValuesCollection();
}
/** A wrapper exhibiting the values of a map. */
protected class ValuesCollection extends AbstractShortCollection {
public ShortIterator iterator() { return new ValuesIterator ( entrySet().iterator() ); }
public boolean contains( final short k ) { return containsValue( k ); }
public int size() { return AbstractShort2ShortSortedMap.this.size(); }
public void clear() { AbstractShort2ShortSortedMap.this.clear(); }
}
/** A wrapper exhibiting a map iterator as an iterator on values.
*
* <P>To provide an iterator on values, just create an instance of this
* class using the corresponding iterator on entries.
*/
protected static class ValuesIterator extends AbstractShortIterator {
protected final ObjectBidirectionalIterator<Map.Entry <Short, Short>> i;
public ValuesIterator( ObjectBidirectionalIterator<Map.Entry <Short, Short>> i ) {
this.i = i;
}
public short nextShort() { return ((i.next().getValue()).shortValue()); };
public boolean hasNext() { return i.hasNext(); }
}
@SuppressWarnings("unchecked")
public ObjectSortedSet<Map.Entry<Short, Short>> entrySet() {
return (ObjectSortedSet)short2ShortEntrySet();
}
}
| [
"ducthangho@dc7059a3-8d4d-0410-a780-f9787e1663d2"
] | ducthangho@dc7059a3-8d4d-0410-a780-f9787e1663d2 |
edc0378d689aa39b71833802a922e4a08e412b6c | cba2e2ee2fb7fd7eb4ee4ba90b9978a7a2cfea63 | /app/src/main/java/com/valdroide/mycitysshopsuser/main/draw/DrawFragmentPresenterImpl.java | 97e723a4219fabb4cf87f9f9c9c145e07eaf5f51 | [] | no_license | LeonardoValderas/MyCitysShopsUser | 7739e89321c471f3ac123e234356a2cc29413ad7 | deff894f58e560393c713d66c3d7530e7c5069af | refs/heads/master | 2021-01-23T04:53:58.205380 | 2017-07-24T19:46:23 | 2017-07-24T19:46:23 | 86,253,238 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,605 | java | package com.valdroide.mycitysshopsuser.main.draw;
import android.content.Context;
import com.valdroide.mycitysshopsuser.entities.shop.Draw;
import com.valdroide.mycitysshopsuser.lib.base.EventBus;
import com.valdroide.mycitysshopsuser.main.draw.events.DrawFragmentEvent;
import com.valdroide.mycitysshopsuser.main.draw.ui.DrawFragmentView;
import org.greenrobot.eventbus.Subscribe;
public class DrawFragmentPresenterImpl implements DrawFragmentPresenter {
DrawFragmentView view;
EventBus eventBus;
DrawFragmentInteractor interactor;
public DrawFragmentPresenterImpl(DrawFragmentView view, EventBus eventBus, DrawFragmentInteractor interactor) {
this.view = view;
this.eventBus = eventBus;
this.interactor = interactor;
}
@Override
public void onCreate() {
eventBus.register(this);
}
@Override
public void onDestroy() {
eventBus.unregister(this);
}
@Override
public void getDraws(Context context) {
interactor.getDraws(context);
}
@Override
public DrawFragmentView getView() {
return this.view;
}
@Override
public void participate(Context context, Draw draw, String dni, String name) {
interactor.participate(context, draw, dni, name);
}
@Override
public void refreshLayout(Context context) {
interactor.refreshLayout(context);
}
@Override
public void getDrawSearch(Context context, String letter) {
interactor.getDrawSearch(context, letter);
}
@Subscribe
@Override
public void onEventMainThread(DrawFragmentEvent event) {
if (view != null) {
switch (event.getType()) {
case DrawFragmentEvent.DRAWS:
view.setDraws(event.getDrawList());
view.hideProgressDialog();
break;
case DrawFragmentEvent.PARTICIPATESUCCESS:
view.hideProgressDialog();
view.participationSuccess();
break;
case DrawFragmentEvent.ERROR:
view.hideProgressDialog();
view.setError(event.getError());
break;
case DrawFragmentEvent.WITHOUTCHANGE:
view.hideProgressDialog();
view.withoutChange();
break;
case DrawFragmentEvent.GETDRAWSREFRESH:
view.hideProgressDialog();
view.setDrawsRefresh();
break;
}
}
}
}
| [
"l.v.bass@hotmail.com"
] | l.v.bass@hotmail.com |
0ff5743826c05a89a00bf170abc6cb8ff66ea189 | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/MOCKITO-9b-5-15-NSGA_II-LineCoverage:ExceptionType:StackTraceSimilarity/org/mockito/internal/handler/NullResultGuardian_ESTest.java | 67c2742931c3f192e39dc53042a41a80f3274e9d | [] | no_license | STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application | cf118b23ecb87a8bf59643e42f7556b521d1f754 | 3bb39683f9c343b8ec94890a00b8f260d158dfe3 | refs/heads/master | 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 571 | java | /*
* This file was automatically generated by EvoSuite
* Mon Apr 06 10:17:50 UTC 2020
*/
package org.mockito.internal.handler;
import org.junit.Test;
import static org.junit.Assert.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class NullResultGuardian_ESTest extends NullResultGuardian_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
0f2e2bea3cbe73dbc583abfcab1d6a3156ca939d | f1495bdedbc32c05cd4e87fff13a9997eaa6f925 | /jfwAptOrm/src/main/java/org/jfw/apt/orm/annotation/dao/method/operator/UpdateWith.java | f304495e7c54c16654278fafb06a32343f0c9a24 | [] | no_license | saga810203/jFrameWork | 94e566439583bc7fcfa4165ddc9748ba2ad6d479 | ba1d96c5b4b73fee1759011f74c3271c2f94e630 | refs/heads/master | 2020-05-21T22:43:19.604449 | 2017-03-30T04:04:21 | 2017-03-30T04:04:21 | 62,480,201 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 328 | java | package org.jfw.apt.orm.annotation.dao.method.operator;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.SOURCE)
public @interface UpdateWith {
}
| [
"pengjia@isoftstone.com"
] | pengjia@isoftstone.com |
04da17d4911bd0c9fafe12a83ea47afd5d9fc5f3 | c2f9d69a16986a2690e72718783472fc624ded18 | /com/google/M.java | ee377c48897a4f0d7bd89511d552c65dbf2dab3b | [] | no_license | mithileshongit/WhatsApp-Descompilado | bc973e1356eb043661a2efc30db22bcc1392d7f3 | 94a9d0b1c46bb78676ac401572aa11f60e12345e | refs/heads/master | 2021-01-16T20:56:27.864244 | 2015-02-09T04:08:40 | 2015-02-09T04:08:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 216 | java | package com.google;
final class m extends c {
m() {
}
public dS a(I i, aC aCVar) {
return new dS(i, aCVar, null);
}
public Object a(I i, aC aCVar) {
return a(i, aCVar);
}
}
| [
"hjcf@cin.ufpe.br"
] | hjcf@cin.ufpe.br |
f68b439cdff2f5a16bada8500f48aa65f2f2af03 | c9d1ed728caf4b18ac6a68f13f093f43893db249 | /chapter_007/src/main/java/ru/job4j/textsearcher/ParallelSearch.java | eed4e89907b43bc6a8344f6e8d14e42885328723 | [
"Apache-2.0"
] | permissive | danailKondov/dkondov | 07580eabe06ffd7bc77566fc8969b0e2253dd20d | 14b3d2940638b2f69072dbdc0a9d7f8ba1b3748b | refs/heads/master | 2021-01-01T16:00:49.687121 | 2018-05-10T19:45:50 | 2018-05-10T19:45:50 | 97,752,582 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 6,449 | java | package ru.job4j.textsearcher;
import net.jcip.annotations.GuardedBy;
import net.jcip.annotations.ThreadSafe;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.*;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* Class for multithreaded text search and saving
* file path with matched text.
*
* @since 02/10/2017
* @version 1
*/
@ThreadSafe
public class ParallelSearch {
/**
* Start folder for search.
*/
private final String root;
/**
* Test for search in files.
*/
private final String text;
/**
* File extensions for search.
*/
private final List<String> exts;
/**
* Contains paths to files with needed text.
*/
private final Queue<String> results = new ConcurrentLinkedQueue<>();
/**
* Thread pool for search tasks.
*/
private final ExecutorService executorService;
/**
* Constructor.
*
* @param root start folder for search
* @param text for search in files
* @param exts file extensions for search
*/
public ParallelSearch(String root, String text, List<String> exts) {
this.root = root;
this.text = text;
this.exts = exts;
executorService = Executors.newCachedThreadPool();
}
/**
* Initializes search.
*/
public void go() {
search(new File(root));
}
/**
* Searches files with matched text and extensions
* and adds their names to result list.
*
* @param rootFile start point for search.
*/
private void search(File rootFile) {
// попробовал рекурсивный обход дерева вложенных файлов и папок,
// но он не подходит т.к. невозможно определить конец
// поиска чтобы вызвать shutdown() для executorService
//
// if (rootFile.isFile()) {
// executorService.submit(new SearchTask(rootFile));
// } else if (rootFile.isDirectory()) {
// for (File file : rootFile.listFiles()) {
// search(file);
// }
// }
// ...поэтому будем использовать очередь и нерекурсивное решение,
// тогда размер очереди (== 0) будет указывать на конец
// поиска и можно вызывать shutdown(), а в вызове
// результатов сделать блокировку на isTerminated()
Queue<File> queue = new ArrayDeque<>();
queue.add(rootFile);
while(queue.size() != 0) {
File file = queue.poll();
if (file.isFile()) {
executorService.submit(new SearchTask(file));
} else if (file.isDirectory()) {
for (File xFile : file.listFiles()) {
queue.add(xFile);
}
}
}
executorService.shutdown();
}
/**
* Class is search task for threads.
*/
private class SearchTask implements Runnable {
/**
* File for search.
*/
private File file;
public SearchTask(File file) {
this.file = file;
}
@Override
public void run() {
searchText(file);
}
/**
* Tests file extension and searches text in it.
*
* @param file to search text in.
* @return true if file contains text
*/
private boolean searchText(File file) {
boolean result = false;
// получаем расширение
String fileExt = getFileExtension(file);
// проверяем расширение
if (exts.contains(fileExt)) {
// читаем содержимое файла...
Path filePath = file.toPath();
StringBuilder sb = null;
try (BufferedReader bf = Files.newBufferedReader(filePath)) {
sb = new StringBuilder();
String s;
while((s = bf.readLine()) != null) {
sb.append(s);
}
} catch (IOException e) {
e.printStackTrace();
System.out.println("Can't read file: " + file.toString());
}
// ...и проверяем на совпадение с заданным текстом
if (sb != null) {
Pattern p = Pattern.compile(".*" + text + ".*");
Matcher m = p.matcher(sb);
result = m.matches();
if (result) {
// addToResults(file.getPath());
results.add(file.getPath());
}
}
}
return result;
}
/**
* Gets file extension.
*
* @param file ext to find
* @return extension
*/
private String getFileExtension(File file) {
String fileName = file.getName();
String result = null;
int index = fileName.lastIndexOf(".");
if (index != -1 && index != 0) {
result = fileName.substring(index + 1);
}
return result;
}
}
// /**
// * Adds file path to results in thread safe mode.
// * @param filePath to add
// */
// private synchronized void addToResults(String filePath) {
// results.add(filePath);
// }
/**
* Returns list of results of search.
* @return results of search
*/
public Queue<String> result() {
// ждем, пока все потоки не отработают,
// чтобы вернуть результат
while(!executorService.isTerminated()) {
try {
Thread.sleep(2);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
return results;
}
}
| [
"dkondov@yandex.ru"
] | dkondov@yandex.ru |
2c59f655565bd9ce016600a5acda623fa35a99d9 | 2e8230d774f37416a8e1c19ef44bc391a05eb49f | /src/main/java/de/ellpeck/actuallyadditions/mod/network/gui/IButtonReactor.java | 0796dc58f6ffe0dc11e37072084e4781f38aba5b | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | akennedy4155/ActuallyAdditions | 1cd5f18a8523cd69cfd806a1333c76dda459d3b9 | d4f98090d1fe5d2ee5b769f77440f18aa6d67ef8 | refs/heads/master | 2020-04-25T12:37:46.631739 | 2019-02-27T19:51:41 | 2019-02-27T19:51:41 | 172,784,237 | 0 | 0 | NOASSERTION | 2019-02-26T20:20:43 | 2019-02-26T20:20:43 | null | UTF-8 | Java | false | false | 754 | java | /*
* This file ("IButtonReactor.java") is part of the Actually Additions mod for Minecraft.
* It is created and owned by Ellpeck and distributed
* under the Actually Additions License to be found at
* http://ellpeck.de/actaddlicense
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
*
* © 2015-2017 Ellpeck
*/
package de.ellpeck.actuallyadditions.mod.network.gui;
import net.minecraft.entity.player.EntityPlayer;
public interface IButtonReactor{
/**
* Called when a Button in a GUI is pressed
* Gets called on the Server, sent from the Client
*
* @param buttonID The button's ID
* @param player The Player pressing it
*/
void onButtonPressed(int buttonID, EntityPlayer player);
}
| [
"megamaximal@gmail.com"
] | megamaximal@gmail.com |
2b6b67dd2e47159c892595ffff992811230ac5d6 | a16611c75fa0c8699bdf97ab1a9d24c442d48a57 | /ucloude-uts/ucloude-uts-core/src/main/java/cn/uway/ucloude/uts/core/support/CrossClassLoader.java | d7db09c34f0d5144cb45f8937235e7a840277975 | [] | no_license | un-knower/yuncaiji_v4 | cfaf3f18accb794901f70f7252af30280414e7ed | a4ff027e485272b73e2c6fb3f1dd098f5499086b | refs/heads/master | 2020-03-17T23:14:40.121595 | 2017-05-21T05:55:51 | 2017-05-21T05:55:51 | 134,036,686 | 0 | 1 | null | 2018-05-19T06:35:12 | 2018-05-19T06:35:12 | null | UTF-8 | Java | false | false | 1,644 | java | package cn.uway.ucloude.uts.core.support;
import java.lang.reflect.Field;
import java.util.Vector;
import cn.uway.ucloude.log.ILogger;
import cn.uway.ucloude.log.LoggerManager;
/**
* 用来处理跨classLoader 共享class
* @author uway
*
*/
public class CrossClassLoader {
private static final ILogger LOGGER = LoggerManager.getLogger(CrossClassLoader.class);
private static Field classes;
private static final Object LOCK = new Object();
static {
try {
classes = ClassLoader.class.getDeclaredField("classes");
classes.setAccessible(true);
} catch (Throwable e) {
LOGGER.error("get ClassLoader 'classes' Field Error", e);
}
}
@SuppressWarnings("unchecked")
public static Class loadClass(String classname) throws ClassNotFoundException {
if (classes == null) {
return Thread.currentThread().getContextClassLoader().loadClass(classname);
}
try {
synchronized (LOCK) {
Vector v = (Vector) classes.get(CrossClassLoader.class.getClassLoader().getParent());
for (int i = 0; i < v.size(); i++) {
Class o = (Class) v.get(i);
if (classname.equals(o.getName())) {
return o;
}
}
Class clazz = CrossClassLoader.class.getClassLoader().loadClass(classname);
v.add(clazz);
return clazz;
}
} catch (Exception e) {
throw new ClassNotFoundException("load " + classname + " Error ", e);
}
}
}
| [
"1852300415@qq.com"
] | 1852300415@qq.com |
638bcefb62d340e6cf40fc57c1cac676a5448fb1 | ed5159d056e98d6715357d0d14a9b3f20b764f89 | /test/irvine/oeis/a054/A054603Test.java | 6ef75e79202aeda2b57e11c64034815e4e35b523 | [] | no_license | flywind2/joeis | c5753169cf562939b04dd246f8a2958e97f74558 | e5efd6971a0062ac99f4fae21a7c78c9f9e74fea | refs/heads/master | 2020-09-13T18:34:35.080552 | 2019-11-19T05:40:55 | 2019-11-19T05:40:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 195 | java | package irvine.oeis.a054;
import irvine.oeis.AbstractSequenceTest;
/**
* Tests the corresponding class.
* @author Sean A. Irvine
*/
public class A054603Test extends AbstractSequenceTest {
}
| [
"sairvin@gmail.com"
] | sairvin@gmail.com |
d2d3c73db965c7869bafe343af3f14e9de2ba5d5 | 6a5e53d54a8e9787b390f9c3b69db2d7153d08bb | /core/modules/spring/src/main/java/org/onetwo/common/spring/cache/MethodKeyGenerator.java | c54a1e226807b01c26c31a8cbfca0b9079c1d3d2 | [
"Apache-2.0"
] | permissive | wayshall/onetwo | 64374159b23fc8d06373a01ecc989db291e57714 | 44c9cd40bc13d91e4917c6eb6430a95f395f906a | refs/heads/master | 2023-08-17T12:26:47.634987 | 2022-07-05T06:54:30 | 2022-07-05T06:54:30 | 47,802,308 | 23 | 13 | Apache-2.0 | 2023-02-22T07:08:34 | 2015-12-11T03:17:58 | Java | UTF-8 | Java | false | false | 1,128 | java | package org.onetwo.common.spring.cache;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.springframework.cache.interceptor.KeyGenerator;
import org.springframework.cache.interceptor.SimpleKeyGenerator;
public class MethodKeyGenerator extends SimpleKeyGenerator implements KeyGenerator {
@Override
public Object generate(Object target, Method method, Object... params) {
List<Object> keyParamList = new ArrayList<Object>(3+params.length);
/*if(target!=null){
keyParamList.add(target);
}*/
keyParamList.add(method.toGenericString());
keyParamList.addAll(Arrays.asList(params));
// return generateKey(keyParamList.toArray());
return generateMethodKey(keyParamList.toArray());
}
public static Object generateMethodKey(Object... params) {
if (params.length == 0) {
return MethodSimpleKey.EMPTY;
}
if (params.length == 1) {
Object param = params[0];
if (param != null && !param.getClass().isArray()) {
return param;
}
}
MethodSimpleKey key = new MethodSimpleKey();
key.setParams(params);
return key;
}
}
| [
"weishao.zeng@gmail.com"
] | weishao.zeng@gmail.com |
df24ccf846178cf6cc60d3605a1e939df6234660 | 20eb62855cb3962c2d36fda4377dfd47d82eb777 | /IntroClassJava/dataset/grade/e23b96b6bab26bd14316cefafcbaa16dd8eafcfb97a7159a7772f3c8bb3e78fb353dea728f6b4df6528286af5f0b85fd134c79886c9c2a352fe80d8204c69111/002/mutations/89/grade_e23b96b6_002.java | 6a32002a28182895604c515db269d4558d40543f | [] | no_license | ozzydong/CapGen | 356746618848065cce4e253e5d3c381baa85044a | 0ba0321b6b1191443276021f1997833342f02515 | refs/heads/master | 2023-03-18T20:12:02.923428 | 2020-08-21T03:08:28 | 2020-08-21T03:08:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,552 | java | package introclassJava;
class IntObj {
public int value;
public IntObj () {
} public IntObj (int i) {
value = i;
}
}
class FloatObj {
public float value;
public FloatObj () {
} public FloatObj (float i) {
value = i;
}
}
class LongObj {
public long value;
public LongObj () {
} public LongObj (long i) {
value = i;
}
}
class DoubleObj {
public double value;
public DoubleObj () {
} public DoubleObj (double i) {
value = i;
}
}
class CharObj {
public char value;
public CharObj () {
} public CharObj (char i) {
value = i;
}
}
public class grade_e23b96b6_002 {
public java.util.Scanner scanner;
public String output = "";
public static void main (String[]args) throws Exception {
grade_e23b96b6_002 mainClass = new grade_e23b96b6_002 ();
String output;
if (args.length > 0) {
mainClass.scanner = new java.util.Scanner (args[0]);
} else {
mainClass.scanner = new java.util.Scanner (System.in);
}
mainClass.exec ();
System.out.println (mainClass.output);
}
public void exec () throws Exception {
FloatObj a = new FloatObj (), b = new FloatObj (), c =
new FloatObj (), d = new FloatObj ();
FloatObj percent = new FloatObj ();
output +=
(String.format
("Enter thresholds for A, B, C, D\nin that order, decreasing percentages > "));
a.value = scanner.nextFloat ();
b.value = scanner.nextFloat ();
c.value = scanner.nextFloat ();
d.value = scanner.nextFloat ();
output +=
(String.format ("Thank you. Now enter student score (percent) >"));
percent.value = scanner.nextFloat ();
if (percent.value > a.value) {
output += (String.format ("Student has an A grade\n"));
} else if (percent.value < a.value && percent.value >= b.value) {
output += (String.format ("Student has an B grade\n"));
} else if (percent.value < b.value && percent.value >= c.value) {
output += (String.format ("Student has an C grade\n"));
} else if (true) return ;
if (percent.value < c.value && percent.value >= d.value) {
output += (String.format ("Student has an D grade\n"));
} else if (percent.value < d.value) {
output += (String.format ("Student has failed that course\n"));
}
if (true)
return;;
}
}
| [
"justinwm@163.com"
] | justinwm@163.com |
8b0198208d0c16f6b1747ff91ddbda3606f1d791 | 67e735ab2b0f3190968aa248e80a7b3a570f1101 | /JspAndServlets/11_ServletWithAnnotation/src/com/demo/listner/DbDriverListner.java | 0d4674f7e31d40f9785ab3d8389a426fe1945c03 | [] | no_license | DivyaMaddipudi/HCL_Training | 7ed68a19552310093895e12deacf0f019b07b49c | c7a6bd9fbac7f3398e7d68e8dce5f72ed13d14ec | refs/heads/master | 2023-01-28T18:33:04.969333 | 2020-12-08T18:05:32 | 2020-12-08T18:05:32 | 304,354,730 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 467 | java | package com.demo.listner;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;
@WebListener
public class DbDriverListner implements ServletContextListener {
public void contextDestroyed(ServletContextEvent sce) {
System.out.println("destroy in listner");
}
public void contextInitialized(ServletContextEvent sce) {
System.out.println("init in listner");
}
}
| [
"divya.maddipudi1@gmail.com"
] | divya.maddipudi1@gmail.com |
2c57d57b39d1c4a99fd18d9709471f8648e7280c | 6ce88a15d15fc2d0404243ca8415c84c8a868905 | /bitcamp-java-basic/src/step05/Exam04_2.java | e95a8fc0e9417977f879916739e1d29cf18d68b5 | [] | no_license | SangKyeongLee/bitcamp | 9f6992ce2f3e4425f19b0af19ce434c4864e610b | a26991752920f280f6404565db2b13a0c34ca3d9 | refs/heads/master | 2021-01-24T10:28:54.595759 | 2018-08-10T07:25:57 | 2018-08-10T07:25:57 | 123,054,474 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 898 | java | // 반복문 for
package step05;
import java.util.Scanner;
public class Exam04_2 {
public static void main(String[] args) {
// for 문 안에 선언된 변수는 for 문을 나가는 순간 제거된다.
for(int i = 1; i <= 5; i++){
System.out.println(i);
}
System.out.println("------------------------------");
// 그래서 다음과 같이 i 변수의 값을 조회하려 하면
// 컴파일 오류가 발생한다.
//System.out.println(i);
// 반복문을 종료한 뒤라도 해당 변수의 값을 사용하고 싶으면,
// 다음과 같이 반복문 밖에 변수를 선언하라!
int x = 0;
for(x = 1; x <= 5; x++){
System.out.println(x);
}
System.out.printf("x = %d\n",x);
System.out.println("------------------------------");
}
} | [
"sangkyeong.lee93@gmail.com"
] | sangkyeong.lee93@gmail.com |
cd4bb6e4c26c7e52ac2aace688bed7c0b5ba5b03 | 83d56024094d15f64e07650dd2b606a38d7ec5f1 | /Construccion/PROYECTO.SICC/INTSYS/ENTIDADES/src/es/indra/sicc/dtos/intsys/DTODatosAdicionales.java | d1dfc85032dd8967eff69feb449fcfb19d5283ff | [] | no_license | cdiglesias/SICC | bdeba6af8f49e8d038ef30b61fcc6371c1083840 | 72fedb14a03cb4a77f62885bec3226dbbed6a5bb | refs/heads/master | 2021-01-19T19:45:14.788800 | 2016-04-07T16:20:51 | 2016-04-07T16:20:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,590 | java | package es.indra.sicc.dtos.intsys;
import es.indra.sicc.cmn.negocio.auditoria.DTOAuditableSICC;
public class DTODatosAdicionales extends DTOAuditableSICC
{
private Long oidCliente;
private String codPeriodo;
private String codAcceso;
private String codAtributo11;
private String valorAtributo11;
private String codAtributo12;
private String valorAtributo12;
public DTODatosAdicionales()
{
}
public void setOidCliente(Long newOidCliente) {
this.oidCliente = newOidCliente;
}
public Long getOidCliente() {
return oidCliente;
}
public void setCodAcceso(String newCodAcceso){
codAcceso = newCodAcceso;
}
public String getCodAcceso() {
return codAcceso;
}
public void setCodPeriodo(String newCodPeriodo){
codPeriodo = newCodPeriodo;
}
public String getCodPeriodo() {
return codPeriodo;
}
public void setCodAtributo11(String newCodAtributo11){
codAtributo11 = newCodAtributo11;
}
public String getCodAtributo11() {
return codAtributo11;
}
public void setValorAtributo11(String newValorAtributo11){
valorAtributo11= newValorAtributo11;
}
public String getValorAtributo11() {
return valorAtributo11;
}
public void setCodAtributo12(String newCodAtributo12){
codAtributo12 = newCodAtributo12;
}
public String getCodAtributo12() {
return codAtributo12;
}
public void setValorAtributo12(String newValorAtributo12){
valorAtributo12 = newValorAtributo12;
}
public String getValorAtributo12() {
return valorAtributo12;
}
} | [
"hp.vega@hotmail.com"
] | hp.vega@hotmail.com |
53980bfbedb6c993df61f4e28832f73a1457fceb | 978f8e0107e19dfbb7d71c28b4c745f29da30ae4 | /java案例/常用类范例/常用类/java web/jsp/表单回显值/login/testFilter/src/cn/scxh/servlet/LogoutServlet.java | 69714c8876d7489a1180d05767535ba6dd7c5dc2 | [] | no_license | buyaoyongroot/wulin_java_resources_repository | e9eb134fa14b80de32124a911902f737e44cf078 | de2ffc06e4227a7a5e4068243d8e8745865a9e23 | refs/heads/master | 2022-03-08T09:52:24.172318 | 2019-11-15T02:04:05 | 2019-11-15T02:04:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 629 | java | package cn.scxh.servlet;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class LogoutServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
this.doPost(req, resp);
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
req.getSession().invalidate();
resp.sendRedirect("login.html");
}
}
| [
"1178649872@qq.com"
] | 1178649872@qq.com |
3104f4f8b66003e36437a05c9574e4f9c9ef8441 | cd48551346edeef17d95527f1acd78bb3d4c47f3 | /src/main/java/org/openide/actions/MoveUpAction.java | 20e7b1ee2ad2ac7534a99593c52f19fa12ab60db | [
"Apache-2.0"
] | permissive | tszielin/q-lab-editor | 56c387f5a8f2437857813754b1e17fcc9ecd4411 | eaf1baa4373d8ee476c0b8cfbc30c54fe0afbd46 | refs/heads/master | 2021-01-10T02:23:49.816445 | 2016-03-02T16:56:10 | 2016-03-02T16:56:10 | 52,768,617 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,341 | java | /*
* Sun Public License Notice
*
* The contents of this file are subject to the Sun Public License
* Version 1.0 (the "License"). You may not use this file except in
* compliance with the License. A copy of the License is available at
* http://www.sun.com/
*
* The Original Code is NetBeans. The Initial Developer of the Original
* Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
* Microsystems, Inc. All Rights Reserved.
*/
package org.openide.actions;
import java.lang.ref.Reference;
import java.lang.ref.WeakReference;
import java.util.Arrays;
import javax.swing.event.ChangeListener;
import javax.swing.event.ChangeEvent;
import org.openide.ErrorManager;
import org.openide.nodes.Index;
import org.openide.util.HelpCtx;
import org.openide.util.actions.*;
import org.openide.nodes.Node;
import org.openide.util.NbBundle;
/** Move an item up in a list.
* This action is final only for performance reasons.
*
* @see Index
* @author Ian Formanek, Jan Jancura, Dafe Simonek
*/
public final class MoveUpAction extends NodeAction {
/** generated Serialized Version UID */
static final long serialVersionUID = -8201315242813084212L;
/** the key to listener to reorder of selected nodes */
private static final String PROP_ORDER_LISTENER = "sellistener"; // NOI18N
/** Holds index cookie on which we are listening */
private Reference curIndexCookie;
private static ErrorManager err = null;
private static boolean errInited = false;
private static final void initErr () {
if (! errInited) {
errInited = true;
ErrorManager master = ErrorManager.getDefault();
ErrorManager tmp = master.getInstance("org.openide.actions.MoveUpAction"); // NOI18N
if (tmp.isLoggable (ErrorManager.UNKNOWN)) {
err = tmp;
}
}
}
/* Initilizes the set of properties.
*/
protected void initialize () {
initErr ();
if (err != null) {
err.log (ErrorManager.UNKNOWN, "initialize");
}
super.initialize();
// initializes the listener
OrderingListener sl = new OrderingListener();
putProperty(PROP_ORDER_LISTENER, sl);
}
/** Getter for curIndexCookie */
private Index getCurIndexCookie() {
return (curIndexCookie == null ? null : (Index) curIndexCookie.get());
}
/* Actually performs the action of moving up
* in the order.
* @param activatedNodes The nodes on which to perform the action.
*/
protected void performAction (Node[] activatedNodes) {
// we need to check activatedNodes, because there's no
// guarantee that they not changed between enable() and
// performAction calls
Index cookie = getIndexCookie(activatedNodes);
if (cookie == null) return;
int nodeIndex = cookie.indexOf(activatedNodes[0]);
if (nodeIndex > 0) {
cookie.moveUp(nodeIndex);
}
}
/* Manages enable - disable logic of this action */
protected boolean enable (Node[] activatedNodes) {
initErr ();
if (err != null) {
err.log (ErrorManager.UNKNOWN, "enable; activatedNodes=" + (activatedNodes == null ? null : Arrays.asList (activatedNodes)));
}
// remove old listener, if any
Index idx = getCurIndexCookie();
if (idx != null) {
idx.removeChangeListener(
(ChangeListener) getProperty(PROP_ORDER_LISTENER));
}
Index cookie = getIndexCookie(activatedNodes);
if (err != null) {
err.log (ErrorManager.UNKNOWN, "enable; cookie=" + cookie);
}
if (cookie == null) return false;
// now start listening to reordering changes
cookie.addChangeListener(
(OrderingListener)getProperty(PROP_ORDER_LISTENER));
curIndexCookie = new WeakReference(cookie);
int index = cookie.indexOf (activatedNodes[0]);
if (err != null) {
err.log (ErrorManager.UNKNOWN, "enable; index=" + index);
if (index == -1) {
Node parent = activatedNodes[0].getParentNode ();
err.log (ErrorManager.UNKNOWN, "enable; parent=" + parent + "; parent.children=" + Arrays.asList (parent.getChildren ().getNodes ()));
}
}
return index > 0;
}
/* Human presentable name of the action. This should be
* presented as an item in a menu.
* @return the name of the action
*/
public String getName() {
return NbBundle.getMessage(MoveUpAction.class, "MoveUp");
}
/* Help context where to find more about the action.
* @return the help context for this action
*/
public HelpCtx getHelpCtx() {
return new HelpCtx (MoveUpAction.class);
}
/** Helper method. Returns index cookie or null, if some
* conditions weren't satisfied */
private Index getIndexCookie (Node[] activatedNodes) {
if ((activatedNodes == null) || (activatedNodes.length != 1))
return null;
Node parent = activatedNodes[0].getParentNode();
if (parent == null) return null;
return (Index)parent.getCookie(Index.class);
}
/** Listens to the ordering changes and enables/disables the
* action if appropriate */
private final class OrderingListener implements ChangeListener {
OrderingListener() {}
public void stateChanged (ChangeEvent e) {
initErr ();
Node[] activatedNodes = getActivatedNodes();
if (err != null) {
err.log (ErrorManager.UNKNOWN, "stateChanged; activatedNodes=" + (activatedNodes == null ? null : Arrays.asList (activatedNodes)));
}
Index cookie = getIndexCookie(activatedNodes);
if (err != null) {
err.log (ErrorManager.UNKNOWN, "stateChanged; cookie=" + cookie);
}
if (cookie == null) {
setEnabled (false);
} else {
int index = cookie.indexOf (activatedNodes[0]);
if (err != null) {
err.log (ErrorManager.UNKNOWN, "stateChanged; index=" + index);
}
setEnabled (index > 0);
}
}
}
}
| [
"thomas.zielinski@cognizant.com"
] | thomas.zielinski@cognizant.com |
f7a23b1eaf6a2000a89cb6649d4753e0a344f08c | a18d32695523092bfc3957be0eb628d7483b7101 | /src/main/java/com/google/security/zynamics/binnavi/Tutorials/CTutorialLoader.java | 4eb2477818807d4baeff00677d28f18bcaa3aeae | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | vbatts/binnavi | 9c37ac74dbe3d9d676ade04a6c181b1b1626cc3e | a2a3fa4ebe4c7953f648072afb26a34408256bbf | refs/heads/master | 2021-01-15T22:53:07.507135 | 2015-08-20T14:00:52 | 2015-08-20T14:10:03 | 41,112,676 | 2 | 0 | null | 2015-08-20T18:35:42 | 2015-08-20T18:35:42 | null | UTF-8 | Java | false | false | 5,675 | java | /*
Copyright 2015 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package com.google.security.zynamics.binnavi.Tutorials;
import com.google.security.zynamics.binnavi.CUtilityFunctions;
import com.google.security.zynamics.zylib.io.DirUtils;
import com.google.security.zynamics.zylib.io.IDirectoryTraversalCallback;
import com.google.security.zynamics.zylib.types.lists.FilledList;
import com.google.security.zynamics.zylib.types.lists.IFilledList;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
/**
* Loads tutorials from the tutorial directory.
*/
public final class CTutorialLoader {
/**
* You are not supposed to instantiate this class.
*/
private CTutorialLoader() {
}
/**
* Loads a single tutorial from a file.
*
* @param file The tutorial file to load.
*
* @return The loaded tutorial.
*
* @throws ParserConfigurationException if a DocumentBuilder cannot be created which satisfies the
* configuration requested.
* @throws SAXException If any parse errors occur.
* @throws IOException If any IO errors occur.
*/
private static CTutorial loadTutorial(final File file) throws ParserConfigurationException,
SAXException, IOException {
String name = "";
String description = "";
final List<CTutorialStep> steps = new ArrayList<CTutorialStep>();
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
final DocumentBuilder builder = factory.newDocumentBuilder();
final Document document = builder.parse(file);
final NodeList nodes = document.getFirstChild().getChildNodes();
for (int i = 0; i < nodes.getLength(); ++i) {
final Node node = nodes.item(i);
final String nodeName = node.getNodeName();
if ("name".equals(nodeName)) {
name = node.getTextContent();
} else if ("description".equals(nodeName)) {
description = node.getTextContent();
} else if ("steps".equals(nodeName)) {
steps.addAll(readSteps(node));
}
}
return new CTutorial(name, description, steps);
}
/**
* Reads the individual steps of a tutorial.
*
* @param node The steps XML node that is the parent node of the individual steps.
*
* @return The list of read steps.
*/
private static List<CTutorialStep> readSteps(final Node node) {
final List<CTutorialStep> steps = new ArrayList<CTutorialStep>();
for (int i = 0; i < node.getChildNodes().getLength(); ++i) {
final Node child = node.getChildNodes().item(i);
final String childText = child.getNodeName();
if ("step".equals(childText)) {
final List<Long> identifiers = new ArrayList<Long>();
final List<Long> allows = new ArrayList<Long>();
String actionDescription = null;
boolean next = false;
for (int j = 0; j < child.getChildNodes().getLength(); ++j) {
final Node child2 = child.getChildNodes().item(j);
final String childName = child2.getNodeName();
if ("action".equals(childName)) {
final long index = Long.valueOf(child2.getTextContent());
if (index == 0) {
next = true;
continue;
}
identifiers.add(index);
} else if ("allowed".equals(childName)) {
final long index = Long.valueOf(child2.getTextContent());
allows.add(index);
} else if ("description".equals(childName)) {
actionDescription = child2.getTextContent();
}
}
steps.add(new CTutorialStep(actionDescription, identifiers, allows, next));
}
}
return steps;
}
/**
* Loads all tutorial files from the given directory.
*
* @param directory Directory from which the tutorials are loaded.
*
* @return List of tutorials loaded from the tutorial files in the given directory.
*/
public static IFilledList<CTutorial> readTutorials(final String directory) {
final IFilledList<CTutorial> tutorials = new FilledList<CTutorial>();
DirUtils.traverse(new File(directory), new IDirectoryTraversalCallback() {
@Override
public void entering(final File directory) {
// Irrelevant
}
@Override
public void leaving(final File directory) {
// Irrelevant
}
@Override
public void nextFile(final File file) {
if (file.getAbsolutePath().endsWith("xml")) {
try {
tutorials.add(loadTutorial(file));
} catch (final ParserConfigurationException e) {
CUtilityFunctions.logException(e);
} catch (final SAXException e) {
CUtilityFunctions.logException(e);
} catch (final IOException e) {
CUtilityFunctions.logException(e);
}
}
}
});
return tutorials;
}
}
| [
"cblichmann@google.com"
] | cblichmann@google.com |
f3af92d0667160f5a623511991473fde37608764 | 0f2893c143d32bf6749675d4b62214863d7aaa3c | /src/test/java/com/github/jonathanxd/wcommands/commandapi/TestLT.java | 4a0b7005c4d4e968711d97564975e39566096bb9 | [
"MIT"
] | permissive | JonathanxD/WCommands | 8f5e3e08ad2ab4a6d411764606c6c0655e958029 | 754502500510753e44d97a884456cb76ab87e7c2 | refs/heads/master | 2020-04-16T20:13:40.734356 | 2017-06-28T05:33:05 | 2017-06-28T05:33:05 | 52,735,571 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,613 | java | /*
* WCommands - Yet Another Command API! <https://github.com/JonathanxD/WCommands>
*
* The MIT License (MIT)
*
* Copyright (c) 2016 TheRealBuggy/JonathanxD (https://github.com/JonathanxD/ & https://github.com/TheRealBuggy/) <jonathan.scripter@programmer.net>
* Copyright (c) contributors
*
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.github.jonathanxd.wcommands.commandapi;
import com.github.jonathanxd.wcommands.CommonHandler;
import com.github.jonathanxd.wcommands.WCommandCommon;
import com.github.jonathanxd.wcommands.command.CommandSpec;
import com.github.jonathanxd.wcommands.command.holder.CommandHolder;
import com.github.jonathanxd.wcommands.common.command.CommandList;
import com.github.jonathanxd.wcommands.defaults.argument.BooleanArgumentSpec;
import com.github.jonathanxd.wcommands.exceptions.ErrorType;
import com.github.jonathanxd.wcommands.exceptions.ProcessingError;
import com.github.jonathanxd.wcommands.factory.CommandBuilder;
import com.github.jonathanxd.wcommands.handler.ErrorHandler;
import com.github.jonathanxd.wcommands.handler.ProcessAction;
import com.github.jonathanxd.wcommands.infos.InformationRegister;
import com.github.jonathanxd.wcommands.infos.requirements.Requirements;
import com.github.jonathanxd.wcommands.processor.CommonProcessor;
import com.github.jonathanxd.wcommands.text.Text;
import com.github.jonathanxd.wcommands.ticket.CommonTicket;
import org.junit.Test;
import java.util.Optional;
public class TestLT {
// --allowUpper false --daemon --rail true
@Test
public void firstTest() throws ProcessingError {
WCommandCommon wCommandCommon = new WCommandCommon(new CommonProcessor());
/*wCommandCommon.registerCommand(CommandVisitor.create("allowUpper",
new BooleanArgumentSpec<IDs>(IDs.ALLOW_UPPER, false),
false,
"--"));*/
wCommandCommon.getRegister(new CommonTicket<>(this)).registerCommand(CommandBuilder.builder()
.withPrefix("--")
.withName(Text.of("allowUpper"))
.withArgument(new BooleanArgumentSpec<>(IDs.ALLOW_UPPER, false, false))
.withCommonHandler((commandData, requirements, ref) -> {
CommandHolder holder = commandData.getCommand();
Optional<Boolean> isAllowUpper = holder.getArgValue(IDs.ALLOW_UPPER);
if (isAllowUpper.isPresent()) {
if (isAllowUpper.get()) {
System.out.println("Allowed upper case");
} else {
System.out.println("Disallowed upper case");
}
}
return null;
})
.build()
);
wCommandCommon.getRegister(new CommonTicket<>(this)).registerCommand(CommandBuilder.builder()
.withPrefix("--")
.withName(Text.of("daemon"))
.withCommonHandler((commandData, requirements, ref) -> {System.out.println("Start Daemon"); return null;})
.build());
wCommandCommon.getRegister(new CommonTicket<>(this)).registerCommand(CommandBuilder.builder()
.withPrefix("--")
.withName(Text.of("rail"))
.withArgument(new BooleanArgumentSpec<>(IDs.RAIL, false, false))
.withValueHandler(new CommonHandler.Value<IDs, Boolean>(IDs.RAIL) {
@Override
public Object handle(Boolean value) {
if (value) {
System.out.println("Allowed rail");
} else {
System.out.println("Disallowed rail");
}
return null;
}
})
.build()
);
wCommandCommon.processAndInvoke("--allowUpper", "false", "--daemon", "--rail", "false");
}
public enum IDs {
ALLOW_UPPER,
RAIL
}
public static class MyErrorHandler implements ErrorHandler {
@Override
public ProcessAction handle(ProcessingError error, CommandList commandSpecs, CommandSpec current, Object processed, Requirements requirements, InformationRegister register) {
return (error.getType().getExceptionType() != ErrorType.Type.ERROR) ? ProcessAction.CONTINUE : ProcessAction.STOP;
}
}
}
| [
"joniweb01@gmail.com"
] | joniweb01@gmail.com |
87b35c19752a010e898b1c20733801625adca8f1 | f39965b1fdfc693316d1898f3289b481eb173499 | /river-upms/river-upms-api/src/main/java/com/cloud/river/upms/api/entity/SysRoleMenu.java | 4c3590d44893a4fa080b49ad7b6e46f6b43be2eb | [] | no_license | luchangjiang/RiverCloud | a8d917603d07ff5b76f66f95050f7366aaa50e0a | cad7e7570e9467e35f107ecfb3fcf138fbc01d35 | refs/heads/master | 2020-05-02T11:09:22.953009 | 2019-04-08T07:39:52 | 2019-04-08T07:39:52 | 177,919,581 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,322 | java | /*
*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*
*/
package com.cloud.river.upms.api.entity;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 角色菜单表
* </p>
*
* @author lengleng
* @since 2017-10-29
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class SysRoleMenu extends Model<SysRoleMenu> {
private static final long serialVersionUID = 1L;
/**
* 角色ID
*/
private Integer roleId;
/**
* 菜单ID
*/
private Integer menuId;
}
| [
"20207075@qq.com"
] | 20207075@qq.com |
28de02f68ebfb781706129342384cf8d901f007c | 6b4125b3d69cbc8fc291f93a2025f9f588d160d3 | /components/net/src/main/java/org/limewire/net/address/AddressFactory.java | 4f51794d30fa074c94159e76c45654dfca5a9148 | [] | no_license | mnutt/limewire5-ruby | d1b079785524d10da1b9bbae6fe065d461f7192e | 20fc92ea77921c83069e209bb045b43b481426b4 | refs/heads/master | 2022-02-10T12:20:02.332362 | 2009-09-11T15:47:07 | 2009-09-11T15:47:07 | 89,669 | 2 | 3 | null | 2022-01-27T16:18:46 | 2008-12-12T19:40:01 | Java | UTF-8 | Java | false | false | 1,771 | java | package org.limewire.net.address;
import java.io.IOException;
import org.limewire.io.Address;
/**
* A collection of <code>AddressSerializer</code>s. <code>Address</code>s should register
* themselves with this factory via the <code>addSerializer()</code> method at injection time.
*/
public interface AddressFactory {
/**
* Registers an AddressSerializer with this AddressFactory.
*/
public void registerSerializer(AddressSerializer serializer);
/**
* @param address cannot be null
* @return the AddressSerializer for a particular class
* @throws IllegalArgumentException if an AddressSerializer does not
* exist for the specified address
*/
public AddressSerializer getSerializer(Address address) throws IllegalArgumentException;
/**
* Looks up serializer by {@link AddressSerializer#getAddressType()}.
* @return null if no serializer is registered for that type
*/
public AddressSerializer getSerializer(String addressType);
/**
* Deserialize an address, typically as read from a network message
* @param type the type of message contained in the byte array. Will match
* AddressSerializer.getType() for the AddressSerialzer for the Address contained
* in the byte []
* @return a non-null Address
* @throws IOException if there is an error deserializing the Address
*/
public Address deserialize(String type, byte [] serializedAddress) throws IOException;
/**
* Turns a user-input String into an Address.
* @return an address representing the String parameter; never null
* @throws IOException if the input cannot be converted into an Address
*/
public Address deserialize(String address) throws IOException;
}
| [
"michael@nuttnet.net"
] | michael@nuttnet.net |
edb39b960ec88aca0cc74676422cbc3d96ced690 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/3/3_00160d7278fb77b802198c33f43fdd65b1d6eae1/DefaultComesLastCheck/3_00160d7278fb77b802198c33f43fdd65b1d6eae1_DefaultComesLastCheck_t.java | 82304d0a0bb07bbd3524c3cc0dc942019c0e702d | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 2,948 | java | ////////////////////////////////////////////////////////////////////////////////
// checkstyle: Checks Java source code for adherence to a set of rules.
// Copyright (C) 2001-2005 Oliver Burn
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
////////////////////////////////////////////////////////////////////////////////
package com.puppycrawl.tools.checkstyle.checks.coding;
import com.puppycrawl.tools.checkstyle.api.Check;
import com.puppycrawl.tools.checkstyle.api.DetailAST;
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
/**
* <p>
* Check that the <code>default</code> is after all the <code>case</code>s
* in a <code>switch</code> statement.
* </p>
* <p>
* Rationale: Java allows <code>default</code> anywhere within the
* <code>switch</code> statement. But if it comes after the last
* <code>case</code> then it is more readable.
* </p>
* <p>
* An example of how to configure the check is:
* </p>
* <pre>
* <module name="DefaultComesLast"/>
* </pre>
* @author o_sukhodolsky
*/
public class DefaultComesLastCheck extends Check
{
/** Creates new instance of the check. */
public DefaultComesLastCheck()
{
// do nothing
}
/** {@inheritDoc} */
public int[] getDefaultTokens()
{
return new int[] {
TokenTypes.LITERAL_DEFAULT,
};
}
/** {@inheritDoc} */
public int[] getAcceptableTokens()
{
return getDefaultTokens();
}
/** {@inheritDoc} */
public void visitToken(DetailAST aAST)
{
final DetailAST defaultGroupAST = aAST.getParent();
//default keywords used in annotations too - not what we're
//interested in
if (defaultGroupAST.getType() != TokenTypes.ANNOTATION_FIELD_DEF) {
final DetailAST switchAST = defaultGroupAST.getParent();
final DetailAST lastGroupAST =
switchAST.getLastChild().getPreviousSibling();
if (defaultGroupAST.getLineNo() != lastGroupAST.getLineNo()
|| defaultGroupAST.getColumnNo() != lastGroupAST.getColumnNo())
{
log(aAST, "default.comes.last");
}
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
24dd6fff1f04a0415ce67cc57a4e2bba5d5c4781 | 6573f97fbe6461f2481091d3a321e69cfaba9fd7 | /iBase4J-Common/src/main/java/top/ibase4j/core/support/pay/AliPayConfig.java | 60df5dfa3997628a5580c1b0436896fb87976dfb | [
"Apache-2.0"
] | permissive | LeeJeam/tourShare | 1ce65e9602decf04e52d0bd89fe2ac754bcdce56 | 2c8380d3e4284ef35837ff44beecfb547007cb0d | refs/heads/master | 2022-12-16T15:28:23.904487 | 2019-07-07T03:55:42 | 2019-07-07T03:55:42 | 195,601,846 | 1 | 1 | null | 2022-12-15T23:42:14 | 2019-07-07T02:33:28 | Java | UTF-8 | Java | false | false | 4,349 | java | package top.ibase4j.core.support.pay;
import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
@Configuration
@ConditionalOnProperty("alipay")
public class AliPayConfig {
private static Logger logger = LoggerFactory.getLogger(AliPayConfig.class);
@Autowired
public Environment env;
private String privateKey;
private String alipayPublicKey;
private String appId;
private String serviceUrl;
private String charset;
private String signType;
private String format;
private AlipayClient alipayClient;
private static AliPayConfig config;
@Bean
public AliPayConfig aliPayConfigs() {
logger.info("加载支付宝配置...");
config = new AliPayConfig();
config.setPrivateKey(env.getProperty("alipay.privateKey"));
config.setAlipayPublicKey(env.getProperty("alipay.alipayPulicKey"));
config.setAppId(env.getProperty("alipay.appId"));
config.setServiceUrl(env.getProperty("alipay.serverUrl"));
config.setCharset(env.getProperty("alipay.charset"));
return config;
}
public static AliPayConfig build() {
config.alipayClient = new DefaultAlipayClient(config.getServiceUrl(), config.getAppId(), config.getPrivateKey(),
config.getFormat(), config.getCharset(), config.getAlipayPublicKey(), config.getSignType());
return config;
}
public String getPrivateKey() {
if (StringUtils.isBlank(privateKey)) throw new IllegalStateException("privateKey 未被赋值");
return privateKey;
}
public AliPayConfig setPrivateKey(String privateKey) {
if (StringUtils.isBlank(privateKey)) throw new IllegalArgumentException("privateKey 值不能为空");
this.privateKey = privateKey;
return this;
}
public String getAlipayPublicKey() {
if (StringUtils.isBlank(alipayPublicKey)) throw new IllegalStateException("alipayPublicKey 未被赋值");
return alipayPublicKey;
}
public AliPayConfig setAlipayPublicKey(String alipayPublicKey) {
if (StringUtils.isBlank(alipayPublicKey)) throw new IllegalArgumentException("alipayPublicKey 值不能为空");
this.alipayPublicKey = alipayPublicKey;
return this;
}
public String getAppId() {
if (StringUtils.isBlank(appId)) throw new IllegalStateException("appId 未被赋值");
return appId;
}
public AliPayConfig setAppId(String appId) {
if (StringUtils.isBlank(appId)) throw new IllegalArgumentException("appId 值不能为空");
this.appId = appId;
return this;
}
public String getServiceUrl() {
if (StringUtils.isBlank(serviceUrl)) throw new IllegalStateException("serviceUrl 未被赋值");
return serviceUrl;
}
public AliPayConfig setServiceUrl(String serviceUrl) {
if (StringUtils.isBlank(serviceUrl)) serviceUrl = "https://openapi.alipay.com/gateway.do";
this.serviceUrl = serviceUrl;
return this;
}
public String getCharset() {
if (StringUtils.isBlank(charset)) charset = "UTF-8";
return charset;
}
public AliPayConfig setCharset(String charset) {
if (StringUtils.isBlank(charset)) charset = "UTF-8";
this.charset = charset;
return this;
}
public String getSignType() {
if (StringUtils.isBlank(signType)) signType = "RSA2";
return signType;
}
public AliPayConfig setSignType(String signType) {
if (StringUtils.isBlank(signType)) signType = "RSA2";
this.signType = signType;
return this;
}
public String getFormat() {
if (StringUtils.isBlank(format)) format = "json";
return format;
}
public AlipayClient getAlipayClient() {
if (alipayClient == null) throw new IllegalStateException("alipayClient 未被初始化");
return alipayClient;
}
}
| [
"goodbye_li@163.com"
] | goodbye_li@163.com |
e3491c57d4a34b17307aded1e3fb1edd6a6549a6 | d93ce8a57be61625c4259b41f860c596726bd2af | /src/main/java/soot/baf/NegInst.java | f5b1dcbfc91b88d1438171e0e73f6d0efe99b4f4 | [
"Apache-2.0"
] | permissive | izgzhen/markii | 81b67049ce817582736c8d630ec0e2cd12caa214 | 237a054a72f01121ce0fefac7532c1a39444e852 | refs/heads/master | 2023-05-06T00:24:48.026714 | 2021-04-14T17:41:27 | 2021-04-16T06:29:12 | 275,070,321 | 5 | 0 | Apache-2.0 | 2021-04-16T06:29:13 | 2020-06-26T04:06:53 | Java | UTF-8 | Java | false | false | 906 | java | package soot.baf;
/*-
* #%L
* Soot - a J*va Optimization Framework
* %%
* Copyright (C) 1999 Patrick Lam, Patrick Pominville and Raja Vallee-Rai
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 2.1 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Lesser Public License for more details.
*
* You should have received a copy of the GNU General Lesser Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/lgpl-2.1.html>.
* #L%
*/
public interface NegInst extends OpTypeArgInst {
}
| [
"7168454+izgzhen@users.noreply.github.com"
] | 7168454+izgzhen@users.noreply.github.com |
3f82d95663c129065337d62246aec4c6dce91129 | e2c5f97074476733a4372c662d8430029e381a8c | /src/day58/TryCatchFinally.java | ade4efb659d834a5882d68deaf85d8f4fb6f088e | [] | no_license | Halis-Can/JavaProgrammingB15Online | 571e8bf07697d6c274c55d270ef4f0a7ca97e890 | 6df977bddc9531a932893965cdcf9ced2ee76c69 | refs/heads/master | 2021-08-20T04:04:40.840907 | 2021-02-11T05:00:33 | 2021-02-11T05:00:33 | 244,282,494 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 830 | java | package day58;
public class TryCatchFinally {
public static void main(String[] args) {
System.out.println("Before try catch");
try {
System.out.println("Hello From Try block");
String str = null;
System.out.println(str.length());
} catch (Exception e) {
System.out.println("Exception happened and caught");
}
System.out.println("After try catch");
try {
System.out.println("Hello From Try block");
String str = null;
System.out.println(str.length());
} catch (Exception e) {
System.out.println("Exception happened and caught");
} finally {
System.out.println("Finally block. Runs always. Runs if there is Exception or No Exception");
}
}
}
| [
"github@cybertekschool.com"
] | github@cybertekschool.com |
4ba47111214c904c71ae307179b31791ff397436 | 96a7d93cb61cef2719fab90742e2fe1b56356d29 | /selected projects/desktop/SweetHome3D-5.6-src/src/com/eteks/sweethome3d/model/SelectionListener.java | e46a580421f47bef2b96e24faa09ea18f2ab97bf | [
"MIT",
"BSD-3-Clause",
"LicenseRef-scancode-proprietary-license",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-oracle-openjdk-exception-2.0",
"Classpath-exception-2.0",
"BSD-3-Clause-No-Nuclear-License",
"GPL-2.0-only",
"AML",
"BSD-2-Clause",
"LGPL-3.0-only",
"LGPL-2.0-or-later",
"BSD-3-Clause-No-Nuclear-Warranty",
"LicenseRef-scancode-khronos",
"SGI-B-2.0",
"Apache-1.1",
"Apache-2.0",
"LicenseRef-scancode-nvidia-2002",
"GPL-1.0-or-later",
"LicenseRef-scancode-inno-setup",
"LicenseRef-scancode-sun-bcl-sdk-1.4.2",
"CPL-1.0",
"GPL-2.0-or-later",
"LicenseRef-scancode-jdom",
"LicenseRef-scancode-public-domain-disclaimer"
] | permissive | danielogen/msc_research | cb1c0d271bd92369f56160790ee0d4f355f273be | 0b6644c11c6152510707d5d6eaf3fab640b3ce7a | refs/heads/main | 2023-03-22T03:59:14.408318 | 2021-03-04T11:54:49 | 2021-03-04T11:54:49 | 307,107,229 | 0 | 1 | MIT | 2021-03-04T11:54:49 | 2020-10-25T13:39:50 | Java | UTF-8 | Java | false | false | 1,206 | java | /*
* SelectionListener.java 26 juin 2006
*
* Sweet Home 3D, Copyright (c) 2006 Emmanuel PUYBARET / eTeks <info@eteks.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package com.eteks.sweethome3d.model;
import java.util.EventListener;
/**
* Listener implemented to receive notifications of selection changes in {@link Home}.
* @author Emmanuel Puybaret
*/
public interface SelectionListener extends EventListener {
/**
* Invoked when selection changed.
*/
void selectionChanged(SelectionEvent selectionEvent);
}
| [
"danielogen@gmail.com"
] | danielogen@gmail.com |
8984c2804b907ae20d81d74b834f2eabf16d6a1f | a36dad85e8e08d146b337851016681f97c07f3f1 | /TimeAxis_old/src/com/polaris/store/oauth/RedirectException.java | 930001ce492dddc00bc156317b1065ec6c27d54c | [] | no_license | ahmedyasserarafat/m-supply-prd | cb2ad75b0a1b5e3e690de484f27006da0d5dc060 | 432be2bd049068011cac353440b0c171f424fe4b | refs/heads/master | 2020-04-10T01:27:11.620225 | 2018-12-06T18:54:05 | 2018-12-06T18:54:05 | 160,716,379 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 326 | java | package com.polaris.store.oauth;
public class RedirectException extends RuntimeException {
private static final long serialVersionUID = 1L;
private final String url;
public RedirectException(String url) {
super();
this.url = url;
}
public String url() {
return url;
}
}
| [
"arafatnoor@gmail.com"
] | arafatnoor@gmail.com |
edb025d46070b7b89d28d6d258ee92fc300f1a54 | f7689b3296ce91b6cc79295b31ed64d190973bf6 | /src/chap13/lecture/MyClass.java | 82fc227eeff776144bc59119414554ff6026645e | [] | no_license | Hangeony/java20200929 | e5939ae6174d5a9ed9be4c53343416d53e1366e7 | 9ce8ff8479b9708f79824d6391ae25e6e2fa6d14 | refs/heads/master | 2023-01-03T12:34:56.187354 | 2020-11-03T07:38:37 | 2020-11-03T07:38:37 | 299,485,594 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 316 | java | package chap13.lecture;
public class MyClass<T> {
public void method1() {
System.out.println("메소드 1");
}
public void method2(T s) {
System.out.println(s);
}
}
//제네릭 타입 타입 파라미터 안에서 실제 존재하는 것처럼 사용 할수 있고 실제로 사용할떄 결정된다.
| [
"geonhui95@naver.com"
] | geonhui95@naver.com |
ceabbe2a947631d0e81d9f0eb4fb9d4796d41ccb | 3f2cb4668322822a717db64a01fb56dac7e193c8 | /usecase/src/main/java/de/cassisi/heartcapture/usecase/LockOperation.java | 4b1602665db7eac574ff9f7ec3441f74097b5ed0 | [] | no_license | DomenicDev/heartcapture | 1e80c30274c9ab4246058687131b7f337814636b | f62f835f308193499b8c5d6ccb96e0b358f53f33 | refs/heads/master | 2023-03-05T15:37:27.854864 | 2021-02-15T16:30:01 | 2021-02-15T16:30:01 | 294,749,044 | 0 | 1 | null | 2021-02-01T11:10:43 | 2020-09-11T16:42:38 | Java | UTF-8 | Java | false | false | 875 | java | package de.cassisi.heartcapture.usecase;
import de.cassisi.heartcapture.usecase.dto.SimpleOperationData;
import de.cassisi.heartcapture.usecase.output.OutputHandler;
import de.cassisi.heartcapture.usecase.exception.OperationNotFoundException;
import de.cassisi.heartcapture.usecase.template.UseCaseTemplate;
import lombok.NonNull;
import static de.cassisi.heartcapture.usecase.LockOperation.InputData;
import static de.cassisi.heartcapture.usecase.LockOperation.OutputData;
public interface LockOperation extends UseCaseTemplate<InputData, OutputData> {
class InputData {
public long operationId;
public boolean locked;
}
class OutputData {
public SimpleOperationData operationData;
}
@Override
void execute(@NonNull InputData input, @NonNull OutputHandler<OutputData> outputHandler) throws OperationNotFoundException;
}
| [
"domenic.cassisi@web.de"
] | domenic.cassisi@web.de |
ed94ebec78b749497af7e07053b62cad44c8dadd | 40074451d5efb09bb7e90afad2b4d91e3bd884c7 | /eagle-core/src/main/java/in/hocg/eagle/modules/mms/service/impl/NotificationServiceImpl.java | 67732c54fc22882d57b00d6d01d9a2641c4f85b8 | [] | no_license | zgwdg/eagle | 744fc699662818a85a87a1d64a4b218d4c7e7ebd | f7d4037973b6ef046bf842117f79239fb1a81fca | refs/heads/master | 2023-03-27T20:59:58.824963 | 2021-04-01T04:27:32 | 2021-04-01T04:27:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,653 | java | package in.hocg.eagle.modules.mms.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import in.hocg.eagle.basic.ext.mybatis.core.AbstractServiceImpl;
import in.hocg.eagle.basic.constant.CodeEnum;
import in.hocg.eagle.basic.constant.datadict.NotifyType;
import in.hocg.eagle.basic.constant.datadict.SubjectType;
import in.hocg.eagle.basic.exception.ServiceException;
import in.hocg.eagle.modules.mms.mapstruct.NotificationMapping;
import in.hocg.eagle.modules.mms.entity.Notification;
import in.hocg.eagle.modules.mms.entity.Notify;
import in.hocg.eagle.modules.mms.mapper.NotificationMapper;
import in.hocg.eagle.modules.mms.pojo.dto.notify.PublishNotifyDto;
import in.hocg.eagle.modules.mms.pojo.qo.notify.PublishPrivateLetterQo;
import in.hocg.eagle.modules.mms.pojo.qo.notify.PublishSubscriptionDto;
import in.hocg.eagle.modules.mms.pojo.qo.notify.SearchNotifyPagingQo;
import in.hocg.eagle.modules.mms.pojo.vo.notify.NotifyComplexVo;
import in.hocg.eagle.modules.mms.pojo.vo.notify.SummaryVo;
import in.hocg.eagle.modules.mms.service.NotificationService;
import in.hocg.eagle.modules.mms.service.NotifyService;
import in.hocg.eagle.modules.mms.service.SubscriptionService;
import in.hocg.eagle.modules.ums.pojo.vo.account.AccountComplexVo;
import in.hocg.eagle.modules.ums.service.AccountService;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.function.Supplier;
import java.util.stream.Collectors;
/**
* <p>
* [消息模块] 通知-接收人表 服务实现类
* </p>
*
* @author hocgin
* @since 2020-03-04
*/
@Service
@RequiredArgsConstructor(onConstructor = @__(@Lazy))
public class NotificationServiceImpl extends AbstractServiceImpl<NotificationMapper, Notification>
implements NotificationService {
private final AccountService accountService;
private final NotifyService notifyService;
private final SubscriptionService subscriptionService;
private final NotificationMapping mapping;
@Override
@Transactional(rollbackFor = Exception.class)
public IPage<NotifyComplexVo> search(SearchNotifyPagingQo qo) {
final IPage<Notification> result = baseMapper.search(qo, qo.page());
result.getRecords().forEach(notification -> updateReadyAtNow(notification.getNotifyId(), notification.getReceiverId()));
return result.convert(this::convertComplex);
}
private NotifyComplexVo convertComplex(Notification notification) {
final Long notifyId = notification.getNotifyId();
final Long receiverId = notification.getReceiverId();
final Notify notify = notifyService.getById(notifyId);
final Long actorId = notify.getActorId();
final AccountComplexVo receiver = accountService.selectOne(receiverId);
final AccountComplexVo actor = accountService.selectOne(actorId);
return mapping.asSearchNotifyVo(notification, notify, receiver, actor);
}
@Override
@ApiOperation("发布私信")
@Transactional(rollbackFor = Exception.class)
public void publishPrivateLetter(PublishPrivateLetterQo qo) {
final PublishNotifyDto dto = new PublishNotifyDto();
dto.setNotifyType(NotifyType.PrivateLetter);
dto.setActorId(qo.getActorId());
dto.setContent(qo.getContent());
dto.setReceivers(qo.getReceivers());
notifyService.published(dto);
}
@Override
@ApiOperation("发布订阅通知")
@Transactional(rollbackFor = Exception.class)
public void publishSubscription(PublishSubscriptionDto subscriptionDto) throws Throwable {
final PublishNotifyDto dto = new PublishNotifyDto();
final Long subjectId = subscriptionDto.getSubjectId();
final Integer notifyTypeCode = subscriptionDto.getNotifyType();
final NotifyType notifyType = CodeEnum.of(notifyTypeCode, NotifyType.class)
.orElseThrow((Supplier<Throwable>) () -> ServiceException.wrap("通知类型错误"));
final Integer subjectTypeCode = subscriptionDto.getSubjectType();
final SubjectType subjectType = CodeEnum.of(subjectTypeCode, SubjectType.class)
.orElseThrow((Supplier<Throwable>) () -> ServiceException.wrap("订阅类型错误"));
dto.setNotifyType(notifyType);
dto.setSubjectType(subjectType);
dto.setSubjectId(subjectId);
final List<Long> receivers = subscriptionService.getReceivers(notifyType, subjectType, subjectId);
if (receivers.isEmpty()) {
return;
}
dto.setReceivers(receivers);
dto.setActorId(subscriptionDto.getActorId());
notifyService.published(dto);
}
@Override
@ApiOperation("查询详情")
@Transactional(rollbackFor = Exception.class)
public SummaryVo selectSummary(Long accountId) {
Integer readyCount = countByReady(accountId);
Integer unReadyCount = countByUnReady(accountId);
Integer top5 = 5;
final List<NotifyComplexVo> privateLetter = baseMapper.selectListByReceiverIdAndNotifyType(accountId, NotifyType.PrivateLetter.getCode(), top5)
.stream().map(this::convertComplex).collect(Collectors.toList());
final List<NotifyComplexVo> subscription = baseMapper.selectListByReceiverIdAndNotifyType(accountId, NotifyType.Subscription.getCode(), top5)
.stream().map(this::convertComplex).collect(Collectors.toList());
final List<NotifyComplexVo> announcement = baseMapper.selectListByReceiverIdAndNotifyType(accountId, NotifyType.Announcement.getCode(), top5)
.stream().map(this::convertComplex).collect(Collectors.toList());
return new SummaryVo()
.setReady(readyCount)
.setUnready(unReadyCount)
.setAnnouncement(announcement)
.setSubscription(subscription)
.setPrivateLetter(privateLetter);
}
private Integer countByUnReady(Long accountId) {
return lambdaQuery()
.eq(Notification::getReceiverId, accountId)
.isNull(Notification::getReadAt).count();
}
private Integer countByReady(Long accountId) {
return lambdaQuery()
.eq(Notification::getReceiverId, accountId)
.isNotNull(Notification::getReadAt).count();
}
@Transactional(rollbackFor = Exception.class)
public void updateReadyAtNow(Long notifyId, Long receiverId) {
baseMapper.updateReadyAtNowByNotifyId(notifyId, receiverId);
}
}
| [
"hocgin@gmail.com"
] | hocgin@gmail.com |
05cbf2ab8b40a7b92b039852da47863315fee13a | 5e4100a6611443d0eaa8774a4436b890cfc79096 | /src/main/java/com/alipay/api/domain/AlmReportData.java | e2d15b1fe0155c2a12b7ab956d63504cce5e0121 | [
"Apache-2.0"
] | permissive | coderJL/alipay-sdk-java-all | 3b471c5824338e177df6bbe73ba11fde8bc51a01 | 4f4ed34aaf5a320a53a091221e1832f1fe3c3a87 | refs/heads/master | 2020-07-15T22:57:13.705730 | 2019-08-14T10:37:41 | 2019-08-14T10:37:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,011 | java | package com.alipay.api.domain;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
/**
* 资产负债报表数据
*
* @author auto create
* @since 1.0, 2018-08-24 10:54:36
*/
public class AlmReportData extends AlipayObject {
private static final long serialVersionUID = 1835319125927525132L;
/**
* 数据大类
*/
@ApiField("biz_type")
private String bizType;
/**
* 期限类别
*/
@ApiField("date_type")
private String dateType;
/**
* 数据日期
*/
@ApiField("report_date")
private String reportDate;
/**
* 报表名称
*/
@ApiField("report_name")
private String reportName;
/**
* 报表数据,只支持整数(可为负),详细见下面描述。
金额单位:分,1万即传 1000000
百分比:乘以1万后的值。例如:50%,则提供 0.5*10000即:5000
偏离度bp:bp*1万提供。例如:30.5bp,提供值:305000
*/
@ApiField("report_value")
private Long reportValue;
/**
* 报表小类
*/
@ApiField("sub_biz_type")
private String subBizType;
public String getBizType() {
return this.bizType;
}
public void setBizType(String bizType) {
this.bizType = bizType;
}
public String getDateType() {
return this.dateType;
}
public void setDateType(String dateType) {
this.dateType = dateType;
}
public String getReportDate() {
return this.reportDate;
}
public void setReportDate(String reportDate) {
this.reportDate = reportDate;
}
public String getReportName() {
return this.reportName;
}
public void setReportName(String reportName) {
this.reportName = reportName;
}
public Long getReportValue() {
return this.reportValue;
}
public void setReportValue(Long reportValue) {
this.reportValue = reportValue;
}
public String getSubBizType() {
return this.subBizType;
}
public void setSubBizType(String subBizType) {
this.subBizType = subBizType;
}
}
| [
"ben.zy@antfin.com"
] | ben.zy@antfin.com |
a579a300f63842a6eec42c69e3506f245981e26d | 16e6d2f9664a8097ff1718fa3e19a49fc0bd7e7f | /instrumentation/spring-webmvc/src/test/java/brave/spring/webmvc/ITSpanCustomizingHandlerInterceptor.java | edce5dbd088ae265271e718b4a7d24b79234b941 | [
"Apache-2.0"
] | permissive | vikrambe/brave | d1f525b6b2eef585d7786c69b87f2a4e6e1e5ead | 37b07b3fac76a71ca6ea65805a2a1db462a1c77d | refs/heads/master | 2020-04-11T20:34:12.622373 | 2018-12-12T06:35:57 | 2018-12-12T06:35:57 | 162,075,912 | 1 | 0 | NOASSERTION | 2018-12-17T04:47:29 | 2018-12-17T04:47:29 | null | UTF-8 | Java | false | false | 710 | java | package brave.spring.webmvc;
import java.util.EnumSet;
import javax.servlet.DispatcherType;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
public class ITSpanCustomizingHandlerInterceptor extends BaseITSpanCustomizingHandlerInterceptor {
@Override protected void addDelegatingTracingFilter(ServletContextHandler handler) {
handler.addFilter(DelegatingTracingFilter.class, "/*", EnumSet.allOf(DispatcherType.class));
}
@Override
protected void registerTestController(AnnotationConfigWebApplicationContext appContext) {
appContext.register(Servlet3TestController.class); // the test resource
}
}
| [
"adriancole@users.noreply.github.com"
] | adriancole@users.noreply.github.com |
0b89a318ef4adca74974cc4c8f301e7678b7c09f | ef38d70d9b0c20da068d967e089046e626b60dea | /jmeter/104SATDmethods/87/afterReport.java | 8b8a0c061273e4abcd4e407a376c07692561b2d0 | [] | no_license | martapanc/SATD-replication-package | 0ea0e8a27582750d39f8742b3b9b2e81bb7ec25d | e3235d25235b3b46416239ee9764bfeccd2d7433 | refs/heads/master | 2021-07-18T14:28:24.543613 | 2020-07-10T09:04:40 | 2020-07-10T09:04:40 | 94,113,844 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,645 | java | /87/report.java
Satd-method: public static XMLReader getXMLParser() {
********************************************
********************************************
/87/After/Bug 59995 03a2728d2_diff.java
————————————————————————————————————————————————
*** Lines Changed in Satd-Method: ***
Lines added: 0. Lines removed: 0. Tot = 0
————————————————————————————————————————————————
*** Changed calls OF Satd-Method in Diff: ***
getXMLParser(
Lines added containing method: 0. Lines removed containing method: 0. Tot = 0
————————————————————————————————————————————————
*** Changed calls of methods FROM Satd-Method in Diff: ***
Method calls found:
* getXMLReader
* newSAXParser
********************************************
********************************************
/87/After/Bug 60018 01618c3e6_diff.java
————————————————————————————————————————————————
*** Lines Changed in Satd-Method: ***
Lines added: 0. Lines removed: 0. Tot = 0
————————————————————————————————————————————————
*** Changed calls OF Satd-Method in Diff: ***
getXMLParser(
Lines added containing method: 0. Lines removed containing method: 0. Tot = 0
————————————————————————————————————————————————
*** Changed calls of methods FROM Satd-Method in Diff: ***
Method calls found:
* getXMLReader
* newSAXParser
********************************************
********************************************
/87/After/Bug 60125 a7efa9efe_diff.java
————————————————————————————————————————————————
*** Lines Changed in Satd-Method: ***
Lines added: 0. Lines removed: 0. Tot = 0
————————————————————————————————————————————————
*** Changed calls OF Satd-Method in Diff: ***
getXMLParser(
Lines added containing method: 0. Lines removed containing method: 0. Tot = 0
————————————————————————————————————————————————
*** Changed calls of methods FROM Satd-Method in Diff: ***
Method calls found:
* getXMLReader
* newSAXParser
********************************************
********************************************
/87/After/Bug 60266 c93177faa_diff.java
————————————————————————————————————————————————
*** Lines Changed in Satd-Method: ***
Lines added: 0. Lines removed: 0. Tot = 0
————————————————————————————————————————————————
*** Changed calls OF Satd-Method in Diff: ***
getXMLParser(
Lines added containing method: 0. Lines removed containing method: 0. Tot = 0
————————————————————————————————————————————————
*** Changed calls of methods FROM Satd-Method in Diff: ***
Method calls found:
* getXMLReader
* newSAXParser
********************************************
********************************************
/87/After/Bug 60589 9418f1a3d_diff.java
————————————————————————————————————————————————
*** Lines Changed in Satd-Method: ***
Lines added: 0. Lines removed: 0. Tot = 0
————————————————————————————————————————————————
*** Changed calls OF Satd-Method in Diff: ***
getXMLParser(
Lines added containing method: 0. Lines removed containing method: 0. Tot = 0
————————————————————————————————————————————————
*** Changed calls of methods FROM Satd-Method in Diff: ***
Method calls found:
* getXMLReader
* newSAXParser
********************************************
********************************************
| [
"marta.pancaldi@stud-inf.unibz.it"
] | marta.pancaldi@stud-inf.unibz.it |
2989d62187f53216bdb69a96e5f86bb3800c9674 | e9466a0d2020c5293b48ca615a98d59500fca730 | /generatedCode/digitalbuildings-RDF4J-java/src/main/java/www/google/com/digitalbuildings/_0_0_1/fields/IReturn_air_cooling_temperature_setpoint.java | 007d278c9c41d54fe4d472b7d9e06980da4e8c4a | [] | no_license | charbull/OLGA-GeneratedCode-DigitalBuildingsOntology | fa9dafd4111f80b171810cebc9385d5171b3ec56 | bf7018f4dd621f5463b3da67da41783caba3a4fb | refs/heads/master | 2022-11-22T07:55:00.842988 | 2020-07-20T21:38:04 | 2020-07-20T21:38:04 | 281,220,093 | 1 | 0 | null | 2020-07-20T21:38:06 | 2020-07-20T20:33:52 | Java | UTF-8 | Java | false | false | 1,076 | java | package www.google.com.digitalbuildings._0_0_1.fields;
import org.eclipse.rdf4j.model.IRI;
import java.util.Set;
import www.google.com.digitalbuildings._0_0_1.subfields.ITemperature;
import www.google.com.digitalbuildings._0_0_1.subfields.ICooling;
import www.google.com.digitalbuildings._0_0_1.subfields.IReturn;
import www.google.com.digitalbuildings._0_0_1.subfields.ISetpoint;
import www.google.com.digitalbuildings._0_0_1.subfields.IAir;
public interface IReturn_air_cooling_temperature_setpoint extends IField{
public IRI iri();
public void addComposedOfAir (IAir parameter);
public Set<IAir> getComposedOfAir();
public void addComposedOfCooling (ICooling parameter);
public Set<ICooling> getComposedOfCooling();
public void addComposedOfReturn (IReturn parameter);
public Set<IReturn> getComposedOfReturn();
public void addComposedOfSetpoint (ISetpoint parameter);
public Set<ISetpoint> getComposedOfSetpoint();
public void addComposedOfTemperature (ITemperature parameter);
public Set<ITemperature> getComposedOfTemperature();
} | [
"charbel.kaed@outlook.com"
] | charbel.kaed@outlook.com |
b68b54198ae4ac996a351f8b1ebdaa0fab075107 | 5117b26cd23224dba4af894b7789fac3df56d260 | /mind-map/mind-map-model/src/main/java/com/igormaznitsa/mindmap/model/ExtraFile.java | a961202555b7b07cd569e69d2491ccaa9a217326 | [
"Apache-2.0"
] | permissive | LAP2/netbeans-mmd-plugin | f2211d6e8bf7c271e0a1a7d061b87f706f825d95 | 7b638dc00f59ddf921eceec389bf4a5bdb69d8cb | refs/heads/master | 2020-06-06T11:36:04.483956 | 2019-05-26T10:30:28 | 2019-05-26T10:30:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,016 | java | /*
* Copyright 2015-2018 Igor Maznitsa.
*
* 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.igormaznitsa.mindmap.model;
import java.io.File;
import java.net.URISyntaxException;
import java.util.Locale;
import java.util.regex.Pattern;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.apache.commons.io.FilenameUtils;
public class ExtraFile extends Extra<MMapURI> implements ExtraLinkable {
private static final long serialVersionUID = -478916403235887225L;
private final MMapURI fileUri;
private volatile String cachedString;
private final boolean mmdFileFlag;
private final String lowerCasedFileExtension;
public ExtraFile(@Nonnull final MMapURI file) {
this.fileUri = file;
this.lowerCasedFileExtension = file.getExtension().toLowerCase(Locale.ENGLISH);
this.mmdFileFlag = this.lowerCasedFileExtension.equals("mmd"); //NOI18N
}
public ExtraFile(@Nonnull final String text) throws URISyntaxException {
this(new MMapURI(text));
}
@Override
public boolean containsPattern(@Nullable final File baseFolder, @Nonnull final Pattern pattern) {
final String filePathAsText = FilenameUtils.normalize(this.fileUri.asFile(baseFolder).getAbsolutePath());
return pattern.matcher(filePathAsText).find();
}
@Override
public int hashCode() {
return this.fileUri.hashCode() ^ (this.mmdFileFlag ? 1 : 0);
}
@Override
public boolean equals(@Nullable final Object that) {
if (that == null) return false;
if (this == that) return true;
if (that instanceof ExtraFile) {
final ExtraFile thatFile = (ExtraFile) that;
return this.mmdFileFlag == thatFile.mmdFileFlag && this.fileUri.equals(thatFile.fileUri);
} else {
return false;
}
}
public boolean isMMDFile() {
return this.mmdFileFlag;
}
@Nonnull
public String getLCFileExtension() {
return this.lowerCasedFileExtension;
}
@Override
@Nonnull
public MMapURI getValue() {
return fileUri;
}
@Override
@Nonnull
public ExtraType getType() {
return ExtraType.FILE;
}
@Override
@Nonnull
public String getAsString() {
if (this.cachedString == null) {
this.cachedString = this.fileUri.asFile(null).getPath();
}
return this.cachedString;
}
@Override
@Nonnull
public String provideAsStringForSave() {
return this.fileUri.asString(false, true);
}
@Override
@Nonnull
public MMapURI getAsURI() {
return this.fileUri;
}
public boolean isAbsolute() {
return this.fileUri.isAbsolute();
}
@Nonnull
private static String ensureFolderPath(@Nonnull final String str) {
if (str.endsWith("/") || str.endsWith("\\")) return str;
return str + File.separatorChar;
}
@Nullable
public ExtraFile replaceParentPath(@Nullable final File baseFolder, @Nonnull final MMapURI oldFolder, @Nonnull final MMapURI newFolder) {
final File theFile = this.fileUri.asFile(baseFolder);
final File oldFolderFile = oldFolder.asFile(baseFolder);
final File newFolderFile = newFolder.asFile(baseFolder);
final String theFilePath = FilenameUtils.normalize(theFile.getAbsolutePath());
final String oldFolderFilePath = ensureFolderPath(FilenameUtils.normalize(oldFolderFile.getAbsolutePath()));
final String newFolderFilePath = ensureFolderPath(FilenameUtils.normalize(newFolderFile.getAbsolutePath()));
if (theFilePath.startsWith(oldFolderFilePath)){
final String changedPath = newFolderFilePath+theFilePath.substring(oldFolderFilePath.length());
return new ExtraFile(new MMapURI(this.isAbsolute() ? null : baseFolder, new File(changedPath),this.fileUri.getParameters()));
} else {
return null;
}
}
public boolean hasParent(@Nullable final File baseFolder, @Nonnull final MMapURI folder) {
final File theFile = this.fileUri.asFile(baseFolder);
final File thatFile = folder.asFile(baseFolder);
final String theFilePath = FilenameUtils.normalize(theFile.getAbsolutePath());
final String thatFilePath = ensureFolderPath(FilenameUtils.normalize(thatFile.getAbsolutePath()));
if (!theFilePath.equals(thatFilePath) && theFilePath.startsWith(thatFilePath)) {
final String diff = theFilePath.substring(thatFilePath.length()-1);
return diff.startsWith("\\") || diff.startsWith("/");
}
else {
return false;
}
}
public boolean isSameOrHasParent(@Nullable final File baseFolder, @Nonnull final MMapURI file) {
final File theFile = this.fileUri.asFile(baseFolder);
final File thatFile = file.asFile(baseFolder);
final String theFilePath = FilenameUtils.normalize(theFile.getAbsolutePath());
final String thatFilePath = FilenameUtils.normalize(thatFile.getAbsolutePath());
if (theFilePath.startsWith(thatFilePath)) {
final String diff = theFilePath.substring(thatFilePath.length());
return diff.isEmpty() || diff.startsWith("\\") || diff.startsWith("/") || thatFilePath.endsWith("/") || thatFilePath.endsWith("\\");
}
else {
return false;
}
}
public boolean isSame(@Nullable final File baseFolder, @Nonnull final MMapURI file) {
final File theFile = this.fileUri.asFile(baseFolder);
final File thatFile = file.asFile(baseFolder);
final String theFilePath = FilenameUtils.normalize(theFile.getAbsolutePath());
final String thatFilePath = FilenameUtils.normalize(thatFile.getAbsolutePath());
return theFilePath.equals(thatFilePath);
}
}
| [
"rrg4400@gmail.com"
] | rrg4400@gmail.com |
6e8d6489fc9ed022efbd3c8950ba81091d0b0d65 | 95a074a59df888b78223baf3c8badf73eb65983e | /src/main/java/com/example/leetcode/medium/TopKFrequentElements.java | f68ec35a9bd18cee0b811565d4f1470dd03f43e6 | [] | no_license | Giridhar552/leetcode | c3a543c59049e3acfd03a8ada5b98f125be95b01 | 378fb45f7ee27b7ee41549dee0dedabe601522db | refs/heads/master | 2023-07-01T00:34:10.267988 | 2021-08-09T17:18:53 | 2021-08-09T17:18:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,139 | java | package com.example.leetcode.medium;
import java.lang.reflect.Array;
import java.util.*;
import java.util.stream.Collectors;
/**
* Given a non-empty array of integers, return the k most frequent elements.
*
* Example 1:
*
* Input: nums = [1,1,1,2,2,3], k = 2
* Output: [1,2]
* Example 2:
*
* Input: nums = [1], k = 1
* Output: [1]
* Note:
*
* You may assume k is always valid, 1 ≤ k ≤ number of unique elements.
* Your algorithm's time complexity must be better than O(n log n), where n is the array's size.
* It's guaranteed that the answer is unique, in other words the set of the top k frequent elements is unique.
* You can return the answer in any order.
*/
public class TopKFrequentElements {
public static void main(String[] args) {
}
public int[] topKFrequent(int[] nums, int k) {
Map<Integer,Integer> count = new HashMap<>();
for(int value : nums){
count.put(value, count.getOrDefault(value,0) + 1);
}
return count.entrySet().stream().sorted(Collections.reverseOrder(Map.Entry.comparingByValue())).map(e -> e.getKey()).limit(k).mapToInt(i->i).toArray();
}
/**
* faster solution
* @param nums
* @param k
* @return
*/
public int[] topKFrequentV1(int[] nums, int k) {
if (nums == null || nums.length <= k) {
return nums;
}
Arrays.sort(nums);
PriorityQueue<int[]> pq = new PriorityQueue<>(new Comparator<int[]>() {
@Override
public int compare(int[] o1, int[] o2) {
return o2[1] - o1[1];
}
});
int left = 0, right = 1;
while (right < nums.length) {
if (nums[right] != nums[right - 1]) {
pq.add(new int[] {nums[left], right - left});
left = right;
}
right++;
}
pq.add(new int[] {nums[left], right - left});
int[] result = new int[k];
int count = 0;
while (count < k) {
result[count++] = pq.poll()[0];
}
return result;
}
public int[] topKFrequentV2(int[] nums, int k) {
Arrays.sort(nums);
Map<Integer, List<Integer>> map = new HashMap();
int max = Integer.MIN_VALUE;
for(int i = 0; i<nums.length; i++){
int j = i;
int count = 0;
while(j < nums.length && nums[i] == nums[j]){
count++;
j++;
}
if(map.containsKey(count)){
map.get(count).add(nums[i]);
}else{
map.put(count, new ArrayList<Integer>(Arrays.asList(nums[i])));
}
max = Math.max(max, count);
i = j - 1;
}
int[] answer = new int[k];
int i = 0;
while(i < k && max >= 0){
if(map.containsKey(max)){
List<Integer> list = map.get(max);
for(int num : list){
answer[i] = num;
i++;
}
}
max--;
}
return answer;
}
}
| [
"zhangzui1989@gmail.com"
] | zhangzui1989@gmail.com |
4350ee8547f069ce9275b22e7ee05d0d4f1ccc9b | 589dcd422402477ce80e9c349bd483c2d36b80cd | /trunk/adhoc-core/src/main/java/com/alipay/bluewhale/core/utils/OlderFileFilter.java | 7f2368fd9b45c0d27dfe760f007a4bcab583c508 | [
"Apache-2.0",
"LicenseRef-scancode-unicode-mappings",
"BSD-3-Clause",
"CDDL-1.0",
"Python-2.0",
"MIT",
"ICU",
"CPL-1.0"
] | permissive | baojiawei1230/mdrill | e3d92f4f1f85b34f0839f8463e7e5353145a9c78 | edacdb4dc43ead6f14d83554c1f402aa1ffdec6a | refs/heads/master | 2021-06-10T17:42:11.076927 | 2021-03-15T16:43:06 | 2021-03-15T16:43:06 | 95,193,877 | 0 | 0 | Apache-2.0 | 2021-03-15T16:43:06 | 2017-06-23T07:15:00 | Java | GB18030 | Java | false | false | 780 | java | package com.alipay.bluewhale.core.utils;
import java.io.File;
import java.io.FileFilter;
/**
* 过滤文件最后修改时间加过期时间小于当前时间过滤器
*
* @author lixin 2012-3-20 上午9:59:05
*
*/
public class OlderFileFilter implements FileFilter {
private int seconds;
public OlderFileFilter(int seconds) {
this.seconds = seconds;
}
@Override
public boolean accept(File pathname) {
long current_time = System.currentTimeMillis();
long lastMonity=pathname.lastModified();
if(lastMonity<=0)
{
lastMonity=current_time;
}
return pathname.isFile()
&& (lastMonity + seconds * 1000l <= current_time);
}
}
| [
"myn@163.com"
] | myn@163.com |
8c379026d72370207ef4b5f39dc494081de22f11 | 6748456a17b2d37f633c8440ff764ae049e9ccfc | /timber-sample/src/main/java/com/example/timber/ui/LintActivity.java | 56ed911e61f6acbdbd12d7b2814202968d4d94bc | [
"Apache-2.0"
] | permissive | ibevilinc/timber | 365b9ba8e7817add53bf28c3ced58b19785fdfef | a8a18b274af35fcdb7cd3d8a6df1a6f29ac68176 | refs/heads/patched-4.7.1 | 2021-08-09T23:14:02.400673 | 2021-06-24T18:33:30 | 2021-06-24T18:33:30 | 151,598,399 | 1 | 0 | Apache-2.0 | 2020-01-24T00:55:19 | 2018-10-04T15:58:54 | Java | UTF-8 | Java | false | false | 2,138 | java | package com.example.timber.ui;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.util.Log;
import timber.log.Timber;
import static java.lang.String.format;
@SuppressLint("Registered") //
public class LintActivity extends Activity {
/**
* Below are some examples of how NOT to use Timber.
*
* To see how a particular lint issue behaves, comment/remove its corresponding id from the set
* of SuppressLint ids below.
*/
@SuppressLint({
"LogNotTimber", //
"StringFormatInTimber", //
"ThrowableNotAtBeginning", //
"BinaryOperationInTimber", //
"TimberArgCount", //
"TimberArgTypes", //
"TimberTagLength", //
"TimberExceptionLogging" //
}) //
@Override protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// LogNotTimber
Log.d("TAG", "msg");
Log.d("TAG", "msg", new Exception());
android.util.Log.d("TAG", "msg");
android.util.Log.d("TAG", "msg", new Exception());
// StringFormatInTimber
Timber.w(String.format("%s", getString()));
Timber.w(format("%s", getString()));
// ThrowableNotAtBeginning
Timber.d("%s", new Exception());
// BinaryOperationInTimber
String foo = "foo";
String bar = "bar";
Timber.d("foo" + "bar");
Timber.d("foo" + bar);
Timber.d(foo + "bar");
Timber.d(foo + bar);
// TimberArgCount
Timber.d("%s %s", "arg0");
Timber.d("%s", "arg0", "arg1");
Timber.tag("tag").d("%s %s", "arg0");
Timber.tag("tag").d("%s", "arg0", "arg1");
// TimberArgTypes
Timber.d("%d", "arg0");
Timber.tag("tag").d("%d", "arg0");
// TimberTagLength
Timber.tag("abcdefghijklmnopqrstuvwx");
Timber.tag("abcdefghijklmnopqrstuvw" + "x");
// TimberExceptionLogging
Timber.d(new Exception(), new Exception().getMessage());
Timber.d(new Exception(), "");
Timber.d(new Exception(), null);
Timber.d(new Exception().getMessage());
}
private String getString() {
return "foo";
}
}
| [
"john.rodriguez@gmail.com"
] | john.rodriguez@gmail.com |
6bbfb2e9cbb736ebea149cc6871afdcfc1cc317d | 4d6c00789d5eb8118e6df6fc5bcd0f671bbcdd2d | /src/main/java/com/alipay/api/domain/AlipayOfflineMarketItemCreateModel.java | 482116196051bb245382ce6be49b1278c7622b3f | [
"Apache-2.0"
] | permissive | weizai118/payment-alipay | 042898e172ce7f1162a69c1dc445e69e53a1899c | e3c1ad17d96524e5f1c4ba6d0af5b9e8fce97ac1 | refs/heads/master | 2020-04-05T06:29:57.113650 | 2018-11-06T11:03:05 | 2018-11-06T11:03:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,801 | java | package com.alipay.api.domain;
import java.util.Date;
import java.util.List;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
import com.alipay.api.internal.mapping.ApiListField;
/**
* 系统商需要通过该接口在口碑平台帮助商户创建商品。
*
* @author auto create
* @since 1.0, 2018-07-12 12:22:21
*/
public class AlipayOfflineMarketItemCreateModel extends AlipayObject {
private static final long serialVersionUID = 3566564936236443565L;
/**
* 商品审核上下文。支付宝内部使用,外部商户不需填写此字段
*/
@ApiField("audit_rule")
private AlipayItemAuditRule auditRule;
/**
* 商品首图,尺寸比例在65:53范围内且图片大小不超过10k皆可,图片推荐尺寸540*420
*/
@ApiField("cover")
private String cover;
/**
* 商品描述(代金券时,此字段必填)
*/
@ApiListField("descriptions")
@ApiField("alipay_item_description")
private List<AlipayItemDescription> descriptions;
/**
* 商品下架时间,不得早于商品生效时间,商品下架
*/
@ApiField("gmt_end")
private Date gmtEnd;
/**
* 商品生效时间,到达生效时间后才可在客户端展示出来。
说明: 商品的生效时间不能早于创建当天的0点
*/
@ApiField("gmt_start")
private Date gmtStart;
/**
* 商品库存数量
*/
@ApiField("inventory")
private Long inventory;
/**
* 是否自动延期,默认false。
如果需要设置自动延期,则gmt_start和gmt_end之间要间隔2天以上
*/
@ApiField("is_auto_expanded")
private Boolean isAutoExpanded;
/**
* 商品类型,券类型填写固定值VOUCHER
*/
@ApiField("item_type")
private String itemType;
/**
* 商户通知地址,口碑发消息给商户通知其是否对商品创建、修改、变更状态成功
*/
@ApiField("operate_notify_url")
private String operateNotifyUrl;
/**
* 商品操作上下文。支付宝内部使用,外部商户不需填写此字段。
*/
@ApiField("operation_context")
private AlipayItemOperationContext operationContext;
/**
* 商品购买类型 OBTAIN为领取,AUTO_OBTAIN为自动领取
*/
@ApiField("purchase_mode")
private String purchaseMode;
/**
* 支持英文字母和数字,由开发者自行定义(不允许重复),在商品notify消息中也会带有该参数,以此标明本次notify消息是对哪个请求的回应
*/
@ApiField("request_id")
private String requestId;
/**
* 销售规则
*/
@ApiField("sales_rule")
private AlipayItemSalesRule salesRule;
/**
* 上架门店id列表,即传入一个或多个shop_id,必须是创建商品partnerId下的店铺,目前支持的店铺最大100个,如果超过100个店铺需要报备
*/
@ApiField("shop_list")
private String shopList;
/**
* 商品名称,请勿超过15个汉字,30个字符
*/
@ApiField("subject")
private String subject;
/**
* 券模板信息
*/
@ApiField("voucher_templete")
private AlipayItemVoucherTemplete voucherTemplete;
/**
* 商品顺序权重,必须是整数,不传默认为0,权重数值越大排序越靠前
*/
@ApiField("weight")
private Long weight;
/**
* Gets audit rule.
*
* @return the audit rule
*/
public AlipayItemAuditRule getAuditRule() {
return this.auditRule;
}
/**
* Sets audit rule.
*
* @param auditRule the audit rule
*/
public void setAuditRule(AlipayItemAuditRule auditRule) {
this.auditRule = auditRule;
}
/**
* Gets cover.
*
* @return the cover
*/
public String getCover() {
return this.cover;
}
/**
* Sets cover.
*
* @param cover the cover
*/
public void setCover(String cover) {
this.cover = cover;
}
/**
* Gets descriptions.
*
* @return the descriptions
*/
public List<AlipayItemDescription> getDescriptions() {
return this.descriptions;
}
/**
* Sets descriptions.
*
* @param descriptions the descriptions
*/
public void setDescriptions(List<AlipayItemDescription> descriptions) {
this.descriptions = descriptions;
}
/**
* Gets gmt end.
*
* @return the gmt end
*/
public Date getGmtEnd() {
return this.gmtEnd;
}
/**
* Sets gmt end.
*
* @param gmtEnd the gmt end
*/
public void setGmtEnd(Date gmtEnd) {
this.gmtEnd = gmtEnd;
}
/**
* Gets gmt start.
*
* @return the gmt start
*/
public Date getGmtStart() {
return this.gmtStart;
}
/**
* Sets gmt start.
*
* @param gmtStart the gmt start
*/
public void setGmtStart(Date gmtStart) {
this.gmtStart = gmtStart;
}
/**
* Gets inventory.
*
* @return the inventory
*/
public Long getInventory() {
return this.inventory;
}
/**
* Sets inventory.
*
* @param inventory the inventory
*/
public void setInventory(Long inventory) {
this.inventory = inventory;
}
/**
* Gets is auto expanded.
*
* @return the is auto expanded
*/
public Boolean getIsAutoExpanded() {
return this.isAutoExpanded;
}
/**
* Sets is auto expanded.
*
* @param isAutoExpanded the is auto expanded
*/
public void setIsAutoExpanded(Boolean isAutoExpanded) {
this.isAutoExpanded = isAutoExpanded;
}
/**
* Gets item type.
*
* @return the item type
*/
public String getItemType() {
return this.itemType;
}
/**
* Sets item type.
*
* @param itemType the item type
*/
public void setItemType(String itemType) {
this.itemType = itemType;
}
/**
* Gets operate notify url.
*
* @return the operate notify url
*/
public String getOperateNotifyUrl() {
return this.operateNotifyUrl;
}
/**
* Sets operate notify url.
*
* @param operateNotifyUrl the operate notify url
*/
public void setOperateNotifyUrl(String operateNotifyUrl) {
this.operateNotifyUrl = operateNotifyUrl;
}
/**
* Gets operation context.
*
* @return the operation context
*/
public AlipayItemOperationContext getOperationContext() {
return this.operationContext;
}
/**
* Sets operation context.
*
* @param operationContext the operation context
*/
public void setOperationContext(AlipayItemOperationContext operationContext) {
this.operationContext = operationContext;
}
/**
* Gets purchase mode.
*
* @return the purchase mode
*/
public String getPurchaseMode() {
return this.purchaseMode;
}
/**
* Sets purchase mode.
*
* @param purchaseMode the purchase mode
*/
public void setPurchaseMode(String purchaseMode) {
this.purchaseMode = purchaseMode;
}
/**
* Gets request id.
*
* @return the request id
*/
public String getRequestId() {
return this.requestId;
}
/**
* Sets request id.
*
* @param requestId the request id
*/
public void setRequestId(String requestId) {
this.requestId = requestId;
}
/**
* Gets sales rule.
*
* @return the sales rule
*/
public AlipayItemSalesRule getSalesRule() {
return this.salesRule;
}
/**
* Sets sales rule.
*
* @param salesRule the sales rule
*/
public void setSalesRule(AlipayItemSalesRule salesRule) {
this.salesRule = salesRule;
}
/**
* Gets shop list.
*
* @return the shop list
*/
public String getShopList() {
return this.shopList;
}
/**
* Sets shop list.
*
* @param shopList the shop list
*/
public void setShopList(String shopList) {
this.shopList = shopList;
}
/**
* Gets subject.
*
* @return the subject
*/
public String getSubject() {
return this.subject;
}
/**
* Sets subject.
*
* @param subject the subject
*/
public void setSubject(String subject) {
this.subject = subject;
}
/**
* Gets voucher templete.
*
* @return the voucher templete
*/
public AlipayItemVoucherTemplete getVoucherTemplete() {
return this.voucherTemplete;
}
/**
* Sets voucher templete.
*
* @param voucherTemplete the voucher templete
*/
public void setVoucherTemplete(AlipayItemVoucherTemplete voucherTemplete) {
this.voucherTemplete = voucherTemplete;
}
/**
* Gets weight.
*
* @return the weight
*/
public Long getWeight() {
return this.weight;
}
/**
* Sets weight.
*
* @param weight the weight
*/
public void setWeight(Long weight) {
this.weight = weight;
}
}
| [
"hanley@thlws.com"
] | hanley@thlws.com |
b8697f9429e443d571f2e3415fa306eb267d9c07 | fca2e675f48aaff31048710cc00ce7046aa711d9 | /src/main/java/com/xero/models/accounting/ExternalLink.java | 54542495b01189b9bfdd8bc179a0bf5948b73608 | [
"MIT"
] | permissive | XeroAPI/Xero-Java | c13b69366cd624bbba2993e9db9e38bdecb7c7eb | 9912bd6fe795b706aadb152e53c9c28b1e03d9ba | refs/heads/master | 2023-08-08T20:14:56.452424 | 2023-06-15T18:38:41 | 2023-06-15T18:38:41 | 61,156,602 | 82 | 114 | MIT | 2023-08-29T20:36:57 | 2016-06-14T21:22:47 | Java | UTF-8 | Java | false | false | 5,040 | java | /*
* Xero Accounting API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* Contact: api@xero.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.xero.models.accounting;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonValue;
import com.xero.api.StringUtil;
import io.swagger.annotations.ApiModelProperty;
import java.util.Objects;
/** ExternalLink */
public class ExternalLink {
StringUtil util = new StringUtil();
/** See External link types */
public enum LinkTypeEnum {
/** FACEBOOK */
FACEBOOK("Facebook"),
/** GOOGLEPLUS */
GOOGLEPLUS("GooglePlus"),
/** LINKEDIN */
LINKEDIN("LinkedIn"),
/** TWITTER */
TWITTER("Twitter"),
/** WEBSITE */
WEBSITE("Website");
private String value;
LinkTypeEnum(String value) {
this.value = value;
}
/**
* getValue
*
* @return String value
*/
@JsonValue
public String getValue() {
return value;
}
/**
* toString
*
* @return String value
*/
@Override
public String toString() {
return String.valueOf(value);
}
/**
* fromValue
*
* @param value String
*/
@JsonCreator
public static LinkTypeEnum fromValue(String value) {
for (LinkTypeEnum b : LinkTypeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
@JsonProperty("LinkType")
private LinkTypeEnum linkType;
@JsonProperty("Url")
private String url;
@JsonProperty("Description")
private String description;
/**
* See External link types
*
* @param linkType LinkTypeEnum
* @return ExternalLink
*/
public ExternalLink linkType(LinkTypeEnum linkType) {
this.linkType = linkType;
return this;
}
/**
* See External link types
*
* @return linkType
*/
@ApiModelProperty(value = "See External link types")
/**
* See External link types
*
* @return linkType LinkTypeEnum
*/
public LinkTypeEnum getLinkType() {
return linkType;
}
/**
* See External link types
*
* @param linkType LinkTypeEnum
*/
public void setLinkType(LinkTypeEnum linkType) {
this.linkType = linkType;
}
/**
* URL for service e.g. http://twitter.com/xeroapi
*
* @param url String
* @return ExternalLink
*/
public ExternalLink url(String url) {
this.url = url;
return this;
}
/**
* URL for service e.g. http://twitter.com/xeroapi
*
* @return url
*/
@ApiModelProperty(value = "URL for service e.g. http://twitter.com/xeroapi")
/**
* URL for service e.g. http://twitter.com/xeroapi
*
* @return url String
*/
public String getUrl() {
return url;
}
/**
* URL for service e.g. http://twitter.com/xeroapi
*
* @param url String
*/
public void setUrl(String url) {
this.url = url;
}
/**
* description
*
* @param description String
* @return ExternalLink
*/
public ExternalLink description(String description) {
this.description = description;
return this;
}
/**
* Get description
*
* @return description
*/
@ApiModelProperty(value = "")
/**
* description
*
* @return description String
*/
public String getDescription() {
return description;
}
/**
* description
*
* @param description String
*/
public void setDescription(String description) {
this.description = description;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ExternalLink externalLink = (ExternalLink) o;
return Objects.equals(this.linkType, externalLink.linkType)
&& Objects.equals(this.url, externalLink.url)
&& Objects.equals(this.description, externalLink.description);
}
@Override
public int hashCode() {
return Objects.hash(linkType, url, description);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ExternalLink {\n");
sb.append(" linkType: ").append(toIndentedString(linkType)).append("\n");
sb.append(" url: ").append(toIndentedString(url)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
| [
"sid.maestre@gmail.com"
] | sid.maestre@gmail.com |
2f9fe09de0514b2b7600027d349a7f8ebabacbcf | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/MOCKITO-10b-8-4-FEMO-WeightedSum:TestLen:CallDiversity/org/mockito/internal/stubbing/defaultanswers/ReturnsDeepStubs_ESTest.java | 30486d3f669d29a694b523c8d877cb96a561c3ab | [] | no_license | STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application | cf118b23ecb87a8bf59643e42f7556b521d1f754 | 3bb39683f9c343b8ec94890a00b8f260d158dfe3 | refs/heads/master | 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 583 | java | /*
* This file was automatically generated by EvoSuite
* Sat Apr 04 09:09:44 UTC 2020
*/
package org.mockito.internal.stubbing.defaultanswers;
import org.junit.Test;
import static org.junit.Assert.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class ReturnsDeepStubs_ESTest extends ReturnsDeepStubs_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
0ed6b04071c248ff2eba88388e26b75343c7da00 | 82dc5807c02a9c81d574f59c74f72cabce8595a2 | /businesshall/src/com/yfcomm/mpos/codec/StandardSwiperDecoder.java | a61197701fbce3edfb5c51106a10852f2ba49a84 | [] | no_license | duslabo/android_work | 48d073e04cb58189c8cd363d4e1d8ada716474ea | adcaec07b3a7dd64b98763645522972387c67e73 | refs/heads/master | 2020-05-22T18:05:31.669708 | 2017-04-21T08:21:29 | 2017-04-21T08:21:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,172 | java | package com.yfcomm.mpos.codec;
import com.yfcomm.businesshall.ByteUtils;
/**
* 标准 解码协议
*
* @author qc
*
*/
public class StandardSwiperDecoder extends SwiperDecoder {
private String serialNo;
private String batchNo;
private int track2Len;
private int track3Len;
private byte[] track2;
private byte[] track3;
@Override
public void decodeMagnetic(byte[] data) {
// 磁条卡数据解析
ksn = ByteUtils.byteToHex(data, 0, 8);
// 交易时间
trxTime = ByteUtils.byteToHex(data, 8, 7);
// 随机数
this.random = new byte[8];
System.arraycopy(data, 15, random, 0, 8);
// 取出密文信息
int len = data[23] & 0xFF;
byte[] encData = new byte[len];
System.arraycopy(data, 24, encData, 0, encData.length);
// 解码加密内容
decode(encData);
// 获取MAC
this.mac = new byte[8];
System.arraycopy(data, 24 + encData.length, this.mac, 0,
this.mac.length);
// 批次号
batchNo = ByteUtils.byteToHex(data, 32 + len, 3);
// 流水号
serialNo = ByteUtils.byteToHex(data, 35 + len, 3);
// 非加密磁道数据
// 二磁道长度
track2Len = data[38 + len] & 0xFF;
track2 = new byte[Double.valueOf( Math.ceil(track2Len/2.0)).intValue()];
System.arraycopy(data, 39 + len, track2, 0, track2.length);
// 三磁道长度
track3Len = data[39 + len + track2.length] & 0xFF;
track3 = new byte[Double.valueOf( Math.ceil(track3Len/2.0)).intValue()];
System.arraycopy(data, 40 + len + track2.length, track3, 0, track3.length);
}
public void decodeIc(byte[] data) {
// 交易时间
trxTime = ByteUtils.byteToHex(data, 0, 7);
// 随机数
this.random = new byte[8];
System.arraycopy(data, 7, random, 0, 8);
// 取出密文信息
int encDataLen = data[15] & 0xFF;
byte[] encData = new byte[encDataLen];
System.arraycopy(data, 16, encData, 0, encDataLen);
// 解析
this.decode(encData);
// 获取MAC
this.mac = new byte[8];
System.arraycopy(data, 16 + encDataLen, this.mac, 0, this.mac.length);
// 批次号
batchNo = ByteUtils.byteToHex(data, 24 + encDataLen, 3);
// 流水号
serialNo = ByteUtils.byteToHex(data, 27 + encDataLen, 3);
// 非加密磁道数据
// 二磁道长度
track2Len = data[30 + encDataLen] & 0xFF;
track2 = new byte[Double.valueOf( Math.ceil(track2Len/2.0)).intValue()];
System.arraycopy(data, 31 + encDataLen, track2, 0, track2.length);
// 三磁道长度
track3Len = data[31 + encDataLen + track2.length] & 0xFF;
track3 = new byte[Double.valueOf( Math.ceil(track3Len/2.0)).intValue()];
System.arraycopy(data, 32 + encDataLen + track2.length, track3, 0,track3.length);
int offset = 32 + encDataLen + track2.length + track3.length;
// icdata
int iccdataLen = data.length- offset;
this.icData = new byte[iccdataLen];
System.arraycopy(data, offset, this.icData, 0, iccdataLen);
}
public String getSerialNo() {
return serialNo;
}
public String getBatchNo() {
return batchNo;
}
public int getTrack2Len() {
return track2Len;
}
public int getTrack3Len() {
return track3Len;
}
public byte[] getTrack2() {
return track2;
}
public byte[] getTrack3() {
return track3;
}
}
| [
"dongyongzhi@foxmail.com"
] | dongyongzhi@foxmail.com |
342756719b3ec78d0a70f4354b296eb91fca6d0b | 17e8438486cb3e3073966ca2c14956d3ba9209ea | /dso/branches/community-license-server/dso-l2/src/test/java/com/tc/objectserver/persistence/db/MapsDBDeleteTest.java | 5782cd0d634aa7a42aae7962b88a5644bbcac464 | [] | no_license | sirinath/Terracotta | fedfc2c4f0f06c990f94b8b6c3b9c93293334345 | 00a7662b9cf530dfdb43f2dd821fa559e998c892 | refs/heads/master | 2021-01-23T05:41:52.414211 | 2015-07-02T15:21:54 | 2015-07-02T15:21:54 | 38,613,711 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,419 | java | /*
* All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
*/
package com.tc.objectserver.persistence.db;
import com.tc.logging.TCLogger;
import com.tc.logging.TCLogging;
import com.tc.object.ObjectID;
import com.tc.object.TestDNACursor;
import com.tc.objectserver.managedobject.ManagedObjectStateFactory;
import com.tc.objectserver.managedobject.MapManagedObjectState;
import com.tc.objectserver.managedobject.NullManagedObjectChangeListenerProvider;
import com.tc.objectserver.storage.api.DBEnvironment;
import com.tc.objectserver.storage.api.DBFactory;
import com.tc.objectserver.storage.api.PersistenceTransaction;
import com.tc.objectserver.storage.api.PersistenceTransactionProvider;
import com.tc.test.TCTestCase;
import com.tc.util.Assert;
import java.io.File;
import java.io.IOException;
import java.util.Date;
import java.util.Map;
import java.util.SortedSet;
import java.util.TreeSet;
public class MapsDBDeleteTest extends TCTestCase {
static {
ManagedObjectStateFactory.enableLegacyTypes();
ManagedObjectStateFactory.disableSingleton(true);
}
private DBPersistorImpl persistor;
private PersistenceTransactionProvider ptp;
private DBEnvironment env;
private TCCollectionsPersistor collectionsPersistor;
private static int dbHomeCounter = 0;
private static File tempDirectory;
@Override
public void setUp() throws Exception {
if (this.env != null) {
this.env.close();
}
final File dbHome = newDBHome();
final TCLogger logger = TCLogging.getLogger(getClass());
final CustomSerializationAdapterFactory saf = new CustomSerializationAdapterFactory();
this.env = getDBEnvironMent(dbHome);
this.persistor = new DBPersistorImpl(logger, this.env, saf);
this.ptp = this.env.getPersistenceTransactionProvider();
this.collectionsPersistor = this.persistor.getCollectionsPersistor();
}
private DBEnvironment getDBEnvironMent(final File dbHome) throws IOException {
return DBFactory.getInstance().createEnvironment(true, dbHome);
}
// XXX:: Check SleepycatSerializationTest if you want know why its done like this or ask Orion.
private File newDBHome() throws IOException {
File file;
if (tempDirectory == null) {
tempDirectory = getTempDirectory();
}
++dbHomeCounter;
for (file = new File(tempDirectory, "db" + dbHomeCounter); file.exists(); ++dbHomeCounter) {
//
}
assertFalse(file.exists());
System.err.println("DB Home = " + file);
return file;
}
@Override
public void tearDown() throws Exception {
this.persistor = null;
this.ptp = null;
this.env = null;
}
public void testDeleteSmallMap() throws Exception {
doTestDeleteMap(2500, 10);
}
public void testDeleteLargeMap() throws Exception {
doTestDeleteMap(1, 150000);
}
protected void doTestDeleteMap(int numMaps, int entriesPerMap) throws TCDatabaseException, IOException {
ManagedObjectStateFactory.createInstance(new NullManagedObjectChangeListenerProvider(), this.persistor);
// Random rand = new Random();
SortedSet<ObjectID> deleteIds = new TreeSet<ObjectID>();
int totalEntries = 0;
System.out.println("Running delete test for numMaps: " + numMaps + ", entriesPerMap: " + entriesPerMap);
long totalAddStart = System.currentTimeMillis();
for (int i = 0; i < numMaps; i++) {
final ObjectID id = new ObjectID(i);
final MapManagedObjectState state = (MapManagedObjectState) ManagedObjectStateFactory.getInstance()
.createState(id, ObjectID.NULL_ID, "java.util.HashMap", new TestDNACursor());
final TCPersistableMap sMap = (TCPersistableMap) state.getPersistentCollection();
// final long addStart = System.currentTimeMillis();
// System.out.println(" Adding entries:" + entriesPerMap);
addToMap(numMaps, sMap, entriesPerMap);
Assert.assertEquals(totalEntries, this.env.getMapsDatabase().count(ptp.newTransaction()));
totalEntries += entriesPerMap;
PersistenceTransaction tx = this.ptp.newTransaction();
this.collectionsPersistor.saveCollections(tx, state);
tx.commit();
if (i != 0 && i % 100 == 0) {
System.out
.println(" Time taken to add " + i + " maps: " + (System.currentTimeMillis() - totalAddStart) + "ms");
}
Assert.assertEquals(totalEntries, this.env.getMapsDatabase().count(ptp.newTransaction()));
deleteIds.add(id);
}
System.out.println("XXX total entries: " + totalEntries);
System.out.println("XXX Time taken to add all entries in " + numMaps + " maps: "
+ (System.currentTimeMillis() - totalAddStart));
System.out.println("Starting delete now: " + new Date());
long start = System.currentTimeMillis();
long objectsDeleted = this.collectionsPersistor.deleteAllCollections(ptp, deleteIds, deleteIds);
System.out.println("time taken to delete " + (System.currentTimeMillis() - start) + "ms");
Assert.assertEquals(totalEntries, objectsDeleted);
Assert.assertEquals(0, this.env.getMapsDatabase().count(ptp.newTransaction()));
}
private void addToMap(int numMaps, final Map map, final int numOfEntries) {
for (int i = 50 + numMaps; i < numOfEntries + 50 + numMaps; i++) {
map.put(new ObjectID(i), Integer.valueOf(i));
}
}
}
| [
"amaheshw@7fc7bbf3-cf45-46d4-be06-341739edd864"
] | amaheshw@7fc7bbf3-cf45-46d4-be06-341739edd864 |
83e9db17656e7a410324dad3947b96c44e5c7fd9 | d2d019d3249f9e079e9a3a8106905fdef5dd9d9d | /lab02/src/test/java/pl/sages/spring/lab/EmployeeDAOTest.java | 2601548a8a54e75fd09ad8be100e5690e23262d9 | [] | no_license | tomekb82/SzkolenieSpring | 54d8868db6183a44f2176e60a0215939d34458bc | c9139674e4ce38324a8e533b1bd18b57a744fc51 | refs/heads/master | 2021-01-10T01:57:24.444781 | 2015-12-31T11:53:34 | 2015-12-31T11:53:34 | 47,962,104 | 0 | 0 | null | 2015-12-18T19:51:05 | 2015-12-14T08:36:33 | Java | UTF-8 | Java | false | false | 1,278 | java | package pl.sages.spring.lab;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.transaction.TransactionConfiguration;
import org.springframework.transaction.annotation.Transactional;
import pl.sages.spring.lab.dao.EmployeeDAO;
import pl.sages.spring.lab.model.Employee;
import java.util.List;
/**
* Created by Administrator on 2015-12-16.
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "/context.xml")
@TransactionConfiguration(defaultRollback = false)
public class EmployeeDAOTest {
@Autowired
private EmployeeDAO employeeDAO;
@Test
@Transactional
public void test(){
Employee employee = new Employee();
employee.setSalary(5486);
employeeDAO.save(employee);
Employee employee1 = new Employee();
employee1.setSalary(1244);
employeeDAO.save(employee1);
List<Employee> employeeList = employeeDAO.findBySalaryGreaterThan(2000);
System.out.println(employeeList);
assert employeeList.contains(employee);
}
}
| [
"tomasz.belina@qualent.eu"
] | tomasz.belina@qualent.eu |
6223ab6c50e404f60e2cd2ec3bec1c9951cbc5c5 | 781c12e9b962cc6dbc4875d65bb57c7b7fd2e860 | /dht/src/test/java/net/tomp2p/dht/TestSinglePeer.java | 6c6c8aba7feaee023c10651c20e16604b0a55eb8 | [
"Apache-2.0"
] | permissive | iggydv/TomP2P | c2c1923e511dddcca84913e6b0b095d486f2d8cc | 4d14c79462ca919a1ac50f75de3321d4590c918e | refs/heads/master | 2021-05-26T11:59:13.842011 | 2015-05-27T18:01:46 | 2015-05-27T18:01:46 | 254,123,866 | 0 | 0 | Apache-2.0 | 2020-04-08T15:16:37 | 2020-04-08T15:16:37 | null | UTF-8 | Java | false | false | 659 | java | package net.tomp2p.dht;
import java.io.IOException;
import java.util.Random;
import net.tomp2p.p2p.Peer;
import net.tomp2p.p2p.PeerBuilder;
import net.tomp2p.peers.Number160;
import net.tomp2p.storage.Data;
public class TestSinglePeer {
public static void main(String[] args) throws IOException {
Random rnd = new Random(1);
Peer peer = new PeerBuilder( new Number160( rnd ) ).ports( 4000 ).start();
PeerDHT peerDHT = new PeerBuilderDHT(peer).start();
for(int i=0;true;i++) {
peerDHT.put(Number160.ONE).data(new Data("test")).start().awaitUninterruptibly();
}
//System.out.println("peer up and running : " + peer.peerAddress());
}
}
| [
"tom@tomp2p.net"
] | tom@tomp2p.net |
c49075a37c3ecd19bd591ee524413ffc16c24161 | 10c18b5af6b13cc0768a807772d415c8dbc6f639 | /src/test/java/doc/btreemap_composite_keys.java | 22cd38963fd3168a6a511870126b438a99c65674 | [
"OPUBL-1.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | debmalya/mapdb-site | f2f6fae9f2ccc1cc004bfa42290b125d7ada49e3 | e868fa4bef13c28a89e503146c6ec709e59939c6 | refs/heads/master | 2021-01-17T08:18:24.407217 | 2016-06-09T16:32:10 | 2016-06-09T16:32:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,215 | java | package doc;
import org.junit.Test;
import org.mapdb.*;
import org.mapdb.serializer.SerializerArrayTuple;
import java.util.Map;
import static org.junit.Assert.assertEquals;
public class btreemap_composite_keys {
@Test
public void irish_towns() {
//a1
// initialize db and map
DB db = DBMaker.memoryDB().make();
BTreeMap<Object[], Integer> map = db.treeMap("towns")
.keySerializer(new SerializerArrayTuple(
Serializer.STRING, Serializer.STRING, Serializer.INTEGER))
.valueSerializer(Serializer.INTEGER)
.createOrOpen();
//a2
//initial values
String[] towns = {"Galway", "Ennis", "Gort", "Cong", "Tuam"};
String[] streets = {"Main Street", "Shop Street", "Second Street", "Silver Strands"};
int[] houseNums = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
for (String town : towns)
for (String street : streets)
for (int house : houseNums) {
int income = 30000;
map.put(new Object[]{town, street, house}, income);
}
//b1
//get all houses in Cong (town is primary component in tuple)
Map<Object[], Integer> cong =
map.prefixSubMap(new Object[]{"Cong"});
//b2
assertEquals(houseNums.length*streets.length, cong.size());
//c1
cong = map.subMap(
new Object[]{"Cong"}, //shorter array is 'negative infinity'
new Object[]{"Cong",null,null} // null is positive infinity'
);
//c2
assertEquals(houseNums.length*streets.length, cong.size());
//d1
int total = 0;
for(String town:towns){ //first loop iterates over towns
for(Integer salary: //second loop iterates over all houses on main street
map.prefixSubMap(new Object[]{town, "Main Street"}).values()){
total+=salary; //and calculate sum
}
}
System.out.println("Salary sum for all Main Streets is: "+total);
//d2
assertEquals(30000*towns.length*houseNums.length, total);
}
}
| [
"jan@kotek.net"
] | jan@kotek.net |
6ac799cf6c7ed26059e17a51ac60b87d193319d8 | 1c83f56ebeda5c76a92f2e7e819c4f2a630bc4cf | /camel-core/src/test/java/org/apache/camel/processor/StreamCachingOnlyRouteTest.java | c5571daecded426d3fa21a50258dc168cef73bba | [
"Apache-2.0",
"LicenseRef-scancode-unknown",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | valtoni/camel | a6a8c1244b4045b2ed47aa5f59b2495702e6c759 | 2563e716d5b348fc80219accbb8aa7b83d77bd68 | refs/heads/master | 2020-03-23T08:22:47.079621 | 2018-08-24T20:25:07 | 2018-08-24T20:25:07 | 141,323,246 | 1 | 0 | Apache-2.0 | 2018-07-18T17:38:16 | 2018-07-17T17:39:38 | Java | UTF-8 | Java | false | false | 1,870 | java | /**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.camel.processor;
import java.io.StringReader;
import javax.xml.transform.stream.StreamSource;
import org.apache.camel.ContextTestSupport;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
/**
* @version
*/
public class StreamCachingOnlyRouteTest extends ContextTestSupport {
public void testStreamCachingPerRoute() throws Exception {
MockEndpoint c = getMockEndpoint("mock:c");
c.expectedMessageCount(1);
new StreamSource(new StringReader("A"));
template.sendBody("direct:c", new StreamSource(new StringReader("C")));
assertMockEndpointsSatisfied();
}
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
getContext().getGlobalOptions().put("CamelCachedOutputStreamThreshold", "4096");
from("direct:c").streamCaching().to("mock:c");
}
};
}
} | [
"davsclaus@apache.org"
] | davsclaus@apache.org |
99d75564d363d0756fda2be889425974ee050ddf | c3323b068ef682b07ce6b992918191a0a3781462 | /open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/igc-rest-connector/src/main/java/org/odpi/openmetadata/adapters/repositoryservices/igc/model/generated/v115/JobParameter.java | 0b18eef4fdd8a6acca160861635f17d771756e50 | [
"Apache-2.0"
] | permissive | louisroehrs/egeria | 897cb9b6989b1e176c39817b723f4b24de4b23ad | 8045cc6a34ea87a4ea44b2f0992e09dff97c9714 | refs/heads/master | 2020-04-08T20:45:35.061405 | 2018-11-28T09:05:23 | 2018-11-28T09:05:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,776 | java | /* SPDX-License-Identifier: Apache-2.0 */
/* Copyright Contributors to the ODPi Egeria project. */
package org.odpi.openmetadata.adapters.repositoryservices.igc.model.generated.v115;
import org.odpi.openmetadata.adapters.repositoryservices.igc.model.common.*;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Date;
import java.util.ArrayList;
/**
* POJO for the 'job_parameter' asset type in IGC, displayed as 'Job Parameter' in the IGC UI.
* <br><br>
* (this code has been generated based on out-of-the-box IGC metadata types;
* if modifications are needed, eg. to handle custom attributes,
* extending from this class in your own custom class is the best approach.)
*/
@JsonIgnoreProperties(ignoreUnknown=true)
public class JobParameter extends MainObject {
public static final String IGC_TYPE_ID = "job_parameter";
/**
* The 'job_run' property, displayed as 'Job Run' in the IGC UI.
* <br><br>
* Will be a single {@link Reference} to a {@link JobRun} object.
*/
protected Reference job_run;
/**
* The 'value' property, displayed as 'Value' in the IGC UI.
*/
protected String value;
/** @see #job_run */ @JsonProperty("job_run") public Reference getJobRun() { return this.job_run; }
/** @see #job_run */ @JsonProperty("job_run") public void setJobRun(Reference job_run) { this.job_run = job_run; }
/** @see #value */ @JsonProperty("value") public String getValue() { return this.value; }
/** @see #value */ @JsonProperty("value") public void setValue(String value) { this.value = value; }
public static final Boolean isJobParameter(Object obj) { return (obj.getClass() == JobParameter.class); }
}
| [
"chris@thegrotes.net"
] | chris@thegrotes.net |
6fa5732ca6a915c308a4d275d246ad4c802d10e5 | cc863da7a3f53f36c60fe06f598c2d5971107ce0 | /src/main/java/com/darcy/Scheme2017MUSE/plain4/HACTreeNodePair.java | f8375ceab8739224e05d5245494d72ed844c3d48 | [
"Apache-2.0"
] | permissive | MyDarcy/SSE | 71534fc6b2110154bd6c1949badd02b944896493 | 080c0310796ba0b8df1c41ea159dcc5594624445 | refs/heads/master | 2021-09-06T00:54:11.177570 | 2018-02-01T03:29:36 | 2018-02-01T03:29:36 | 112,193,865 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 307 | java | package com.darcy.Scheme2017MUSE.plain4;
/*
* author: darcy
* date: 2017/12/19 10:58
* description:
*/
public class HACTreeNodePair {
public HACTreeNode node1;
public HACTreeNode node2;
public HACTreeNodePair(HACTreeNode node1, HACTreeNode node2) {
this.node1 = node1;
this.node2 = node2;
}
}
| [
"darcy.q.cs@gmail.com"
] | darcy.q.cs@gmail.com |
43916334a39c0d893058212283bd70c5cd5d82d3 | ed3cb95dcc590e98d09117ea0b4768df18e8f99e | /project_1_2/src/i/h/d/Calc_1_2_8730.java | 8512b95f1db177c07bf888d7f1ee9c9674293bec | [] | no_license | chalstrick/bigRepo1 | ac7fd5785d475b3c38f1328e370ba9a85a751cff | dad1852eef66fcec200df10083959c674fdcc55d | refs/heads/master | 2016-08-11T17:59:16.079541 | 2015-12-18T14:26:49 | 2015-12-18T14:26:49 | 48,244,030 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 131 | java | package i.h.d;
public class Calc_1_2_8730 {
/** @return the sum of a and b */
public int add(int a, int b) {
return a+b;
}
}
| [
"christian.halstrick@sap.com"
] | christian.halstrick@sap.com |
a38a2c0dcc8f287d420b11b279da348f444aa9fe | c68dc1bafd5e8fa6d4b30648cffe36bf0322549e | /plugins/net.refractions.udig.issues.test/src/net/refractions/udig/issues/test/DummyIssueFixer.java | bc4517ee9e015a8e18164c215e55139a2cd60e07 | [] | no_license | mifanc/udig-platform | 49dddd1f5d48e44845869ec98559171d2e29458e | 94a6e3d90c33036b255f4d8d0b2a20779e619145 | refs/heads/master | 2020-12-24T22:41:16.179764 | 2011-08-25T18:55:42 | 2011-08-25T18:55:42 | 1,754,480 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,035 | java | package net.refractions.udig.issues.test;
import net.refractions.udig.core.IFixer;
import net.refractions.udig.core.enums.Resolution;
import net.refractions.udig.issues.AbstractFixableIssue;
import net.refractions.udig.issues.IIssue;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.ui.IMemento;
public class DummyIssueFixer implements IFixer {
/**
* Simple flag read from the fixerMemento to determine if an issue can be fixed. This is not a
* realistic case, as we would usually look to see if certain keys exist and if their values
* conform to our ideals.
*/
public static final String KEY_FIXABLE = "fixable"; //$NON-NLS-1$
MessageDialog messageDialog = null;
public boolean canFix( Object object, IMemento fixerMemento ) {
//not null
if (object == null || fixerMemento == null) {
return false;
}
//must be instance
if (!(object instanceof AbstractFixableIssue)) {
return false;
}
IIssue issue = (IIssue) object;
//not already resolved
if (issue.getResolution() == Resolution.RESOLVED) {
return false;
}
String fixable = fixerMemento.getString(KEY_FIXABLE);
return fixable != null && fixable.equalsIgnoreCase("TRUE"); //$NON-NLS-1$
}
public void fix( Object object, IMemento fixerMemento ) {
IIssue issue = (IIssue) object;
//set resolution to "in progress" (optional, but a good idea)
issue.setResolution(Resolution.IN_PROGRESS);
//at this point, some mystical dialog or workflow process decides to call complete
}
public void complete( Object object ) {
((IIssue) object).setResolution(Resolution.RESOLVED);
}
/**
* Obtains the dialog that pops up to ask question (this method is used to programatically click
* the button).
*
* @return MessageDialog
*/
public MessageDialog getDialog() {
return messageDialog;
}
}
| [
"jody.garnett@gmail.com"
] | jody.garnett@gmail.com |
726c9c44fa052592e355c67931629a86583cc51b | 1b200cbeb540878a72f732991149bce3eb5ce3a2 | /server-wildfly/src/main/java/org/jboss/tools/rsp/server/wildfly/servertype/capabilities/ExtendedServerPropertiesAdapterFactory.java | ee248ab49bee7d11249649fb31abb79b5536bdbd | [] | no_license | dgolovin/rsp-server | 8a41197b1b16e1ba0af0ab27443e5882d8691f09 | 7cf1b42ef22f3e99c556ef933eaa176108e51208 | refs/heads/master | 2020-03-27T05:22:00.617371 | 2018-08-24T10:44:29 | 2018-08-24T14:47:22 | 146,013,457 | 0 | 0 | null | 2018-08-24T16:13:18 | 2018-08-24T16:13:18 | null | UTF-8 | Java | false | false | 2,705 | java | /*******************************************************************************
* Copyright (c) 2012 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
******************************************************************************/
package org.jboss.tools.rsp.server.wildfly.servertype.capabilities;
import org.jboss.tools.rsp.server.spi.servertype.IServer;
import org.jboss.tools.rsp.server.wildfly.beans.impl.IServerConstants;
public class ExtendedServerPropertiesAdapterFactory implements IServerConstants {
public ServerExtendedProperties getExtendedProperties(IServer s) {
String typeId = null;
typeId = s.getServerType().getId();
if( typeId != null ) {
if( SERVER_AS_32.equals(typeId) )
return new JBossExtendedProperties(s);
if( SERVER_AS_40.equals(typeId))
return new JBossExtendedProperties(s);
if( SERVER_AS_42.equals(typeId) )
return new JBossExtendedProperties(s);
if( SERVER_AS_50.equals(typeId) )
return new JBossExtendedProperties(s);
if( SERVER_AS_51.equals(typeId) )
return new JBossExtendedProperties(s);
if( SERVER_AS_60.equals(typeId) )
return new JBossAS6ExtendedProperties(s);
if( SERVER_EAP_43.equals(typeId) )
return new JBossExtendedProperties(s);
if( SERVER_EAP_50.equals(typeId) )
return new JBossEAP5ExtendedProperties(s);
if( SERVER_AS_70.equals(typeId) )
return new JBossAS7ExtendedProperties(s);
if( SERVER_AS_71.equals(typeId) )
return new JBossAS710ExtendedProperties(s);
if( SERVER_EAP_60.equals(typeId) )
return new JBossEAP60ExtendedProperties(s);
if( SERVER_EAP_61.equals(typeId) )
return new JBossEAP61ExtendedProperties(s);
if( SERVER_EAP_70.equals(typeId) )
return new JBossEAP70ExtendedProperties(s);
if( SERVER_EAP_71.equals(typeId))
return new JBossEAP71ExtendedProperties(s);
if( SERVER_WILDFLY_80.equals(typeId) )
return new Wildfly80ExtendedProperties(s);
if( SERVER_WILDFLY_90.equals(typeId) )
return new Wildfly90ExtendedProperties(s);
if( SERVER_WILDFLY_100.equals(typeId) )
return new Wildfly100ExtendedProperties(s);
if( SERVER_WILDFLY_110.equals(typeId) )
return new Wildfly110ExtendedProperties(s);
if( SERVER_WILDFLY_120.equals(typeId) )
return new Wildfly120ExtendedProperties(s);
if( SERVER_WILDFLY_130.equals(typeId) )
return new Wildfly130ExtendedProperties(s);
}
return null;
}
}
| [
"rob@oxbeef.net"
] | rob@oxbeef.net |
57514985f89e33c70c1707e672c6102e3e40f11b | 69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e | /methods/Method_10078.java | 3affa3f56d5ce9a7d2334ca1f0ecd9a7d5dba371 | [] | no_license | P79N6A/icse_20_user_study | 5b9c42c6384502fdc9588430899f257761f1f506 | 8a3676bc96059ea2c4f6d209016f5088a5628f3c | refs/heads/master | 2020-06-24T08:25:22.606717 | 2019-07-25T15:31:16 | 2019-07-25T15:31:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 437 | java | /**
* Gets allow register option value.
* @return allow register option value, return {@code null} if not found
*/
public String getAllowRegister(){
try {
final JSONObject result=optionRepository.get(Option.ID_C_MISC_ALLOW_REGISTER);
return result.optString(Option.OPTION_VALUE);
}
catch ( final RepositoryException e) {
LOGGER.log(Level.ERROR,"Gets option [allow register] value failed",e);
return null;
}
}
| [
"sonnguyen@utdallas.edu"
] | sonnguyen@utdallas.edu |
a70113df40580b906f0e58aa3c3c75dd2c785928 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/9/9_1ecc0ed5aee8d4d672ee395e8f891449fc0a7394/FunctionalListTest/9_1ecc0ed5aee8d4d672ee395e8f891449fc0a7394_FunctionalListTest_t.java | f0f91bfb368797151665b0d0ad0235d86c963931 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 2,257 | java | package org.qi4j.runtime.composite;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import org.qi4j.api.injection.scope.Structure;
import org.qi4j.api.injection.scope.This;
import org.qi4j.api.mixin.Mixins;
import org.qi4j.api.structure.Module;
import org.qi4j.bootstrap.AssemblyException;
import org.qi4j.bootstrap.ModuleAssembly;
import org.qi4j.functional.Function;
import org.qi4j.test.AbstractQi4jTest;
import static org.hamcrest.CoreMatchers.hasItems;
import static org.junit.Assert.assertThat;
public class FunctionalListTest extends AbstractQi4jTest
{
@Override
public void assemble( ModuleAssembly module )
throws AssemblyException
{
module.transients( List.class ).withTypes( FList.class ).withMixins( ArrayList.class );
}
@Test
public void givenArrayListWithMapOpCapabilityWhenMappingIntegerToStringExpectCorrectResult()
{
List<Integer> integers = module.newTransient( List.class );
integers.add( 5 );
integers.add( 15 );
integers.add( 45 );
integers.add( 85 );
FList<Integer> list = (FList<Integer>) integers;
List<String> strings = list.translate( new Function<Integer, String>()
{
@Override
public String map( Integer x )
{
return x.toString();
}
} );
String[] expected = new String[]
{
"5", "15", "45", "85"
};
assertThat( strings, hasItems( expected ) );
}
@Mixins( FListMixin.class )
public interface FList<FROM>
{
<TO> List<TO> translate( Function<FROM, TO> function );
}
public static class FListMixin<FROM>
implements FList<FROM>
{
@This
private List<FROM> list;
@Structure
private Module module;
@Override
public <TO> List<TO> translate( Function<FROM, TO> function )
{
List<TO> result = module.newTransient( List.class );
for( FROM data : list )
{
result.add( function.map( data ) );
}
return result;
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
9fd521abe5f74cf7ab34cd004259e05057c60756 | 5aa049046323559a730bbe721c42f625606e651b | /ZHVideo/src/com/zhcl/ui/widget/VideoImageView.java | 1ce4a209964cfe0c57af32179516700e8872472c | [] | no_license | YC-YC/work | 84771f4aa6fe139bf705d77c96643489c1f6766e | e0a9e8d485c176d7bab43dd6b905164062c73d0d | refs/heads/master | 2020-04-06T05:11:34.660751 | 2017-02-17T09:38:01 | 2017-02-17T09:38:01 | 54,162,618 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 910 | java | /**
*
*/
package com.zhcl.ui.widget;
import com.zh.uitls.L;
import com.zhonghong.zhvideo.R;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.widget.ImageView;
/**
* 当宽占全屏的时候,用来约束imageView的宽高比
* @author zhonghong.chenli
* @date 2015-12-20 下午3:41:22
*/
public class VideoImageView extends ImageView {
float hScale = 1;
public VideoImageView(Context context, AttributeSet attrs) {
super(context, attrs);
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.videoImage);
hScale = a.getFloat(R.styleable.videoImage_hscale, hScale);
a.recycle();
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int width = MeasureSpec.getSize(widthMeasureSpec);
int height = (int) (width * hScale);
setMeasuredDimension(width, height);
}
}
| [
"yellowc.yc@aliyun.com"
] | yellowc.yc@aliyun.com |
545bb9580d44628c62ec9d619323288b7bdf7114 | 805b2a791ec842e5afdd33bb47ac677b67741f78 | /Mage.Sets/src/mage/sets/commander2013/BarrenMoor.java | c819842aec58ecf9eeeb82eabb183b6ea55252e6 | [] | no_license | klayhamn/mage | 0d2d3e33f909b4052b0dfa58ce857fbe2fad680a | 5444b2a53beca160db2dfdda0fad50e03a7f5b12 | refs/heads/master | 2021-01-12T19:19:48.247505 | 2015-08-04T20:25:16 | 2015-08-04T20:25:16 | 39,703,242 | 2 | 0 | null | 2015-07-25T21:17:43 | 2015-07-25T21:17:42 | null | UTF-8 | Java | false | false | 2,161 | java | /*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.commander2013;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public class BarrenMoor extends mage.sets.onslaught.BarrenMoor {
public BarrenMoor(UUID ownerId) {
super(ownerId);
this.cardNumber = 277;
this.expansionSetCode = "C13";
}
public BarrenMoor(final BarrenMoor card) {
super(card);
}
@Override
public BarrenMoor copy() {
return new BarrenMoor(this);
}
}
| [
"ludwig.hirth@online.de"
] | ludwig.hirth@online.de |
b4916840dd135f9b4c80d73f4e85ffd9f8bb9c3d | c12e7f3dc9e19b585c06f7452cbd34d39910e230 | /hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ImagingModalityEnum.java | a01782a2f79b3a046971bdffb00d6e00efa23f00 | [] | no_license | dejunhsu/hapi-fhir | 57ac0d34f981637515d7c56909cdeee6afc25e13 | 84af486d511718f79919e2022d3fce1f4008e6fa | refs/heads/master | 2021-01-22T16:10:11.987226 | 2014-07-17T12:32:01 | 2014-07-17T12:32:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,153 | java |
package ca.uhn.fhir.model.dstu.valueset;
/*
* #%L
* HAPI FHIR Library
* %%
* Copyright (C) 2014 University Health Network
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import java.util.HashMap;
import java.util.Map;
import ca.uhn.fhir.model.api.IValueSetEnumBinder;
public enum ImagingModalityEnum {
/**
* Code Value: <b>AR</b>
*/
AR("AR", "http://nema.org/dicom/dcid"),
/**
* Code Value: <b>BMD</b>
*/
BMD("BMD", "http://nema.org/dicom/dcid"),
/**
* Code Value: <b>BDUS</b>
*/
BDUS("BDUS", "http://nema.org/dicom/dcid"),
/**
* Code Value: <b>EPS</b>
*/
EPS("EPS", "http://nema.org/dicom/dcid"),
/**
* Code Value: <b>CR</b>
*/
CR("CR", "http://nema.org/dicom/dcid"),
/**
* Code Value: <b>CT</b>
*/
CT("CT", "http://nema.org/dicom/dcid"),
/**
* Code Value: <b>DX</b>
*/
DX("DX", "http://nema.org/dicom/dcid"),
/**
* Code Value: <b>ECG</b>
*/
ECG("ECG", "http://nema.org/dicom/dcid"),
/**
* Code Value: <b>ES</b>
*/
ES("ES", "http://nema.org/dicom/dcid"),
/**
* Code Value: <b>XC</b>
*/
XC("XC", "http://nema.org/dicom/dcid"),
/**
* Code Value: <b>GM</b>
*/
GM("GM", "http://nema.org/dicom/dcid"),
/**
* Code Value: <b>HD</b>
*/
HD("HD", "http://nema.org/dicom/dcid"),
/**
* Code Value: <b>IO</b>
*/
IO("IO", "http://nema.org/dicom/dcid"),
/**
* Code Value: <b>IVOCT</b>
*/
IVOCT("IVOCT", "http://nema.org/dicom/dcid"),
/**
* Code Value: <b>IVUS</b>
*/
IVUS("IVUS", "http://nema.org/dicom/dcid"),
/**
* Code Value: <b>KER</b>
*/
KER("KER", "http://nema.org/dicom/dcid"),
/**
* Code Value: <b>LEN</b>
*/
LEN("LEN", "http://nema.org/dicom/dcid"),
/**
* Code Value: <b>MR</b>
*/
MR("MR", "http://nema.org/dicom/dcid"),
/**
* Code Value: <b>MG</b>
*/
MG("MG", "http://nema.org/dicom/dcid"),
/**
* Code Value: <b>NM</b>
*/
NM("NM", "http://nema.org/dicom/dcid"),
/**
* Code Value: <b>OAM</b>
*/
OAM("OAM", "http://nema.org/dicom/dcid"),
/**
* Code Value: <b>OCT</b>
*/
OCT("OCT", "http://nema.org/dicom/dcid"),
/**
* Code Value: <b>OPM</b>
*/
OPM("OPM", "http://nema.org/dicom/dcid"),
/**
* Code Value: <b>OP</b>
*/
OP("OP", "http://nema.org/dicom/dcid"),
/**
* Code Value: <b>OPR</b>
*/
OPR("OPR", "http://nema.org/dicom/dcid"),
/**
* Code Value: <b>OPT</b>
*/
OPT("OPT", "http://nema.org/dicom/dcid"),
/**
* Code Value: <b>OPV</b>
*/
OPV("OPV", "http://nema.org/dicom/dcid"),
/**
* Code Value: <b>PX</b>
*/
PX("PX", "http://nema.org/dicom/dcid"),
/**
* Code Value: <b>PT</b>
*/
PT("PT", "http://nema.org/dicom/dcid"),
/**
* Code Value: <b>RF</b>
*/
RF("RF", "http://nema.org/dicom/dcid"),
/**
* Code Value: <b>RG</b>
*/
RG("RG", "http://nema.org/dicom/dcid"),
/**
* Code Value: <b>SM</b>
*/
SM("SM", "http://nema.org/dicom/dcid"),
/**
* Code Value: <b>SRF</b>
*/
SRF("SRF", "http://nema.org/dicom/dcid"),
/**
* Code Value: <b>US</b>
*/
US("US", "http://nema.org/dicom/dcid"),
/**
* Code Value: <b>VA</b>
*/
VA("VA", "http://nema.org/dicom/dcid"),
/**
* Code Value: <b>XA</b>
*/
XA("XA", "http://nema.org/dicom/dcid"),
;
/**
* Identifier for this Value Set:
* http://hl7.org/fhir/vs/imaging-modality
*/
public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/imaging-modality";
/**
* Name for this Value Set:
* ImagingModality
*/
public static final String VALUESET_NAME = "ImagingModality";
private static Map<String, ImagingModalityEnum> CODE_TO_ENUM = new HashMap<String, ImagingModalityEnum>();
private static Map<String, Map<String, ImagingModalityEnum>> SYSTEM_TO_CODE_TO_ENUM = new HashMap<String, Map<String, ImagingModalityEnum>>();
private final String myCode;
private final String mySystem;
static {
for (ImagingModalityEnum next : ImagingModalityEnum.values()) {
CODE_TO_ENUM.put(next.getCode(), next);
if (!SYSTEM_TO_CODE_TO_ENUM.containsKey(next.getSystem())) {
SYSTEM_TO_CODE_TO_ENUM.put(next.getSystem(), new HashMap<String, ImagingModalityEnum>());
}
SYSTEM_TO_CODE_TO_ENUM.get(next.getSystem()).put(next.getCode(), next);
}
}
/**
* Returns the code associated with this enumerated value
*/
public String getCode() {
return myCode;
}
/**
* Returns the code system associated with this enumerated value
*/
public String getSystem() {
return mySystem;
}
/**
* Returns the enumerated value associated with this code
*/
public ImagingModalityEnum forCode(String theCode) {
ImagingModalityEnum retVal = CODE_TO_ENUM.get(theCode);
return retVal;
}
/**
* Converts codes to their respective enumerated values
*/
public static final IValueSetEnumBinder<ImagingModalityEnum> VALUESET_BINDER = new IValueSetEnumBinder<ImagingModalityEnum>() {
@Override
public String toCodeString(ImagingModalityEnum theEnum) {
return theEnum.getCode();
}
@Override
public String toSystemString(ImagingModalityEnum theEnum) {
return theEnum.getSystem();
}
@Override
public ImagingModalityEnum fromCodeString(String theCodeString) {
return CODE_TO_ENUM.get(theCodeString);
}
@Override
public ImagingModalityEnum fromCodeString(String theCodeString, String theSystemString) {
Map<String, ImagingModalityEnum> map = SYSTEM_TO_CODE_TO_ENUM.get(theSystemString);
if (map == null) {
return null;
}
return map.get(theCodeString);
}
};
/**
* Constructor
*/
ImagingModalityEnum(String theCode, String theSystem) {
myCode = theCode;
mySystem = theSystem;
}
}
| [
"jamesagnew@gmail.com"
] | jamesagnew@gmail.com |
3daa859c7977cd18eb96e0f225147d6a247ccc40 | 6e6f0a4518a323e1a863beedc6c2ea641ba266e6 | /fractions/microprofile/microprofile-metrics/src/main/java/org/wildfly/swarm/microprofile_metrics/runtime/app/HistogramImpl.java | 233a729532286f87c291bfe19f998c105c093c41 | [
"Apache-2.0"
] | permissive | dbenninger/wildfly-swarm | 75a207ce0bf2b9f2eb2fe4583cc2b9c746a231f4 | 4271ef76c4881a23ed7c22d7912add184c6b98de | refs/heads/master | 2021-08-20T05:24:21.721249 | 2017-11-28T07:46:50 | 2017-11-28T07:46:50 | 111,907,014 | 0 | 0 | null | 2017-11-24T10:38:11 | 2017-11-24T10:38:11 | null | UTF-8 | Java | false | false | 2,844 | java | /*
* Copyright 2017 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* *******************************************************************************
* Copyright 2010-2013 Coda Hale and Yammer, 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 org.wildfly.swarm.microprofile_metrics.runtime.app;
import org.eclipse.microprofile.metrics.Histogram;
import org.eclipse.microprofile.metrics.Snapshot;
import java.util.concurrent.atomic.LongAdder;
/**
* A metric which calculates the distribution of a value.
*
* @see <a href="http://www.johndcook.com/standard_deviation.html">Accurately computing running
* variance</a>
*/
public class HistogramImpl implements Histogram {
private final Reservoir reservoir;
private final LongAdder count;
/**
* Creates a new {@link HistogramImpl} with the given reservoir.
*
* @param reservoir the reservoir to create a histogram from
*/
public HistogramImpl(Reservoir reservoir) {
this.reservoir = reservoir;
this.count = new LongAdder();
}
/**
* Adds a recorded value.
*
* @param value the length of the value
*/
public void update(int value) {
update((long) value);
}
/**
* Adds a recorded value.
*
* @param value the length of the value
*/
public void update(long value) {
count.increment();
reservoir.update(value);
}
/**
* Returns the number of values recorded.
*
* @return the number of values recorded
*/
@Override
public long getCount() {
return count.sum();
}
@Override
public Snapshot getSnapshot() {
return reservoir.getSnapshot();
}
}
| [
"hwr@pilhuhn.de"
] | hwr@pilhuhn.de |
1e728d544fd48ce2bdecba93b00f37779bf77f8d | 8b8de513443326ccb94da8867d2b0de3ade42abc | /src/test/java/multithread/designpattern/productorconsumer/Main.java | 9db5834500be2851ccbb5d82654b8374fc0ff91c | [] | no_license | hklhai/ssh-lab | f4ac4f562ca0202204bb173cd8b34b749d71a228 | b788b102e40006c812a49ca98e14c06dfc43568e | refs/heads/master | 2022-12-21T02:38:25.143791 | 2020-05-20T23:08:30 | 2020-05-20T23:08:30 | 124,736,633 | 0 | 0 | null | 2022-12-16T04:24:31 | 2018-03-11T08:18:28 | Java | UTF-8 | Java | false | false | 1,597 | java | package multithread.designpattern.productorconsumer;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
/**
* Created by Ocean lin on 2018/3/17.
*
* @author Ocean lin
*/
public class Main {
public static void main(String[] args) {
//内存缓冲区
BlockingQueue<Data> queue = new LinkedBlockingQueue<Data>(10);
//生产者
Provider p1 = new Provider(queue);
Provider p2 = new Provider(queue);
Provider p3 = new Provider(queue);
//消费者
Consumer c1 = new Consumer(queue);
Consumer c2 = new Consumer(queue);
Consumer c3 = new Consumer(queue);
//创建线程池运行,这是一个缓存的线程池,可以创建无穷大的线程,没有任务的时候不创建线程。空闲线程存活时间为60s(默认值)
ExecutorService cachePool = Executors.newCachedThreadPool();
cachePool.execute(p1);
cachePool.execute(p2);
cachePool.execute(p3);
cachePool.execute(c1);
cachePool.execute(c2);
cachePool.execute(c3);
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
p1.stop();
p2.stop();
p3.stop();
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
e.printStackTrace();
}
// cachePool.shutdown();
// cachePool.shutdownNow();
}
}
| [
"hkhai@outlook.com"
] | hkhai@outlook.com |
4863322a4914e4dc6a5b9681d2612800b20b137a | 07e32dfab9e305b865446811ed954b01d11058ec | /src/day34_LocalDateTime_Wrapper/WrapperClassMethods.java | 89b2e5674585e0fb25040c2b5ad58d37979253c1 | [] | no_license | Sabirindev/JavaProgramming_B23 | 0eba2ae6257d2a890a7c0cece9467411434325ed | 5f956f08e26fc10a79a203591b0946111ae1017a | refs/heads/master | 2023-08-27T18:11:07.482812 | 2021-10-14T18:39:20 | 2021-10-14T18:39:20 | 387,595,286 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,100 | java | package day34_LocalDateTime_Wrapper;
public class WrapperClassMethods {
public static void main(String[] args) {
String str = "123";
int num = Integer.parseInt(str); // int primitive
int num2 = Integer.valueOf(str); // wrapper class
System.out.println(num - 1);
String str2 = "true";
boolean r1 = Boolean.parseBoolean(str2);//primitive // noneboxing boolean = boolean
boolean r2 = Boolean.valueOf(str2);// wrapper, unboxing boolean = Boolean
Boolean r3 = Boolean.parseBoolean(str2);// primitive, Autoboxin Boolean = boolean
String str3 = "2.5";
double d1 = Double.parseDouble(str3);
System.out.println("****************************************************");
char ch = '4';
boolean isDigit = Character.isDigit(ch);
System.out.println(isDigit);
boolean isLetter = Character.isLetter(ch);
System.out.println(isLetter);
boolean isSpecialChar = !Character.isLetterOrDigit(ch);
System.out.println(isSpecialChar);
System.out.println("*******************************************************");
String s = "a1b2c3";
int sum = 0;
for (char each : s.toCharArray()) {
if (Character.isDigit(each)){
sum += Integer.parseInt(""+each);
}
}
System.out.println("sum = "+ sum);
System.out.println("***********************************************************");
String s2 = "AAABBBCCC!@#$%#@!$%^&";
String letters = "",
digits = "",
specialChars ="";
for (char each : s2.toCharArray()) {
if (Character.isDigit(each)){
digits += each;
}else if(Character.isLetter(each)){
letters += each;
}else{
specialChars += each;
}
}
System.out.println("letters = " + letters);
System.out.println("digits = " + digits);
System.out.println("specialChars = " + specialChars);
}
}
| [
"sdetinscrum@gmail.com"
] | sdetinscrum@gmail.com |
27a2daac52e7ee91aa0ecc65d85c2814de0e3eec | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /large-multiproject/project33/src/test/java/org/gradle/test/performance33_4/Test33_361.java | d00f68b13a416741d80cc5c705b4251ae868cded | [] | no_license | gradle/performance-comparisons | b0d38db37c326e0ce271abebdb3c91769b860799 | e53dc7182fafcf9fedf07920cbbea8b40ee4eef4 | refs/heads/master | 2023-08-14T19:24:39.164276 | 2022-11-24T05:18:33 | 2022-11-24T05:18:33 | 80,121,268 | 17 | 15 | null | 2022-09-30T08:04:35 | 2017-01-26T14:25:33 | null | UTF-8 | Java | false | false | 292 | java | package org.gradle.test.performance33_4;
import static org.junit.Assert.*;
public class Test33_361 {
private final Production33_361 production = new Production33_361("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
} | [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
d1ec00785670db4b385d2450f97372dcb7af3019 | 8f898aacf2873a8129664d7b5a2cadc85d61e9ca | /blade-example/blade-easypoi/src/test/java/org/springblade/example/poi/test/excel/read/ExcelImportUtilOneToManyHasNameTest.java | 065fb334b2f34ea94526f22e231dadca6f637809 | [] | no_license | htao09/BladeX-Biz | 1fb1a208ecc6f24983020deabe7230ae32ef741e | deb22cfdb05000ecc7c6eff19626a48ff35bf822 | refs/heads/master | 2022-04-10T03:03:02.668186 | 2020-01-01T08:09:48 | 2020-01-01T08:09:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,158 | java | package org.springblade.example.poi.test.excel.read;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import org.springblade.example.poi.test.entity.onettomany.hasname.DemandEntity;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.junit.Assert;
import org.junit.Test;
import java.io.File;
import java.io.FileInputStream;
import java.util.Date;
import java.util.List;
public class ExcelImportUtilOneToManyHasNameTest {
///ExcelExportMsgClient 测试是这个到处的数据下个版本吧,现在还不支持
//
@Test
public void test() throws Exception {
ImportParams params = new ImportParams();
params.setTitleRows(1);
params.setHeadRows(3);
long start = new Date().getTime();
List<DemandEntity> list = ExcelImportUtil.importExcel(
new FileInputStream(
new File(FileUtilTest.getWebRootPath("import/OneToManyHaseNameTest.demandEntityTest.xlsx"))),
DemandEntity.class, params);
for (int i = 0; i < list.size(); i++) {
System.out.println(ReflectionToStringBuilder.toString(list.get(i)));
}
Assert.assertEquals(100, list.size());
}
}
| [
"smallchill@163.com"
] | smallchill@163.com |
57175a3e69b1793f95570ab3c9f6d3347c9d7d6b | dd80a584130ef1a0333429ba76c1cee0eb40df73 | /external/proguard/src/proguard/optimize/info/NoSideEffectMethodMarker.java | 5c78408109912131f6202226b8f2f1f658aeb864 | [
"MIT",
"GPL-1.0-or-later",
"GPL-2.0-only",
"GPL-2.0-or-later"
] | 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 | 2,833 | java | /*
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
* Copyright (c) 2002-2009 Eric Lafortune (eric@graphics.cornell.edu)
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package proguard.optimize.info;
import proguard.classfile.*;
import proguard.classfile.util.*;
import proguard.classfile.visitor.MemberVisitor;
/**
* This MemberVisitor marks all methods that it visits as not having any side
* effects. It will make the SideEffectMethodMarker consider them as such
* without further analysis.
*
* @see SideEffectMethodMarker
* @author Eric Lafortune
*/
public class NoSideEffectMethodMarker
extends SimplifiedVisitor
implements MemberVisitor
{
// A visitor info flag to indicate the visitor accepter is being kept,
// but that it doesn't have any side effects.
private static final Object KEPT_BUT_NO_SIDE_EFFECTS = new Object();
// Implementations for MemberVisitor.
public void visitAnyMember(Clazz Clazz, Member member)
{
// Ignore any attempts to mark fields.
}
public void visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod)
{
markNoSideEffects(programMethod);
}
public void visitLibraryMethod(LibraryClass libraryClass, LibraryMethod libraryMethod)
{
markNoSideEffects(libraryMethod);
}
// Small utility methods.
private static void markNoSideEffects(Method method)
{
MethodOptimizationInfo info = MethodOptimizationInfo.getMethodOptimizationInfo(method);
if (info != null)
{
info.setNoSideEffects();
}
else
{
MethodLinker.lastMember(method).setVisitorInfo(KEPT_BUT_NO_SIDE_EFFECTS);
}
}
public static boolean hasNoSideEffects(Method method)
{
if (MethodLinker.lastVisitorAccepter(method).getVisitorInfo() == KEPT_BUT_NO_SIDE_EFFECTS)
{
return true;
}
MethodOptimizationInfo info = MethodOptimizationInfo.getMethodOptimizationInfo(method);
return info != null &&
info.hasNoSideEffects();
}
}
| [
"karun.matharu@gmail.com"
] | karun.matharu@gmail.com |
1a891666c3bc808da69ff66b2b049a11aa5b181f | 2fab167484c0852f19f028bf2faa3a1546c86b0a | /src/labs/pm/data/Review.java | 776615b2d62875cd8572bafb5424b7480df0cd04 | [] | no_license | CyberPointer/oracle-labs | e7a424daa578cdcd43fcb6b913bec6b083633e02 | d103b1c3a2d6aa3fc9bfbf808e1ea74719ba86da | refs/heads/main | 2023-03-22T02:04:14.684596 | 2021-03-23T20:29:33 | 2021-03-23T20:29:33 | 350,334,815 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,410 | java | /*
* Copyright (C) 2021 Eugen
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package labs.pm.data;
import java.io.Serializable;
/**
*
* @author Eugen
*/
public class Review implements Comparable<Review>, Serializable {
private Rating rating;
private String comments;
public Review(Rating rating, String comments) {
this.rating = rating;
this.comments = comments;
}
public Rating getRating() {
return rating;
}
public String getComments() {
return comments;
}
@Override
public String toString() {
return "Review{" + "rating=" + rating + ", comments=" + comments + '}';
}
@Override
public int compareTo(Review other) {
return other.getRating().ordinal() - this.getRating().ordinal();
}
}
| [
"test@example.com"
] | test@example.com |
f24d3e42821db36d12c3593864502772aa11e6d5 | 13cbb329807224bd736ff0ac38fd731eb6739389 | /javax/sql/ConnectionEvent.java | b2c38ac6d763b779297a3a81f5cd3f31f5307058 | [] | no_license | ZhipingLi/rt-source | 5e2537ed5f25d9ba9a0f8009ff8eeca33930564c | 1a70a036a07b2c6b8a2aac6f71964192c89aae3c | refs/heads/master | 2023-07-14T15:00:33.100256 | 2021-09-01T04:49:04 | 2021-09-01T04:49:04 | 401,933,858 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 749 | java | package javax.sql;
import java.sql.SQLException;
import java.util.EventObject;
public class ConnectionEvent extends EventObject {
private SQLException ex = null;
static final long serialVersionUID = -4843217645290030002L;
public ConnectionEvent(PooledConnection paramPooledConnection) { super(paramPooledConnection); }
public ConnectionEvent(PooledConnection paramPooledConnection, SQLException paramSQLException) {
super(paramPooledConnection);
this.ex = paramSQLException;
}
public SQLException getSQLException() { return this.ex; }
}
/* Location: D:\software\jd-gui\jd-gui-windows-1.6.3\rt.jar!\javax\sql\ConnectionEvent.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.0.7
*/ | [
"michael__lee@yeah.net"
] | michael__lee@yeah.net |
fa7744600a21a6955c62142dd7b163993a2d431c | f5bb98e34072840470924ace8922dc58644745a2 | /dms/src/main/java/com/project/dms/entiy/DrugListDef.java | ee20b4319d94203110bac7b1a8a684e8ecb711ca | [] | no_license | NTlulujun/qhj | 7c5519587be2cb92b47f3cd1f63dd66d1c074726 | 9f0e75d0385284702343ab149247e474a8cd0030 | refs/heads/master | 2023-02-11T09:03:58.606112 | 2021-01-10T09:50:41 | 2021-01-10T09:50:41 | 328,298,311 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,502 | java | package com.project.dms.entiy;
import java.io.Serializable;
import java.math.BigDecimal;
public class DrugListDef implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column drug_list_def.DRUG_ID
*
* @mbggenerated
*/
private Integer drugId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column drug_list_def.DRUG_CODE
*
* @mbggenerated
*/
private String drugCode;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column drug_list_def.DRUG_TYPE
*
* @mbggenerated
*/
private String drugType;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column drug_list_def.DRUG_NAME
*
* @mbggenerated
*/
private String drugName;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column drug_list_def.UNIT_PRICE
*
* @mbggenerated
*/
private BigDecimal unitPrice;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table drug_list_def
*
* @mbggenerated
*/
private static final long serialVersionUID = 1L;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column drug_list_def.DRUG_ID
*
* @return the value of drug_list_def.DRUG_ID
*
* @mbggenerated
*/
public Integer getDrugId() {
return drugId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column drug_list_def.DRUG_ID
*
* @param drugId the value for drug_list_def.DRUG_ID
*
* @mbggenerated
*/
public void setDrugId(Integer drugId) {
this.drugId = drugId;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column drug_list_def.DRUG_CODE
*
* @return the value of drug_list_def.DRUG_CODE
*
* @mbggenerated
*/
public String getDrugCode() {
return drugCode;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column drug_list_def.DRUG_CODE
*
* @param drugCode the value for drug_list_def.DRUG_CODE
*
* @mbggenerated
*/
public void setDrugCode(String drugCode) {
this.drugCode = drugCode == null ? null : drugCode.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column drug_list_def.DRUG_TYPE
*
* @return the value of drug_list_def.DRUG_TYPE
*
* @mbggenerated
*/
public String getDrugType() {
return drugType;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column drug_list_def.DRUG_TYPE
*
* @param drugType the value for drug_list_def.DRUG_TYPE
*
* @mbggenerated
*/
public void setDrugType(String drugType) {
this.drugType = drugType == null ? null : drugType.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column drug_list_def.DRUG_NAME
*
* @return the value of drug_list_def.DRUG_NAME
*
* @mbggenerated
*/
public String getDrugName() {
return drugName;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column drug_list_def.DRUG_NAME
*
* @param drugName the value for drug_list_def.DRUG_NAME
*
* @mbggenerated
*/
public void setDrugName(String drugName) {
this.drugName = drugName == null ? null : drugName.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column drug_list_def.UNIT_PRICE
*
* @return the value of drug_list_def.UNIT_PRICE
*
* @mbggenerated
*/
public BigDecimal getUnitPrice() {
return unitPrice;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column drug_list_def.UNIT_PRICE
*
* @param unitPrice the value for drug_list_def.UNIT_PRICE
*
* @mbggenerated
*/
public void setUnitPrice(BigDecimal unitPrice) {
this.unitPrice = unitPrice;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table drug_list_def
*
* @mbggenerated
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", drugId=").append(drugId);
sb.append(", drugCode=").append(drugCode);
sb.append(", drugType=").append(drugType);
sb.append(", drugName=").append(drugName);
sb.append(", unitPrice=").append(unitPrice);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
} | [
"1"
] | 1 |
b34e41deeb4a4e3b2216671f58236e23d7f0be26 | 1efd789f2f4a4e8e280789f95c59afa5426cc4b9 | /src/main/java/stu/napls/boostimcenter/repository/UserRepository.java | e5bfcc2f04294125731266240965c755671c4859 | [
"Apache-2.0"
] | permissive | teimichael/BoostimCenter | faf1d677137ee2d3ed4fabceec4ffc69fced3424 | 14330881618ac89f2ce8a4996559f26a0d394ae2 | refs/heads/master | 2021-07-22T18:57:33.132136 | 2021-01-02T14:17:09 | 2021-01-02T14:17:09 | 232,578,493 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 301 | java | package stu.napls.boostimcenter.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import stu.napls.boostimcenter.model.User;
public interface UserRepository extends JpaRepository<User, Long> {
User findByUuid(String uuid);
User findBySessionId(String sessionId);
}
| [
"teimichael@outlook.com"
] | teimichael@outlook.com |
796199421dac3563968fdf6ec4389ea9522e4de3 | e6c55affcb078a2c4bf4103aa569b86c573f30bc | /link-to-world/dealer-service/src/test/java/app/dealer/product/web/DealerProductWebServiceImplTest.java | b4560640ed1403e524caac49eda55b324a1da651 | [] | no_license | jackyu86/sourceLib | 5487dd7409b79e25636853e115e432ddb0952d41 | a02bab7d6e2abdb09e1e53c8ac00b17011f0eb05 | refs/heads/master | 2021-08-28T03:01:31.442992 | 2017-12-11T03:30:02 | 2017-12-11T03:30:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,446 | java | package app.dealer.product.web;
import app.dealer.DealerModuleImpl;
import app.dealer.SiteRule;
import app.dealer.api.product.SearchDealerProductRequest;
import app.dealer.product.domain.DealerProduct;
import com.google.common.collect.Lists;
import com.mongodb.client.MongoCollection;
import io.sited.db.DBModule;
import io.sited.db.FindView;
import io.sited.db.MongoConfig;
import io.sited.http.ServerResponse;
import org.bson.Document;
import org.bson.types.ObjectId;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import java.util.UUID;
/**
* @author miller
*/
public class DealerProductWebServiceImplTest {
@Rule
public final SiteRule site = new SiteRule(new DealerModuleImpl());
private DealerProduct defaultDealerProduct;
private ObjectId id;
private ObjectId categoryId;
private String productName;
private String dealerId;
private MongoCollection<DealerProduct> collection;
@Before
public void setUp() throws Exception {
defaultDealerProduct = new DealerProduct();
dealerId = new ObjectId().toHexString();
defaultDealerProduct.dealerId = dealerId;
productName = UUID.randomUUID().toString().replaceAll("-", "");
defaultDealerProduct.productName = productName;
categoryId = new ObjectId();
defaultDealerProduct.insuranceCategoryIds = Lists.newArrayList(categoryId);
collection = site.module(DBModule.class).require(MongoConfig.class).db().getCollection("dealer_product", DealerProduct.class);
collection.insertOne(defaultDealerProduct);
id = defaultDealerProduct.id;
}
@After
public void tearDown() throws Exception {
collection.deleteOne(new Document("_id", id));
}
@Test
public void search() throws Exception {
SearchDealerProductRequest request = new SearchDealerProductRequest();
request.categoryIds = Lists.newArrayList(categoryId);
request.limit = 1;
request.page = 1;
ServerResponse response = site.post("/api/dealer/" + dealerId + "/search").body(request).execute();
Assert.assertEquals(200, response.statusCode());
FindView<String> productIds = response.body(FindView.class);
Assert.assertEquals(1, productIds.items.size());
String actual = productIds.items.get(0);
Assert.assertEquals(productName, actual);
}
} | [
"leegine@gmail.com"
] | leegine@gmail.com |
5e2563e4896feb79e1403e665c78a0ff7c3c36ef | 92dd6bc0a9435c359593a1f9b309bb58d3e3f103 | /src/Feb2021Leetcode/_0159LongestSubstringWithAtMostTwoDistinctCharacters.java | ce68c691aa51becc6e687d072e4dddd28df74589 | [
"MIT"
] | permissive | darshanhs90/Java-Coding | bfb2eb84153a8a8a9429efc2833c47f6680f03f4 | da76ccd7851f102712f7d8dfa4659901c5de7a76 | refs/heads/master | 2023-05-27T03:17:45.055811 | 2021-06-16T06:18:08 | 2021-06-16T06:18:08 | 36,981,580 | 3 | 3 | null | null | null | null | UTF-8 | Java | false | false | 382 | java | package Feb2021Leetcode;
import java.util.HashMap;
public class _0159LongestSubstringWithAtMostTwoDistinctCharacters {
public static void main(String[] args) {
System.out.println(lengthOfLongestSubstringTwoDistinct("eceba"));
System.out.println(lengthOfLongestSubstringTwoDistinct("ccaabbb"));
}
public static int lengthOfLongestSubstringTwoDistinct(String s) {
}
}
| [
"hsdars@gmail.com"
] | hsdars@gmail.com |
52d23547e2a6e05ded009bcfa93c740e1f8d02c0 | 329307375d5308bed2311c178b5c245233ac6ff1 | /src/com/tencent/kingkong/MergeCursor.java | 94e233d702d243204f043243283792ae7fadbcae | [] | no_license | ZoneMo/com.tencent.mm | 6529ac4c31b14efa84c2877824fa3a1f72185c20 | dc4f28aadc4afc27be8b099e08a7a06cee1960fe | refs/heads/master | 2021-01-18T12:12:12.843406 | 2015-07-05T03:21:46 | 2015-07-05T03:21:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,327 | java | package com.tencent.kingkong;
import android.database.CharArrayBuffer;
public class MergeCursor
extends AbstractCursor
{
private Cursor mCursor;
private Cursor[] mCursors;
private DataSetObserver mObserver = new MergeCursor.1(this);
public MergeCursor(Cursor[] paramArrayOfCursor)
{
mCursors = paramArrayOfCursor;
mCursor = paramArrayOfCursor[0];
for (;;)
{
if (i >= mCursors.length) {
return;
}
if (mCursors[i] != null) {
mCursors[i].registerDataSetObserver(mObserver);
}
i += 1;
}
}
public void close()
{
int j = mCursors.length;
int i = 0;
for (;;)
{
if (i >= j)
{
super.close();
return;
}
if (mCursors[i] != null) {
mCursors[i].close();
}
i += 1;
}
}
public void copyStringToBuffer(int paramInt, CharArrayBuffer paramCharArrayBuffer) {}
public void deactivate()
{
int j = mCursors.length;
int i = 0;
for (;;)
{
if (i >= j)
{
super.deactivate();
return;
}
if (mCursors[i] != null) {
mCursors[i].deactivate();
}
i += 1;
}
}
public byte[] getBlob(int paramInt)
{
return mCursor.getBlob(paramInt);
}
public String[] getColumnNames()
{
if (mCursor != null) {
return mCursor.getColumnNames();
}
return new String[0];
}
public int getCount()
{
int j = 0;
int m = mCursors.length;
int i = 0;
for (;;)
{
if (i >= m) {
return j;
}
int k = j;
if (mCursors[i] != null) {
k = j + mCursors[i].getCount();
}
i += 1;
j = k;
}
}
public double getDouble(int paramInt)
{
return mCursor.getDouble(paramInt);
}
public float getFloat(int paramInt)
{
return mCursor.getFloat(paramInt);
}
public int getInt(int paramInt)
{
return mCursor.getInt(paramInt);
}
public long getLong(int paramInt)
{
return mCursor.getLong(paramInt);
}
public short getShort(int paramInt)
{
return mCursor.getShort(paramInt);
}
public String getString(int paramInt)
{
return mCursor.getString(paramInt);
}
public int getType(int paramInt)
{
return mCursor.getType(paramInt);
}
public boolean isNull(int paramInt)
{
return mCursor.isNull(paramInt);
}
public boolean onMove(int paramInt1, int paramInt2)
{
mCursor = null;
int k = mCursors.length;
paramInt1 = 0;
int j;
for (int i = 0;; i = j)
{
if (paramInt1 >= k) {}
for (;;)
{
if (mCursor == null) {
break label109;
}
return mCursor.moveToPosition(paramInt2 - i);
j = i;
if (mCursors[paramInt1] == null) {
break label99;
}
if (paramInt2 >= mCursors[paramInt1].getCount() + i) {
break;
}
mCursor = mCursors[paramInt1];
}
j = i + mCursors[paramInt1].getCount();
label99:
paramInt1 += 1;
}
label109:
return false;
}
public void registerContentObserver(android.database.ContentObserver paramContentObserver) {}
public void registerContentObserver(ContentObserver paramContentObserver)
{
int j = mCursors.length;
int i = 0;
for (;;)
{
if (i >= j) {
return;
}
if (mCursors[i] != null) {
mCursors[i].registerContentObserver(paramContentObserver);
}
i += 1;
}
}
public void registerDataSetObserver(android.database.DataSetObserver paramDataSetObserver) {}
public void registerDataSetObserver(DataSetObserver paramDataSetObserver)
{
int j = mCursors.length;
int i = 0;
for (;;)
{
if (i >= j) {
return;
}
if (mCursors[i] != null) {
mCursors[i].registerDataSetObserver(paramDataSetObserver);
}
i += 1;
}
}
public boolean requery()
{
boolean bool2 = false;
int j = mCursors.length;
int i = 0;
for (;;)
{
boolean bool1;
if (i >= j) {
bool1 = true;
}
do
{
return bool1;
if (mCursors[i] == null) {
break;
}
bool1 = bool2;
} while (!mCursors[i].requery());
i += 1;
}
}
public void unregisterContentObserver(android.database.ContentObserver paramContentObserver) {}
public void unregisterContentObserver(ContentObserver paramContentObserver)
{
int j = mCursors.length;
int i = 0;
for (;;)
{
if (i >= j) {
return;
}
if (mCursors[i] != null) {
mCursors[i].unregisterContentObserver(paramContentObserver);
}
i += 1;
}
}
public void unregisterDataSetObserver(android.database.DataSetObserver paramDataSetObserver) {}
public void unregisterDataSetObserver(DataSetObserver paramDataSetObserver)
{
int j = mCursors.length;
int i = 0;
for (;;)
{
if (i >= j) {
return;
}
if (mCursors[i] != null) {
mCursors[i].unregisterDataSetObserver(paramDataSetObserver);
}
i += 1;
}
}
}
/* Location:
* Qualified Name: com.tencent.kingkong.MergeCursor
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"reverseengineeringer@hackeradmin.com"
] | reverseengineeringer@hackeradmin.com |
9f08cd3a035c5e014131160b22e5616819e0eb2a | f7f773ab56f61a83032682e66019372e6e853ec9 | /framework/gwt/src/cc/alcina/framework/gwt/client/dirndl/model/SelectorModel.java | 89053815c17bb72943309261d528c434d884cf6f | [] | no_license | sp2020jarvan3/alcina | b4025b71375e0c0cdcda3d52400f8cba22bfb795 | 40f5089c710d37542d04fde1bcd9a5b681ca901d | refs/heads/main | 2023-03-23T11:49:38.184094 | 2021-03-22T17:33:24 | 2021-03-22T17:33:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 603 | java | package cc.alcina.framework.gwt.client.dirndl.model;
import java.util.List;
public class SelectorModel<T> extends Model {
private List<T> selected;
private String input;
public List<T> getSelected() {
return this.selected;
}
public void setSelected(List<T> selected) {
this.selected = selected;
}
public String getInput() {
return this.input;
}
public void setInput(String input) {
this.input = input;
}
public List<T> getSuggested() {
return this.suggested;
}
public void setSuggested(List<T> suggested) {
this.suggested = suggested;
}
private List<T> suggested;
}
| [
"nick.reddel@gmail.com"
] | nick.reddel@gmail.com |
ae5a263a11c16d6e4c4765bf56376bb7ae434a5b | 54ce499a0f15e2b6529ed9695610f0cec7eba53d | /project-hasor/hasor-mvc/src/main/java/net/hasor/mvc/web/result/Json.java | aa893152dd5c90a873403425149da7a038eb8922 | [] | no_license | aolaog/hasor | 7f268da19ecf22af2d153535855c2efdb275dc0c | b498475310609c14d424348675acac1b285c2854 | refs/heads/master | 2021-01-18T19:48:15.283745 | 2015-03-13T01:47:47 | 2015-03-13T01:47:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,081 | java | ///*
// * Copyright 2008-2009 the original 赵永春(zyc@hasor.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 net.hasor.mvc.web.result;
//import java.lang.annotation.ElementType;
//import java.lang.annotation.Retention;
//import java.lang.annotation.RetentionPolicy;
//import java.lang.annotation.Target;
///**
// * 将返回值转为json格式输出。
// * @version : 2013-6-5
// * @author 赵永春 (zyc@hasor.net)
// */
//@Retention(RetentionPolicy.RUNTIME)
//@Target({ ElementType.METHOD })
//public @interface Json {} | [
"zyc@byshell.org"
] | zyc@byshell.org |
542eaaee55cab3a91298cd4b9d5cec94ae89ba62 | 9a6f4867c97f3ea4e3a958181b625be0d52077af | /src/main/java/com/fds/repositories/SysTaskRepo.java | 0ac630700c8a58bf1e84b3bf734bb59c25562be7 | [] | no_license | vht1092/FraudDetectionSystems_v4 | c51501e28d72633e80005d6a0e79d86b6f9498d2 | 03c8d282477730dfaa5a55d7045d7aa4508979b2 | refs/heads/master | 2023-05-14T22:05:41.803904 | 2021-05-10T06:57:19 | 2021-05-10T06:57:19 | 365,917,481 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,662 | java | package com.fds.repositories;
import java.math.BigDecimal;
import java.util.List;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import com.fds.entities.FdsPosSysTask;
@Transactional
@Repository
public interface SysTaskRepo extends CrudRepository<FdsPosSysTask, Long> {
@Query(value = "select count(t.id) from FdsPosSysTask t where t.objecttask = :caseno and :currentdate between t.fromdate and t.todate")
int countByCaseNo(@Param("caseno") String caseno, @Param("currentdate") BigDecimal currentdate);
@Query(value = "select t.id,t.fromdate,t.todate,t.object_task,t.type_task,t.priority,t.userid from fds_pos_sys_task t where t.userid = :userid and substr(t.todate, 0, 12) = to_char(to_date('201610311631','yyyyMMddHH24MI'), 'yyyyMMddHH24MI') and t.type_task = :type", nativeQuery = true)
Iterable<FdsPosSysTask> findAllByUseridWithCurrentTime(@Param("userid") String userid, @Param("type") String type);
@Query("select f from FdsPosSysTask f where f.objecttask=:object and to_number(to_char(sysdate, 'yyyyMMddHH24MISSSSS')) between f.fromdate and f.todate and f.typetask=:type")
FdsPosSysTask findOneByObjectAndCurrentTime(@Param("object") String object, @Param("type") String type);
@Query("select f from FdsPosSysTask f where (f.mid=:mid or f.tid=:tid) and to_number(to_char(sysdate, 'yyyyMMddHH24MISSSSS')) between f.fromdate and f.todate and f.typetask=:type")
FdsPosSysTask findOneByMidOrTidAndCurrentTime(@Param("mid") String mid,@Param("tid") String tid, @Param("type") String type);
@Query("select f from FdsPosSysTask f where f.objecttask=:object and f.typetask=:type")
Iterable<FdsPosSysTask> findAllByObjectTask(@Param("object") String object, @Param("type") String type);
List<FdsPosSysTask> findAllByTypetask(String type);
// Dung cho exception case
// @Query("select f from FdsSysTask f where f.objecttask=:object and
// f.typetask=:type")
FdsPosSysTask findOneByObjecttaskAndTypetask(@Param("object") String object, @Param("type") String type);
@Query(value = "select to_number(to_char(SYSDATE, 'yyyyMMddHH24MISSSSS')) from dual", nativeQuery = true)
BigDecimal getCurrentTime();
@Query("select t from FdsPosSysTask t where not (:currentdate between t.fromdate and t.todate) and t.typetask=:type")
Iterable<FdsPosSysTask> findAllByTypeAndNotInCurrenttime(@Param("currentdate") BigDecimal currentdate, @Param("type") String type);
void deleteByUseridAndObjecttaskAndTypetask(@Param("userid") String userid, @Param("object") String object, @Param("type") String type);
void deleteByUseridAndTypetask(@Param("userid") String userid, @Param("type") String type);
void deleteByObjecttaskAndTypetask(@Param("object") String object, @Param("type") String type);
@Modifying
@Query("delete FdsPosSysTask t where (t.mid=:mid or t.tid=:tid) and t.typetask=:type")
void deleteByMidAndTidAndTypetask(@Param("mid") String mid, @Param("tid") String tid, @Param("type") String type);
@Query(value = "select USERID, CREATEDATE from {h-schema}FDS_POS_SYS_TASK where mid=:mid or tid=:tid", nativeQuery = true)
public List<Object[]> getUserUpdate(@Param("mid") String mid,@Param("tid") String tid);
@Query("select t from FdsPosSysTask t where (t.mid=:mid or t.tid=:tid) and t.typetask=:type")
FdsPosSysTask findOneByMidOrTidAndTypetask(@Param("mid") String mid,@Param("tid") String tid, @Param("type") String type);
}
| [
"vht1092@gmail.com"
] | vht1092@gmail.com |
47ab0dda14ebf155ef6d283def3f6f7833d6c25d | 82b113f9837298880ad999587a574f4777902256 | /jforum-tool/src/java/org/etudes/jforum/sso/LoginAuthenticator.java | 35f980615c7eb20275b76bfc1a097c3982332294 | [
"Apache-2.0"
] | permissive | etudes-inc/etudes-jforum | 12d13941e76b4a7483ded3e1cee08a411b66ba33 | 423d2ac371a0451fbb2ed9be693933a25225514e | refs/heads/master | 2020-06-16T11:28:42.617072 | 2017-06-15T00:43:15 | 2017-06-15T00:43:15 | 94,144,634 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,949 | java | /**********************************************************************************
* $URL: https://source.etudes.org/svn/apps/jforum/tags/2.27/jforum-tool/src/java/org/etudes/jforum/sso/LoginAuthenticator.java $
* $Id: LoginAuthenticator.java 3638 2012-12-02 21:33:06Z ggolden $
***********************************************************************************
*
* Copyright (c) 2008 Etudes, 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.
*
* Portions completed before July 1, 2004 Copyright (c) 2003, 2004 Rafael Steil, All rights reserved, licensed under the BSD license.
* http://www.opensource.org/licenses/bsd-license.php
*
* Redistribution and use in source and binary forms,
* with or without modification, are permitted provided
* that the following conditions are met:
*
* 1) Redistributions of source code must retain the above
* copyright notice, this list of conditions and the
* following disclaimer.
* 2) Redistributions in binary form must reproduce the
* above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or
* other materials provided with the distribution.
* 3) Neither the name of "Rafael Steil" nor
* the names of its contributors may be used to endorse
* or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
* HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
***********************************************************************************/
package org.etudes.jforum.sso;
import java.util.Map;
import org.etudes.jforum.dao.UserDAO;
import org.etudes.jforum.entities.User;
/**
* Validates user's credentials.
* Implementations of this interface are supposed
* to check for access rights in some "shared" environment,
* like calling some external procedure, consulting a different
* users table, reading from a XML file etc.. It is <b>not</b> SSO,
* since it still will be JForum that will call the validate login
* methods.
* <br>
* If you want SSO, please check {@link org.etudes.jforum.sso.SSO}
* @author Rafael Steil
*/
public interface LoginAuthenticator
{
/**
* Authenticates an user.
*
* @param username Username
* @param password Password
* @param extraParams Extra parameters, if any.
* @return An instance of a {@link org.etudes.jforum.entities.User} or <code>null</code>
* @throws Exception
*/
public User validateLogin(String username, String password, Map extraParams) throws Exception;
/**
* Sets the user model for the instance.
*
* @param userModel The user model to set
*/
public void setUserModel(UserDAO dao);
}
| [
"ggolden@etudes.org"
] | ggolden@etudes.org |
91300082421146948713030fe700eb2de68c0182 | 4c3030478340c4474340a0dec9f5340199284b5f | /java-tutorial-io/src/main/java/com/geekerstar/nio/socket/NIOClient.java | 071d8884fd649f5df848ea8f385a68c5fc7bfe8e | [] | no_license | jinguicheng-personal/java-tutorial | f48b5d8fa21c1f4a293929cc7019d43ca0b60118 | 5971344918aaf86f2697fc1b7ffb726d55292295 | refs/heads/master | 2023-07-03T23:48:07.339343 | 2021-08-14T09:47:26 | 2021-08-14T09:47:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,084 | java | package com.geekerstar.nio.socket;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.SocketChannel;
//网络客户端程序
public class NIOClient {
public static void main(String[] args) throws Exception {
//1. 得到一个网络通道
SocketChannel channel = SocketChannel.open();
//2. 设置非阻塞方式
channel.configureBlocking(false);
//3. 提供服务器端的IP地址和端口号
InetSocketAddress address = new InetSocketAddress("127.0.0.1", 9999);
//4. 连接服务器端
if (!channel.connect(address)) {
while (!channel.finishConnect()) { //nio作为非阻塞式的优势
System.out.println("Client:连接服务器端的同时,我还可以干别的一些事情");
}
}
//5. 得到一个缓冲区并存入数据
String msg = "hello,Server";
ByteBuffer writeBuf = ByteBuffer.wrap(msg.getBytes());
//6. 发送数据
channel.write(writeBuf);
System.in.read();
}
}
| [
"247507792@qq.com"
] | 247507792@qq.com |
51c2841e5ce755fae6b105f746a7a7e28867141b | 5e3235edf3de262f4d10b9e9e1fcc3bd13d6b8b1 | /Code Snippet Repository/Hibernate/Hibernate4809.java | 92352da8d4bf1b11102900269d15b6e1a0a3eb80 | [] | no_license | saber13812002/DeepCRM | 3336a244d4852a364800af3181e03e868cf6f9f5 | be3e5e50e34a042d5ba7259ff5ff75c08ab32bb9 | refs/heads/master | 2023-03-16T00:08:06.473699 | 2018-04-18T05:29:50 | 2018-04-18T05:29:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 488 | java | private NameSpaceTablesInformation processTableResults(ResultSet resultSet) throws SQLException {
try {
NameSpaceTablesInformation tables = new NameSpaceTablesInformation(identifierHelper());
while ( resultSet.next() ) {
final TableInformation tableInformation = extractTableInformation( resultSet );
tables.addTableInformation( tableInformation );
}
return tables;
}
finally {
try {
resultSet.close();
}
catch (SQLException ignore) {
}
}
}
| [
"Qing.Mi@my.cityu.edu.hk"
] | Qing.Mi@my.cityu.edu.hk |
9d3e2fa10f50df6db0c56ae6e0dd8201cd111f95 | 1385e2c2ea1f157cbbf2d9edde7a92df442e2092 | /service/src/com/yf/system/base/roomtype/RoomtypeComponent.java | 8f88932835552658b1969a7a83489728d815525f | [] | no_license | marc45/kzpw | 112b6dd7d5e9317fad343918c48767be32a3c9e3 | 19c11c2abe37125eb715e8b723df6e87fce7e10e | refs/heads/master | 2021-01-22T18:01:45.787156 | 2015-12-07T08:43:53 | 2015-12-07T08:43:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,762 | java | /**
* 版权所有, 允风文化
* Author: 允风文化 项目开发组
* copyright: 2012
*/
package com.yf.system.base.roomtype;
import java.sql.SQLException;
import java.util.*;
import com.yf.system.base.util.PageInfo;
public class RoomtypeComponent implements IRoomtypeComponent{
private IRoomtypeManager roomtypeManager;
public IRoomtypeManager getRoomtypeManager() {
return roomtypeManager;
}
public void setRoomtypeManager(IRoomtypeManager roomtypeManager) {
this.roomtypeManager = roomtypeManager;
}
/**
* 创建 酒店房型
* @param id
* @return deleted count
*/
public Roomtype createRoomtype(Roomtype roomtype) throws SQLException{
return roomtypeManager.createRoomtype(roomtype);
}
/**
* 删除 酒店房型
* @param id
* @return deleted count
*/
public int deleteRoomtype(long id){
return roomtypeManager.deleteRoomtype(id);
}
/**
* 修改 酒店房型
* @param id
* @return updated count
*/
public int updateRoomtype(Roomtype roomtype){
return roomtypeManager.updateRoomtype(roomtype);
}
/**
* 修改 酒店房型但忽略空值
* @param id
* @return
*/
public int updateRoomtypeIgnoreNull(Roomtype roomtype){
return roomtypeManager.updateRoomtypeIgnoreNull(roomtype);
}
/**
* 查找 酒店房型
* @param where
* @param orderby
* @param limit
* @param offset
* @return
*/
public List findAllRoomtype(String where, String orderby,int limit,int offset){
return roomtypeManager.findAllRoomtype(where, orderby,limit,offset);
}
/**
* 查找 酒店房型
* @param id
* @return
*/
public Roomtype findRoomtype(long id){
return roomtypeManager.findRoomtype(id);
}
/**
* 查找 酒店房型 by language
* @param id
* @return
*/
public Roomtype findRoomtypebylanguage(long id,Integer language){
return roomtypeManager.findRoomtypebylanguage(id,language);
}
/**
* 查找 酒店房型
* @param where
* @param orderby
* @param pageinfo
* @return
*/
public List findAllRoomtype(String where, String orderby,PageInfo pageinfo){
return roomtypeManager.findAllRoomtype(where, orderby,pageinfo);
}
/**
* 根据Sql查找酒店房型
* @param sql
* @param limit
* @param offset
* @return
*/
public List findAllRoomtype(String sql,int limit,int offset){
return roomtypeManager.findAllRoomtype(sql,limit,offset);
}
/**
* 执行Sql 酒店房型
* @param sql
* @return updated count
*/
public int excuteRoomtypeBySql(String sql){
return roomtypeManager.excuteRoomtypeBySql(sql);
}
/**
* 执行Sql
* @param sql
* @return count
*/
public int countRoomtypeBySql(String sql){
return roomtypeManager.countRoomtypeBySql(sql);
}
}
| [
"dogdog7788@qq.com"
] | dogdog7788@qq.com |
3f1e5e3460288c8511888e9ca1ad24a5b3638e40 | 1b71ed4fdea8ed7d1c29b3344de0cd118e967b53 | /tags/sagacity-sqltoy-4.1/src/main/java/org/sagacity/sqltoy/utils/SqlUtilsExt.java | a4a46d6bf68400fa5a6fa81be5b8e5909f4501eb | [
"Apache-2.0"
] | permissive | eidt/sagacity-sqltoy | 56d17924568786e5fa66a487faf9e17efa3dbd8d | 9fb3e56046e6afebda5d1622430e2e11792a7fff | refs/heads/master | 2020-04-25T08:13:19.105236 | 2019-02-25T13:52:33 | 2019-02-25T13:52:33 | 172,640,006 | 1 | 0 | Apache-2.0 | 2019-02-26T04:50:10 | 2019-02-26T04:50:09 | null | UTF-8 | Java | false | false | 6,842 | java | /**
*
*/
package org.sagacity.sqltoy.utils;
import java.io.IOException;
import java.math.BigDecimal;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Date;
import java.util.List;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.sagacity.sqltoy.config.model.EntityMeta;
/**
* @project sqltoy-orm
* @description 提供针对org.sagacity.sqltoy.utils.SqlUtil类的扩展(来自org.sagacity.core.
* utils.SqlUtil),提供更有针对性的操作,提升性能
* @author chenrenfei <a href="mailto:zhongxuchen@gmail.com">联系作者</a>
* @version id:SqlUtilsExt.java,Revision:v1.0,Date:2015年4月22日
*/
public class SqlUtilsExt {
/**
* 定义日志
*/
private final static Logger logger = LogManager.getLogger(SqlUtilsExt.class);
/**
* @todo 通过jdbc方式批量插入数据
* @param updateSql
* @param rowDatas
* @param batchSize
* @param insertCallhandler
* @param updateTypes
* @param autoCommit
* @param conn
* @throws Exception
*/
public static Long batchUpdateByJdbc(final String updateSql, final List<Object[]> rowDatas, final int batchSize,
final Integer[] updateTypes, final Boolean autoCommit, final Connection conn) throws Exception {
return batchUpdateByJdbc(updateSql, rowDatas, updateTypes, null, null, batchSize, autoCommit, conn);
}
/**
* @todo 通过jdbc方式批量插入数据,一般提供给数据采集时或插入临时表使用
* @param updateSql
* @param rowDatas
* @param batchSize
* @param entityMeta
* @param autoCommit
* @param conn
* @throws Exception
*/
public static Long batchUpdateByJdbc(final String updateSql, final List<Object[]> rowDatas, final int batchSize,
final EntityMeta entityMeta, final Boolean autoCommit, final Connection conn) throws Exception {
return batchUpdateByJdbc(updateSql, rowDatas, entityMeta.getFieldsTypeArray(),
entityMeta.getFieldsDefaultValue(), entityMeta.getFieldsNullable(), batchSize, autoCommit, conn);
}
/**
* @todo 通过jdbc方式批量插入数据,一般提供给数据采集时或插入临时表使用
* @param updateSql
* @param rowDatas
* @param fieldsType
* @param fieldsDefaultValue
* @param fieldsNullable
* @param batchSize
* @param autoCommit
* @param conn
* @throws Exception
*/
private static Long batchUpdateByJdbc(final String updateSql, final List<Object[]> rowDatas,
final Integer[] fieldsType, final String[] fieldsDefaultValue, final Boolean[] fieldsNullable,
final int batchSize, final Boolean autoCommit, final Connection conn) throws Exception {
if (rowDatas == null) {
logger.error("数据为空!");
return new Long(0);
}
long updateCount = 0;
PreparedStatement pst = null;
// 判断是否通过default转换方式插入
boolean supportDefaultValue = (fieldsDefaultValue != null && fieldsNullable != null) ? true : false;
try {
boolean hasSetAutoCommit = false;
// 是否自动提交
if (autoCommit != null && !autoCommit == conn.getAutoCommit()) {
conn.setAutoCommit(autoCommit);
hasSetAutoCommit = true;
}
pst = conn.prepareStatement(updateSql);
int totalRows = rowDatas.size();
boolean useBatch = (totalRows > 1) ? true : false;
Object[] rowData;
// 批处理计数器
int meter = 0;
for (int i = 0; i < totalRows; i++) {
rowData = rowDatas.get(i);
if (rowData != null) {
// 使用对象properties方式传值
for (int j = 0, n = rowData.length; j < n; j++) {
if (supportDefaultValue)
setParamValue(conn, pst, rowData[j], fieldsType[j], fieldsNullable[j],
fieldsDefaultValue[j], j + 1);
else
SqlUtil.setParamValue(conn, pst, rowData[j], fieldsType == null ? -1 : fieldsType[j],
j + 1);
}
meter++;
if (useBatch) {
pst.addBatch();
if ((meter % batchSize) == 0 || i + 1 == totalRows) {
int[] updateRows = pst.executeBatch();
for (int t : updateRows) {
updateCount = updateCount + ((t > 0) ? t : 0);
}
pst.clearBatch();
}
} else {
pst.execute();
updateCount = updateCount + ((pst.getUpdateCount() > 0) ? pst.getUpdateCount() : 0);
}
}
}
// updateCount = new Long(pst.getUpdateCount());
if (hasSetAutoCommit)
conn.setAutoCommit(!autoCommit);
} catch (Exception e) {
logger.error(e.getMessage(), e);
throw e;
} finally {
try {
if (pst != null) {
pst.close();
pst = null;
}
} catch (SQLException se) {
logger.error(se.getMessage(), se);
}
}
return updateCount;
}
/**
* @todo 自动进行类型转换,设置sql中的参数条件的值
* @param conn
* @param pst
* @param params
* @param entityMeta
* @throws SQLException
* @throws IOException
*/
public static void setParamsValue(Connection conn, PreparedStatement pst, Object[] params,
final EntityMeta entityMeta) throws SQLException, IOException {
if (null != params && params.length > 0) {
for (int i = 0, n = params.length; i < n; i++)
setParamValue(conn, pst, params[i], entityMeta.getFieldsTypeArray()[i],
entityMeta.getFieldsNullable()[i], entityMeta.getFieldsDefaultValue()[i], 1 + i);
}
}
/**
* @todo 提供针对默认值的转化
* @param conn
* @param pst
* @param paramValue
* @param jdbcType
* @param isNullable
* @param defaultValue
* @param paramIndex
* @throws SQLException
* @throws IOException
*/
public static void setParamValue(Connection conn, PreparedStatement pst, Object paramValue, int jdbcType,
boolean isNullable, String defaultValue, int paramIndex) throws SQLException, IOException {
Object realValue = paramValue;
// 当前值为null且默认值不为null、且字段不允许为null
if (realValue == null && defaultValue != null && !isNullable) {
if (jdbcType == java.sql.Types.DATE || jdbcType == java.sql.Types.TIME)
realValue = new Date();
else if (jdbcType == java.sql.Types.TIMESTAMP)
realValue = DateUtil.getTimestamp(null);
else if (jdbcType == java.sql.Types.INTEGER || jdbcType == java.sql.Types.BIGINT
|| jdbcType == java.sql.Types.TINYINT)
realValue = Integer.parseInt(defaultValue);
else if (jdbcType == java.sql.Types.DECIMAL || jdbcType == java.sql.Types.NUMERIC)
realValue = new BigDecimal(defaultValue);
else if (jdbcType == java.sql.Types.DOUBLE)
realValue = Double.valueOf(defaultValue);
else if (jdbcType == java.sql.Types.BOOLEAN)
realValue = Boolean.parseBoolean(defaultValue);
else if (jdbcType == java.sql.Types.FLOAT || jdbcType == java.sql.Types.REAL)
realValue = Float.valueOf(defaultValue);
else
realValue = defaultValue;
}
SqlUtil.setParamValue(conn, pst, realValue, jdbcType, paramIndex);
}
}
| [
"102309713@qq.com"
] | 102309713@qq.com |
bcac366249d02ac576084a2c1b6194c96d1de79c | 507dee0eb1451f060c21d414134068c9d942bc54 | /src/test/java/com/example/springflight/SpringFlightApplicationTests.java | 09e06a239924f1ed553b30b1c31754b9ffdc76a0 | [] | no_license | ABDUVOHID771/spring-flight | 6b18a608157c7b2debbafda29126821bf800cbd1 | 66fa27eac142e87b432c5c71c45ea41be2b79df4 | refs/heads/master | 2022-12-29T00:09:46.893211 | 2020-09-29T08:43:23 | 2020-09-29T08:43:23 | 299,556,243 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 231 | java | package com.example.springflight;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class SpringFlightApplicationTests {
@Test
void contextLoads() {
}
}
| [
"aristakrat31@gmail.com"
] | aristakrat31@gmail.com |
5c7909e7be51382170cf3b90aaced09c6da208a9 | dfef02cfa575b2c0f4cbccb0216f3fef9d2fe9d1 | /src/Notes/service/mapper/CarRfIdMapper.java | 294e4a1e20d1f662514344d69763f11ba2db78ce | [] | no_license | SaeidKazemi78/Complete-Spring-Security | a84943ea9f36e9557e7f52afdc2fce274b5e98c3 | d395c0e23a30a5a9fa51c07cb5a178b50bacfeb8 | refs/heads/master | 2022-12-14T10:08:31.629509 | 2020-09-14T05:34:44 | 2020-09-14T05:34:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 874 | java | package ir.donyapardaz.niopdc.base.service.mapper;
import ir.donyapardaz.niopdc.base.domain.*;
import ir.donyapardaz.niopdc.base.service.dto.CarRfIdDTO;
import org.mapstruct.*;
/**
* Mapper for the entity CarRfId and its DTO CarRfIdDTO.
*/
@Mapper(componentModel = "spring", uses = {CustomerMapper.class, TagRateMapper.class})
public interface CarRfIdMapper extends EntityMapper<CarRfIdDTO, CarRfId> {
@Mapping(source = "customer.id", target = "customerId")
@Mapping(source = "customer.name", target = "customerName")
CarRfIdDTO toDto(CarRfId carRfId);
@Mapping(source = "customerId", target = "customer")
CarRfId toEntity(CarRfIdDTO carRfIdDTO);
default CarRfId fromId(Long id) {
if (id == null) {
return null;
}
CarRfId carRfId = new CarRfId();
carRfId.setId(id);
return carRfId;
}
}
| [
"saeidkazemi78java@gmail.com"
] | saeidkazemi78java@gmail.com |
8cbd85f9988e2861628f30d9968a7bf5a41a76ed | 1c5e8605c1a4821bc2a759da670add762d0a94a2 | /easrc/pm/invite/AbstractEvaluationEntryUnitInfo.java | d2dc6a20faafa70a5821d1a9f4ba536b5d66bdb0 | [] | no_license | shxr/NJG | 8195cfebfbda1e000c30081399c5fbafc61bb7be | 1b60a4a7458da48991de4c2d04407c26ccf2f277 | refs/heads/master | 2020-12-24T06:51:18.392426 | 2016-04-25T03:09:27 | 2016-04-25T03:09:27 | 19,804,797 | 0 | 3 | null | null | null | null | GB18030 | Java | false | false | 1,276 | java | package com.kingdee.eas.port.pm.invite;
import java.io.Serializable;
import com.kingdee.bos.dao.AbstractObjectValue;
import java.util.Locale;
import com.kingdee.util.TypeConversionUtils;
import com.kingdee.bos.util.BOSObjectType;
public class AbstractEvaluationEntryUnitInfo extends com.kingdee.eas.framework.CoreBillEntryBaseInfo implements Serializable
{
public AbstractEvaluationEntryUnitInfo()
{
this("id");
}
protected AbstractEvaluationEntryUnitInfo(String pkField)
{
super(pkField);
}
/**
* Object: 投标单位分录 's null property
*/
public com.kingdee.eas.port.pm.invite.EvaluationInfo getParent()
{
return (com.kingdee.eas.port.pm.invite.EvaluationInfo)get("parent");
}
public void setParent(com.kingdee.eas.port.pm.invite.EvaluationInfo item)
{
put("parent", item);
}
/**
* Object:投标单位分录's 投标单位property
*/
public String getEnterprise()
{
return getString("enterprise");
}
public void setEnterprise(String item)
{
setString("enterprise", item);
}
public BOSObjectType getBOSType()
{
return new BOSObjectType("9A132151");
}
} | [
"shxr_code@126.com"
] | shxr_code@126.com |
bee3991f6a1b6b2f4724d14c4bc96b37f248d5fe | 1863ee75435d9f0daff33ed61051415a7dcd9189 | /graphene-parent/graphene-dao/src/main/java/graphene/dao/DAOModule.java | d0eebc26192f128e95fb7b5df179e346401f98a5 | [
"Apache-2.0"
] | permissive | FrictionlessCoin/graphene | ef7862d3aa06cfce914fa0e09dd60e935ce2c9d0 | e1cda420e45aa4b8109cee3c73f5c4ba0b9a23f7 | refs/heads/master | 2021-01-16T18:54:27.687219 | 2015-02-16T18:07:59 | 2015-02-16T18:07:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,221 | java | package graphene.dao;
import graphene.model.idl.G_CanonicalPropertyType;
import graphene.model.idl.G_CanonicalRelationshipType;
import graphene.model.idl.G_EdgeType;
import graphene.model.idl.G_EdgeTypeAccess;
import graphene.model.idl.G_IdType;
import graphene.model.idl.G_NodeTypeAccess;
import graphene.model.idl.G_PropertyKey;
import graphene.model.idl.G_PropertyKeyTypeAccess;
import graphene.model.idl.G_SymbolConstants;
import graphene.model.idl.G_UserDataAccess;
import graphene.services.EventServerImpl;
import graphene.services.FederatedEventGraphImpl;
import graphene.services.FederatedPropertyGraphImpl;
import graphene.services.G_EdgeTypeAccessImpl;
import graphene.services.G_NodeTypeAccessImpl;
import graphene.services.G_PropertyKeyTypeAccessImpl;
import graphene.services.UserServiceImpl;
import org.apache.tapestry5.ioc.MappedConfiguration;
import org.apache.tapestry5.ioc.ServiceBinder;
import org.apache.tapestry5.ioc.annotations.Contribute;
/**
* While this DAO Module is mostly for sharing the interface definitions (and
* hence very closely tied to the core model module), this is also a reasonable
* place to bind the business logic services that sit on top of the DAOs (which
* are wired later)
*
* @author djue
*
*/
public class DAOModule {
public static void bind(final ServiceBinder binder) {
binder.bind(G_UserDataAccess.class, UserServiceImpl.class).eagerLoad();
binder.bind(EventServer.class, EventServerImpl.class);
binder.bind(FederatedPropertyGraphServer.class, FederatedPropertyGraphImpl.class);
binder.bind(FederatedEventGraphServer.class, FederatedEventGraphImpl.class);
binder.bind(G_NodeTypeAccess.class, G_NodeTypeAccessImpl.class);
binder.bind(G_EdgeTypeAccess.class, G_EdgeTypeAccessImpl.class);
binder.bind(G_PropertyKeyTypeAccess.class, G_PropertyKeyTypeAccessImpl.class);
}
public static void contributeApplicationDefaults(final MappedConfiguration<String, Object> configuration) {
configuration.add(G_SymbolConstants.ENABLE_DELETE_USERS, true);
configuration.add(G_SymbolConstants.ENABLE_DELETE_GROUPS, true);
configuration.add(G_SymbolConstants.ENABLE_WORKSPACES, true);
configuration.add(G_SymbolConstants.ENABLE_DELETE_WORKSPACES, true);
configuration.add(G_SymbolConstants.ENABLE_DELETE_UNUSED_WORKSPACES, true);
configuration.add(G_SymbolConstants.ENABLE_DELETE_ROLES, false);
configuration.add(G_SymbolConstants.ENABLE_DELETE_USER_GROUP, true);
configuration.add(G_SymbolConstants.ENABLE_DELETE_USER_WORKSPACES, true);
configuration.add(G_SymbolConstants.ENABLE_DELETE_USER_ROLE, true);
configuration.add(G_SymbolConstants.ENABLE_DELETE_LOGS, false);
configuration.add(G_SymbolConstants.ENABLE_DELETE_DATASOURCES, false);
configuration.add(G_SymbolConstants.DEFAULT_ADMIN_GROUP_NAME, "Admins");
configuration.add(G_SymbolConstants.DEFAULT_ADMIN_ACCOUNT, "admin");
configuration.add(G_SymbolConstants.DEFAULT_ADMIN_EMAIL, "admin@mycompany.com");
configuration.add(G_SymbolConstants.DEFAULT_ADMIN_PASSWORD, "password123");
}
@Contribute(G_EdgeTypeAccess.class)
public static void contributeEdgeTypes(final MappedConfiguration<String, G_EdgeType> configuration) {
for (final G_CanonicalRelationshipType e : G_CanonicalRelationshipType.values()) {
final G_EdgeType n = new G_EdgeType(e.name(), e.name(), e.toString(), (long) e.ordinal());
configuration.add(e.name(), n);
}
}
@Contribute(G_NodeTypeAccess.class)
public static void contributeNodeTypes(final MappedConfiguration<String, G_IdType> configuration) {
long i = 0;
for (final G_CanonicalPropertyType e : G_CanonicalPropertyType.values()) {
// XXX:Fix me
final G_IdType n = G_IdType.newBuilder().setName(e.name()).setIndex(i).setShortName(e.name())
.setFriendlyName(e.name()).setTableSource("MyTable").build();
i++;
configuration.add(e.name(), n);
}
}
@Contribute(G_PropertyKeyTypeAccess.class)
public static void contributePropertyKeys(final MappedConfiguration<String, G_PropertyKey> configuration) {
for (final G_CanonicalPropertyType e : G_CanonicalPropertyType.values()) {
final G_PropertyKey n = new G_PropertyKey(e.name(), e.name(), e.name(), 0l);
configuration.add(e.name(), n);
}
}
}
| [
"djue@phy6.net"
] | djue@phy6.net |
5ecbdc3353c4850f71ae12ca93523d129a6c65b5 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/17/17_5f79d9193489cc617b405a000fdd9f268651715c/CustomConverters/17_5f79d9193489cc617b405a000fdd9f268651715c_CustomConverters_t.java | 1f55970ff6a09eae3eec52900159ba6e1c1e620d | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 1,314 | java | package org.vamdc.portal.session.queryBuilder.unitConv;
import java.io.Serializable;
/**
* Custom simple converters, used both in in-field unit conversions and inter-field conversions
*
*
*/
@SuppressWarnings("serial")
public class CustomConverters implements Serializable{
private final static Double C = 2.99792458e5;
class DirectConverter implements Converter{
public Double convert(Double value) { return value; }
}
public static DirectConverter Direct(){ return new CustomConverters().new DirectConverter(); }
class EVToWnConverter implements Converter{
public Double convert(Double value) { return 8065.54429*value; }
}
public static EVToWnConverter EVToWn(){ return new CustomConverters().new EVToWnConverter(); }
class RydToWnConverter implements Converter{
public Double convert(Double value) { return 109737.31568539*value; }
}
public static RydToWnConverter RydToWn(){ return new CustomConverters().new RydToWnConverter(); }
class FreqToWavenumberConverter implements Converter{
public Double convert(Double value) {
if (value!=null && value!=0)
return C*1e7/value;
else return Double.NaN;
}
}
public static FreqToWavenumberConverter MHzToWn(){ return new CustomConverters().new FreqToWavenumberConverter(); }
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
3709bef39d1a99b26d5c776487bf300c051d9d52 | 4edce2a17e0c0800cdfeaa4b111e0c2fbea4563b | /net/minecraft/src/EntityAITarget.java | eef9819e33bd6ec4d726451368a6eef83e16e0a3 | [] | no_license | zaices/minecraft | da9b99abd99ac56e787eef1b6fecbd06b2d4cd51 | 4a99d8295e7ce939663e90ba8f1899c491545cde | refs/heads/master | 2021-01-10T20:20:38.388578 | 2013-10-06T00:16:11 | 2013-10-06T00:18:48 | 13,142,359 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,757 | java | package net.minecraft.src;
public abstract class EntityAITarget extends EntityAIBase
{
/** The entity that this task belongs to */
protected EntityCreature taskOwner;
/**
* If true, EntityAI targets must be able to be seen (cannot be blocked by walls) to be suitable targets.
*/
protected boolean shouldCheckSight;
private boolean field_75303_a;
private int field_75301_b;
private int field_75302_c;
private int field_75298_g;
public EntityAITarget(EntityCreature par1EntityCreature, boolean par2)
{
this(par1EntityCreature, par2, false);
}
public EntityAITarget(EntityCreature par1EntityCreature, boolean par2, boolean par3)
{
this.taskOwner = par1EntityCreature;
this.shouldCheckSight = par2;
this.field_75303_a = par3;
}
/**
* Returns whether an in-progress EntityAIBase should continue executing
*/
public boolean continueExecuting()
{
EntityLivingBase var1 = this.taskOwner.getAttackTarget();
if (var1 == null)
{
return false;
}
else if (!var1.isEntityAlive())
{
return false;
}
else
{
double var2 = this.func_111175_f();
if (this.taskOwner.getDistanceSqToEntity(var1) > var2 * var2)
{
return false;
}
else
{
if (this.shouldCheckSight)
{
if (this.taskOwner.getEntitySenses().canSee(var1))
{
this.field_75298_g = 0;
}
else if (++this.field_75298_g > 60)
{
return false;
}
}
return true;
}
}
}
protected double func_111175_f()
{
AttributeInstance var1 = this.taskOwner.func_110148_a(SharedMonsterAttributes.field_111265_b);
return var1 == null ? 16.0D : var1.func_111126_e();
}
/**
* Execute a one shot task or start executing a continuous task
*/
public void startExecuting()
{
this.field_75301_b = 0;
this.field_75302_c = 0;
this.field_75298_g = 0;
}
/**
* Resets the task
*/
public void resetTask()
{
this.taskOwner.setAttackTarget((EntityLivingBase)null);
}
/**
* A method used to see if an entity is a suitable target through a number of checks.
*/
protected boolean isSuitableTarget(EntityLivingBase par1EntityLivingBase, boolean par2)
{
if (par1EntityLivingBase == null)
{
return false;
}
else if (par1EntityLivingBase == this.taskOwner)
{
return false;
}
else if (!par1EntityLivingBase.isEntityAlive())
{
return false;
}
else if (!this.taskOwner.canAttackClass(par1EntityLivingBase.getClass()))
{
return false;
}
else
{
if (this.taskOwner instanceof EntityOwnable && org.apache.commons.lang3.StringUtils.isNotEmpty(((EntityOwnable)this.taskOwner).getOwnerName()))
{
if (par1EntityLivingBase instanceof EntityOwnable && ((EntityOwnable)this.taskOwner).getOwnerName().equals(((EntityOwnable)par1EntityLivingBase).getOwnerName()))
{
return false;
}
if (par1EntityLivingBase == ((EntityOwnable)this.taskOwner).getOwner())
{
return false;
}
}
else if (par1EntityLivingBase instanceof EntityPlayer && !par2 && ((EntityPlayer)par1EntityLivingBase).capabilities.disableDamage)
{
return false;
}
if (!this.taskOwner.func_110176_b(MathHelper.floor_double(par1EntityLivingBase.posX), MathHelper.floor_double(par1EntityLivingBase.posY), MathHelper.floor_double(par1EntityLivingBase.posZ)))
{
return false;
}
else if (this.shouldCheckSight && !this.taskOwner.getEntitySenses().canSee(par1EntityLivingBase))
{
return false;
}
else
{
if (this.field_75303_a)
{
if (--this.field_75302_c <= 0)
{
this.field_75301_b = 0;
}
if (this.field_75301_b == 0)
{
this.field_75301_b = this.func_75295_a(par1EntityLivingBase) ? 1 : 2;
}
if (this.field_75301_b == 2)
{
return false;
}
}
return true;
}
}
}
private boolean func_75295_a(EntityLivingBase par1EntityLivingBase)
{
this.field_75302_c = 10 + this.taskOwner.getRNG().nextInt(5);
PathEntity var2 = this.taskOwner.getNavigator().getPathToEntityLiving(par1EntityLivingBase);
if (var2 == null)
{
return false;
}
else
{
PathPoint var3 = var2.getFinalPathPoint();
if (var3 == null)
{
return false;
}
else
{
int var4 = var3.xCoord - MathHelper.floor_double(par1EntityLivingBase.posX);
int var5 = var3.zCoord - MathHelper.floor_double(par1EntityLivingBase.posZ);
return (double)(var4 * var4 + var5 * var5) <= 2.25D;
}
}
}
}
| [
"chlumanog@gmail.com"
] | chlumanog@gmail.com |
5da39a8f63f5065f612b2c1a6742fba53932c9a2 | 0f46f26cf85f09b9e32fd3ac9ed4ca2a8af36623 | /app/src/main/java/com/lh/imbilibili/view/adapter/videodetail/RelatesVideoItemDecoration.java | 82a3ae4887eee4a50b60fcb5ef1d0f5aa319f190 | [] | no_license | zhaozw/IMBiliBili | e6673135ecce1be6dbbe88efe3907fb68b45d745 | aef5697c5d361b0825d3d5d1708598ae8bc424c0 | refs/heads/master | 2021-01-23T04:53:10.034792 | 2017-01-24T14:20:35 | 2017-01-24T14:20:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,081 | java | package com.lh.imbilibili.view.adapter.videodetail;
import android.content.Context;
import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import com.lh.imbilibili.R;
/**
* Created by liuhui on 2016/10/2.
*/
public class RelatesVideoItemDecoration extends RecyclerView.ItemDecoration {
private int itemHalfSpace;
private int itemSpace;
public RelatesVideoItemDecoration(Context context) {
itemHalfSpace = context.getResources().getDimensionPixelSize(R.dimen.item_half_spacing);
itemSpace = itemHalfSpace * 2;
}
@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
RecyclerView.ViewHolder viewHolder = parent.getChildViewHolder(view);
outRect.left = itemSpace;
outRect.right = itemSpace;
if (viewHolder.getAdapterPosition() == 0) {
outRect.bottom = itemHalfSpace;
} else {
outRect.top = itemHalfSpace;
outRect.bottom = itemHalfSpace;
}
}
}
| [
"1585086582@qq.com"
] | 1585086582@qq.com |
ed77d5f1d1836810529daac45f2ae9ab108ace8a | ce925df317f55749c304df230c9253f739f0ec52 | /EMF2LINDA/src-gen/javaMM/NullLiteral.java | 720d655904fef06d265076b58b0025222c0af60c | [] | no_license | amlozano/LinTra | fdd12c387d72de133000d59245b8c4b87f404e4e | f0a6d99d6161179bd11645bf52d496019170a3ce | refs/heads/master | 2021-01-24T03:57:55.126289 | 2015-03-03T16:10:50 | 2015-03-03T16:10:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 516 | java | package javaMM;
import java.io.Serializable;
public class NullLiteral extends Expression implements Serializable {
private static final long serialVersionUID = 1L;
String id;
public NullLiteral() {
}
public NullLiteral(String id, String[] commentsID,
String originalCompilationUnitID, String originalClassFileID) {
super(commentsID, originalCompilationUnitID, originalClassFileID);
this.id = id;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}
| [
"loli@lcc.uma.es"
] | loli@lcc.uma.es |
b6095d33621d4d3a5f6ee8d533009da5f2e5cfc7 | 1896b305a64899d8a89c260c8624519062cfe515 | /src/main/java/ru/betterend/world/features/trees/TenaneaFeature.java | 34de3b30cc6b1906ae341d1a1033ac9921bd6e4d | [
"MIT"
] | permissive | zorc/BetterEnd | 66c2e67c86b82bcabbe32e00741cfddbad6058df | bea2bef853f3ef56b79d1d763f94ffb1f8b9cf05 | refs/heads/master | 2023-02-25T00:38:11.328300 | 2021-02-01T03:20:24 | 2021-02-01T03:20:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,673 | java | package ru.betterend.world.features.trees;
import java.util.List;
import java.util.Random;
import java.util.function.Function;
import com.google.common.collect.Lists;
import net.minecraft.block.BlockState;
import net.minecraft.block.LeavesBlock;
import net.minecraft.block.Material;
import net.minecraft.client.util.math.Vector3f;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockPos.Mutable;
import net.minecraft.util.math.Direction;
import net.minecraft.world.StructureWorldAccess;
import net.minecraft.world.gen.chunk.ChunkGenerator;
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
import ru.betterend.blocks.BlockProperties;
import ru.betterend.blocks.BlockProperties.TripleShape;
import ru.betterend.blocks.basis.FurBlock;
import ru.betterend.noise.OpenSimplexNoise;
import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndTags;
import ru.betterend.util.BlocksHelper;
import ru.betterend.util.MHelper;
import ru.betterend.util.SplineHelper;
import ru.betterend.util.sdf.SDF;
import ru.betterend.util.sdf.operator.SDFDisplacement;
import ru.betterend.util.sdf.operator.SDFScale;
import ru.betterend.util.sdf.operator.SDFScale3D;
import ru.betterend.util.sdf.operator.SDFSubtraction;
import ru.betterend.util.sdf.operator.SDFTranslate;
import ru.betterend.util.sdf.primitive.SDFSphere;
import ru.betterend.world.features.DefaultFeature;
public class TenaneaFeature extends DefaultFeature {
private static final Function<BlockState, Boolean> REPLACE;
private static final Function<BlockState, Boolean> IGNORE;
private static final List<Vector3f> SPLINE;
private static final Direction[] DIRECTIONS = Direction.values();
@Override
public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random random, BlockPos pos, DefaultFeatureConfig config) {
if (!world.getBlockState(pos.down()).getBlock().isIn(EndTags.END_GROUND)) return false;
float size = MHelper.randRange(7, 10, random);
int count = (int) (size * 0.45F);
float var = MHelper.PI2 / (float) (count * 3);
float start = MHelper.randRange(0, MHelper.PI2, random);
for (int i = 0; i < count; i++) {
float angle = (float) i / (float) count * MHelper.PI2 + MHelper.randRange(0, var, random) + start;
List<Vector3f> spline = SplineHelper.copySpline(SPLINE);
SplineHelper.rotateSpline(spline, angle);
SplineHelper.scale(spline, size + MHelper.randRange(0, size * 0.5F, random));
SplineHelper.offsetParts(spline, random, 1F, 0, 1F);
SplineHelper.fillSpline(spline, world, EndBlocks.TENANEA.bark.getDefaultState(), pos, REPLACE);
Vector3f last = spline.get(spline.size() - 1);
float leavesRadius = (size * 0.3F + MHelper.randRange(0.8F, 1.5F, random)) * 1.4F;
OpenSimplexNoise noise = new OpenSimplexNoise(random.nextLong());
leavesBall(world, pos.add(last.getX(), last.getY(), last.getZ()), leavesRadius, random, noise);
}
return true;
}
private void leavesBall(StructureWorldAccess world, BlockPos pos, float radius, Random random, OpenSimplexNoise noise) {
SDF sphere = new SDFSphere().setRadius(radius).setBlock(EndBlocks.TENANEA_LEAVES.getDefaultState().with(LeavesBlock.DISTANCE, 6));
SDF sub = new SDFScale().setScale(5).setSource(sphere);
sub = new SDFTranslate().setTranslate(0, -radius * 5, 0).setSource(sub);
sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(sub);
sphere = new SDFScale3D().setScale(1, 0.75F, 1).setSource(sphere);
sphere = new SDFDisplacement().setFunction((vec) -> { return (float) noise.eval(vec.getX() * 0.2, vec.getY() * 0.2, vec.getZ() * 0.2) * 2F; }).setSource(sphere);
sphere = new SDFDisplacement().setFunction((vec) -> { return MHelper.randRange(-1.5F, 1.5F, random); }).setSource(sphere);
Mutable mut = new Mutable();
for (Direction d1: BlocksHelper.HORIZONTAL) {
BlockPos p = mut.set(pos).move(Direction.UP).move(d1).toImmutable();
BlocksHelper.setWithoutUpdate(world, p, EndBlocks.TENANEA.bark.getDefaultState());
for (Direction d2: BlocksHelper.HORIZONTAL) {
mut.set(p).move(Direction.UP).move(d2);
BlocksHelper.setWithoutUpdate(world, p, EndBlocks.TENANEA.bark.getDefaultState());
}
}
BlockState top = EndBlocks.TENANEA_FLOWERS.getDefaultState().with(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP);
BlockState middle = EndBlocks.TENANEA_FLOWERS.getDefaultState().with(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE);
BlockState bottom = EndBlocks.TENANEA_FLOWERS.getDefaultState().with(BlockProperties.TRIPLE_SHAPE, TripleShape.BOTTOM);
BlockState outer = EndBlocks.TENANEA_OUTER_LEAVES.getDefaultState();
List<BlockPos> support = Lists.newArrayList();
sphere.addPostProcess((info) -> {
if (random.nextInt(6) == 0 && info.getStateDown().isAir()) {
BlockPos d = info.getPos().down();
support.add(d);
}
if (random.nextInt(5) == 0) {
for (Direction dir: Direction.values()) {
BlockState state = info.getState(dir, 2);
if (state.isAir()) {
return info.getState();
}
}
info.setState(EndBlocks.TENANEA.bark.getDefaultState());
}
MHelper.shuffle(DIRECTIONS, random);
for (Direction d: DIRECTIONS) {
if (info.getState(d).isAir()) {
info.setBlockPos(info.getPos().offset(d), outer.with(FurBlock.FACING, d));
}
}
if (EndBlocks.TENANEA.isTreeLog(info.getState())) {
for (int x = -6; x < 7; x++) {
int ax = Math.abs(x);
mut.setX(x + info.getPos().getX());
for (int z = -6; z < 7; z++) {
int az = Math.abs(z);
mut.setZ(z + info.getPos().getZ());
for (int y = -6; y < 7; y++) {
int ay = Math.abs(y);
int d = ax + ay + az;
if (d < 7) {
mut.setY(y + info.getPos().getY());
BlockState state = info.getState(mut);
if (state.getBlock() instanceof LeavesBlock) {
int distance = state.get(LeavesBlock.DISTANCE);
if (d < distance) {
info.setState(mut, state.with(LeavesBlock.DISTANCE, d));
}
}
}
}
}
}
}
return info.getState();
});
sphere.fillRecursiveIgnore(world, pos, IGNORE);
BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.TENANEA.bark);
support.forEach((bpos) -> {
BlockState state = world.getBlockState(bpos);
if (state.isAir() || state.isOf(EndBlocks.TENANEA_OUTER_LEAVES)) {
int count = MHelper.randRange(3, 8, random);
mut.set(bpos);
if (world.getBlockState(mut.up()).isOf(EndBlocks.TENANEA_LEAVES)) {
BlocksHelper.setWithoutUpdate(world, mut, top);
for (int i = 1; i < count; i++) {
mut.setY(mut.getY() - 1);
if (world.isAir(mut.down())) {
BlocksHelper.setWithoutUpdate(world, mut, middle);
}
else {
break;
}
}
BlocksHelper.setWithoutUpdate(world, mut, bottom);
}
}
});
}
static {
REPLACE = (state) -> {
if (state.isIn(EndTags.END_GROUND)) {
return true;
}
if (state.getBlock() == EndBlocks.TENANEA_LEAVES) {
return true;
}
if (state.getMaterial().equals(Material.PLANT)) {
return true;
}
return state.getMaterial().isReplaceable();
};
IGNORE = (state) -> {
return EndBlocks.TENANEA.isTreeLog(state);
};
SPLINE = Lists.newArrayList(
new Vector3f(0.00F, 0.00F, 0.00F),
new Vector3f(0.10F, 0.35F, 0.00F),
new Vector3f(0.20F, 0.50F, 0.00F),
new Vector3f(0.30F, 0.55F, 0.00F),
new Vector3f(0.42F, 0.70F, 0.00F),
new Vector3f(0.50F, 1.00F, 0.00F)
);
}
}
| [
"paulevs@yandex.ru"
] | paulevs@yandex.ru |
76b8d993ec9c1a3c8fab24f480e183788ca23ed4 | 0bf514ecc627ac3f412b57362dba72c06b206329 | /bitcamp-java-project-server/src/main/java/com/eomcs/pms/handler/TaskUpdateCommand.java | 9277899f53bbfb22448b551d0933e96dbfc7bed9 | [] | no_license | cchoijjinyoung/bitcamp-workspace-1 | e38fea7f59a6cab81d4a9329a091cc3986a469f3 | b06e7102022c2558c4976819aac0551f6f5fa24d | refs/heads/master | 2022-12-30T21:42:11.124405 | 2020-10-23T05:35:47 | 2020-10-23T05:35:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,639 | java | package com.eomcs.pms.handler;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.sql.Date;
import java.util.List;
import com.eomcs.pms.domain.Task;
import com.eomcs.util.Prompt;
public class TaskUpdateCommand implements Command {
List<Task> taskList;
MemberListCommand memberListCommand;
public TaskUpdateCommand(List<Task> list, MemberListCommand memberListCommand) {
this.taskList = list;
this.memberListCommand = memberListCommand;
}
@Override
public void execute(PrintWriter out, BufferedReader in) {
try {
out.println("[작업 변경]");
int no = Prompt.inputInt("번호? ", out, in);
Task task = findByNo(no);
if (task == null) {
out.println("해당 번호의 작업이 없습니다.");
return;
}
String content = Prompt.inputString(
String.format("내용(%s)? ", task.getContent()), out, in);
Date deadline = Prompt.inputDate(
String.format("마감일(%s)? ", task.getDeadline()), out, in);
String stateLabel = null;
switch (task.getStatus()) {
case 1:
stateLabel = "진행중";
break;
case 2:
stateLabel = "완료";
break;
default:
stateLabel = "신규";
}
int status = Prompt.inputInt(
String.format("상태(%s)?\n0: 신규\n1: 진행중\n2: 완료\n> ", stateLabel), out, in);
String owner = null;
while (true) {
String name = Prompt.inputString(
String.format("담당자(%s)?(취소: 빈 문자열) ", task.getOwner()), out, in);
if (name.length() == 0) {
out.println("작업 등록을 취소합니다.");
return;
} else if (memberListCommand.findByName(name) != null) {
owner = name;
break;
}
out.println("등록된 회원이 아닙니다.");
}
String response = Prompt.inputString("정말 변경하시겠습니까?(y/N) ", out, in);
if (!response.equalsIgnoreCase("y")) {
out.println("작업 변경을 취소하였습니다.");
return;
}
task.setContent(content);
task.setDeadline(deadline);
task.setStatus(status);
task.setOwner(owner);
out.println("작업을 변경하였습니다.");
} catch (Exception e) {
out.printf("작업 처리중 오류 발생 - %s\n", e.getMessage());
}
}
private Task findByNo(int no) {
for (int i = 0; i < taskList.size(); i++) {
Task task = taskList.get(i);
if (task.getNo() == no) {
return task;
}
}
return null;
}
}
| [
"rotid1818@gmail.com"
] | rotid1818@gmail.com |
8abbb2e0b20cf00bafb6a38d6bc5f9d898610d81 | 4211de541ec4863b0666c3b58f0ae73500073e8f | /src/main/java/io/github/ghacupha/keeper/book/base/EntryDetails.java | 7b49b769af7c3ed51bff27299ba3300003130c84 | [
"Apache-2.0"
] | permissive | ghacupha/book-keeper | f3dbb770ac2b39025bd528de3000f98ebb880b96 | fd075d3053b9507a1b4d255e4b6d888d9957104f | refs/heads/master | 2023-08-09T03:49:33.921958 | 2023-07-25T07:42:08 | 2023-07-25T07:42:08 | 125,531,122 | 12 | 7 | Apache-2.0 | 2023-07-25T06:28:01 | 2018-03-16T14:57:58 | Java | UTF-8 | Java | false | false | 2,497 | java | /*
* Copyright © 2018 Edwin Njeru (mailnjeru@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 io.github.ghacupha.keeper.book.base;
import io.github.ghacupha.keeper.book.util.UnEnteredDetailsException;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
public final class EntryDetails {
private final String narration;
private final Map<String,Object> entryMap = new ConcurrentHashMap<>();
public EntryDetails(String narration) {
this.narration = narration;
}
public static EntryDetails details(String narration){
return new EntryDetails(narration);
}
public String getNarration() {
return narration;
}
public Map<String, Object> getEntryMap() {
return entryMap;
}
public void setAttribute(String label, Object attribute){
entryMap.put(label,attribute);
}
public Object getAttribute(String label) throws UnEnteredDetailsException {
if(!entryMap.containsKey(label)){
throw new UnEnteredDetailsException(String.format("Could not find %s since it was never added in the first place",label));
} else {
return entryMap.get(label);
}
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
EntryDetails that = (EntryDetails) o;
return Objects.equals(narration, that.narration) && Objects.equals(entryMap, that.entryMap);
}
@Override
public int hashCode() {
return Objects.hash(narration, entryMap);
}
@Override
public String toString() {
final StringBuffer sb = new StringBuffer("{");
sb.append("'").append(narration).append('\'');
sb.append(", otherEntryDetails=").append(entryMap);
sb.append('}');
return sb.toString();
}
}
| [
"mailnjeru@gmail.com"
] | mailnjeru@gmail.com |
95d70c9a276db671eef013d8ec1016939187333d | 6baf1fe00541560788e78de5244ae17a7a2b375a | /hollywood/com.oculus.browser-base/sources/defpackage/View$OnClickListenerC1153Sx0.java | 388340ce55210ab19bc159d43ee5822bcdaa458d | [] | no_license | phwd/quest-tracker | 286e605644fc05f00f4904e51f73d77444a78003 | 3d46fbb467ba11bee5827f7cae7dfeabeb1fd2ba | refs/heads/main | 2023-03-29T20:33:10.959529 | 2021-04-10T22:14:11 | 2021-04-10T22:14:11 | 357,185,040 | 4 | 2 | null | 2021-04-12T12:28:09 | 2021-04-12T12:28:08 | null | UTF-8 | Java | false | false | 609 | java | package defpackage;
import android.view.View;
import org.chromium.chrome.browser.password_manager.settings.PasswordEntryEditor;
/* renamed from: Sx0 reason: default package and case insensitive filesystem */
/* compiled from: chromium-OculusBrowser.apk-stable-281887347 */
public final /* synthetic */ class View$OnClickListenerC1153Sx0 implements View.OnClickListener {
public final PasswordEntryEditor F;
public View$OnClickListenerC1153Sx0(PasswordEntryEditor passwordEntryEditor) {
this.F = passwordEntryEditor;
}
public void onClick(View view) {
this.F.f1();
}
}
| [
"cyuubiapps@gmail.com"
] | cyuubiapps@gmail.com |
2c687e4fe1dd25fb97d4f43b070d56bb7be2d7f8 | 54c2ba8bcede572abae27886fe7a599215030924 | /src/main/java/com/jd/open/api/sdk/request/JdUploadRequest.java | 9c2b7d0675bcaf2a69da0cb5e0b12f45bc5bcc8e | [] | no_license | pingjiang/jd-open-api-sdk-src | 4c8bcc1e139657c0b6512126e9408cc71873ee30 | 0d82d3a14fb7f931a4a1e25dc18fb2f1cfaadd81 | refs/heads/master | 2021-01-01T17:57:04.734329 | 2014-06-26T03:49:36 | 2014-06-26T03:49:36 | 21,227,086 | 17 | 15 | null | null | null | null | UTF-8 | Java | false | false | 448 | java | // Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3)
// Source File Name: JdUploadRequest.java
package com.jd.open.api.sdk.request;
import java.util.Map;
// Referenced classes of package com.jd.open.api.sdk.request:
// JdRequest
public interface JdUploadRequest
extends JdRequest {
public abstract Map getFileParams();
}
| [
"pingjiang1989@gmail.com"
] | pingjiang1989@gmail.com |
671d1f3afcd169c4fadc0f814a4472da18635b72 | ed3cb95dcc590e98d09117ea0b4768df18e8f99e | /project_1_3/src/b/b/b/c/Calc_1_3_11123.java | 9ee624baceff17239b30a809fbfb73e7364737a4 | [] | no_license | chalstrick/bigRepo1 | ac7fd5785d475b3c38f1328e370ba9a85a751cff | dad1852eef66fcec200df10083959c674fdcc55d | refs/heads/master | 2016-08-11T17:59:16.079541 | 2015-12-18T14:26:49 | 2015-12-18T14:26:49 | 48,244,030 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 134 | java | package b.b.b.c;
public class Calc_1_3_11123 {
/** @return the sum of a and b */
public int add(int a, int b) {
return a+b;
}
}
| [
"christian.halstrick@sap.com"
] | christian.halstrick@sap.com |
14e5f38a6da3533f517c601e3597f66ee0cc3c5f | 6febf051797cac1700beb84bf874f59f47666f42 | /src/base/RequestTask.java | eac66991237f3c612ba03076bf90a8598f0f2e75 | [
"MIT",
"LicenseRef-scancode-free-unknown"
] | permissive | bbhunter/knife | e065d22fefcde7952bac5d92aae753bbf7fd6916 | 225fbf9f6a23e7d0409f6446dbce7518126c3df6 | refs/heads/master | 2023-08-03T04:03:48.926990 | 2023-08-02T03:11:35 | 2023-08-02T03:11:35 | 199,181,159 | 0 | 0 | MIT | 2023-09-10T20:25:04 | 2019-07-27T15:19:40 | Java | UTF-8 | Java | false | false | 3,320 | java | package base;
import java.net.MalformedURLException;
import java.net.URL;
import com.github.kevinsawicki.http.HttpRequest;
import burp.BurpExtender;
import burp.HelperPlus;
import burp.IBurpExtenderCallbacks;
import burp.IHttpRequestResponse;
import burp.IHttpService;
public class RequestTask {
String url;
RequestType requestType;
public RequestTask(String url,RequestType requestType) {
this.url = url;
this.requestType = requestType;
}
public static void doGetReq(String url,String proxyHost,int proxyPort,String referUrl) {
HttpRequest request = HttpRequest.get(url);
//Configure proxy
request.useProxy(proxyHost, proxyPort);
request.header("Referer", referUrl);
//Accept all certificates
request.trustAllCerts();
//Accept all hostnames
request.trustAllHosts();
request.code();
}
public static void doPostReq(String url,String proxyHost,int proxyPort,String referUrl)
{
HttpRequest postRequest = HttpRequest.post(url);
//Configure proxy
postRequest.useProxy(proxyHost, proxyPort);
postRequest.header("Referer", referUrl);
//Accept all certificates
postRequest.trustAllCerts();
//Accept all hostnames
postRequest.trustAllHosts();
postRequest.send("test=test");
postRequest.code();
}
public static void doPostJsonReq(String url,String proxyHost,int proxyPort,String referUrl)
{
HttpRequest postRequest = HttpRequest.post(url);
//Configure proxy
postRequest.useProxy(proxyHost, proxyPort);
postRequest.header("Referer", referUrl);
postRequest.header("Content-Type", "application/json");
//Accept all certificates
postRequest.trustAllCerts();
//Accept all hostnames
postRequest.trustAllHosts();
postRequest.send("{}");
postRequest.code();
}
public void sendRequest(String proxyHost,int proxyPort,String referUrl) {
if (referUrl ==null || referUrl.equals("")) {
referUrl = url;
}
System.out.println("send request:"+url+" using proxy:"+proxyHost+":"+proxyPort);
if (requestType == RequestType.GET) {
doGetReq(url,proxyHost,proxyPort,referUrl);
}
if (requestType == RequestType.POST) {
doPostReq(url,proxyHost,proxyPort,referUrl);
}
if (requestType == RequestType.JSON) {
doPostJsonReq(url,proxyHost,proxyPort,referUrl);
}
}
@Deprecated
public static void sendRequestWithBurpMethod(String url) {
URL tmpUrl;
try {
tmpUrl = new URL(url);
} catch (MalformedURLException e) {
e.printStackTrace();
return;
}
IBurpExtenderCallbacks callbacks = BurpExtender.getCallbacks();
byte[] req = callbacks.getHelpers().buildHttpRequest(tmpUrl);
HelperPlus hp = new HelperPlus(callbacks.getHelpers());
req = hp.addOrUpdateHeader(true, req, "X-sent-by-knife", "X-sent-by-knife");
int port = tmpUrl.getPort() == -1? tmpUrl.getDefaultPort():tmpUrl.getPort();
IHttpService service = callbacks.getHelpers().buildHttpService(tmpUrl.getHost(), port, tmpUrl.getProtocol());
IHttpRequestResponse message = BurpExtender.getCallbacks().makeHttpRequest(service, req);
message.setComment("Sent by Knife");//在logger中没有显示comment
byte[] postReq = callbacks.getHelpers().toggleRequestMethod(req);
IHttpRequestResponse message1 = BurpExtender.getCallbacks().makeHttpRequest(service, postReq);
message.setComment("Sent by Knife");//在logger中没有显示comment
}
}
| [
"bit4woo@163.com"
] | bit4woo@163.com |
1eaf6e89debb9759326a19a875ff7ee55705f416 | 6a922e840b33f11ab3d0f154afa0b33cff272676 | /src/samples/docx4j/org/docx4j/samples/TemplateAttach.java | c9603c76fa71616d340772eb3bd2f9aca360a6ca | [
"Apache-2.0"
] | permissive | baochanghong/docx4j | 912fc146cb5605e6f7869c4839379a83a8b4afd8 | 4c83d8999c9396067dd583b82a6fc892469a3919 | refs/heads/master | 2021-01-12T15:30:26.971311 | 2016-10-20T00:44:25 | 2016-10-20T00:44:25 | 71,792,895 | 3 | 0 | null | 2016-10-24T13:39:57 | 2016-10-24T13:39:57 | null | UTF-8 | Java | false | false | 5,757 | java | /*
* Copyright 2007-2008, Plutext Pty Ltd.
*
* This file is part of docx4j.
docx4j is licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package org.docx4j.samples;
import java.io.File;
import java.net.URI;
import org.docx4j.XmlUtils;
import org.docx4j.jaxb.Context;
import org.docx4j.openpackaging.contenttype.CTOverride;
import org.docx4j.openpackaging.contenttype.ContentTypeManager;
import org.docx4j.openpackaging.packages.WordprocessingMLPackage;
import org.docx4j.openpackaging.parts.WordprocessingML.DocumentSettingsPart;
import org.docx4j.openpackaging.parts.relationships.Namespaces;
import org.docx4j.openpackaging.parts.relationships.RelationshipsPart;
import org.docx4j.wml.CTRel;
import org.docx4j.wml.CTSettings;
/**
* Creates a WordprocessingML document from the template (dotx file),
* and optionally, attaches that template (for example, instead of Normal.dot)
*
* Be sure to set String templatePath.
*
* In Flat OPC terms, aim is to produce:
*
<pkg:part pkg:name="/word/settings.xml" pkg:contentType="application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml">
<pkg:xmlData>
<w:settings xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:sl="http://schemas.openxmlformats.org/schemaLibrary/2006/main">
<w:attachedTemplate r:id="rId1"/>
</w:settings>
</pkg:xmlData>
</pkg:part>
* <pkg:part pkg:name="/word/_rels/settings.xml.rels" pkg:contentType="application/vnd.openxmlformats-package.relationships+xml">
<pkg:xmlData>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/attachedTemplate" Target="file:///C:\Users\jharrop\AppData\Roaming\Microsoft\Templates\fabdocx-release-20101002B.dotm" TargetMode="External"/>
</Relationships>
</pkg:xmlData>
</pkg:part>
*
* @author Jason Harrop
*/
public class TemplateAttach extends AbstractSample {
static boolean attachTemplate = true; // whether to set w:attachedTemplate
public static void main(String[] args) throws Exception {
String dotx = "C:\\Users\\jharrop\\AppData\\Roaming\\Microsoft\\Templates\\mytemplate.dotx";
String templatePath = "file:///" + dotx;
try {
getInputFilePath(args);
} catch (IllegalArgumentException e) {
inputfilepath = System.getProperty("user.dir") + "/OUT_TemplateAttach.docx";
}
boolean save =
(inputfilepath == null ? false : true);
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(new File(dotx));
// NB: clone here if your use case requires it
// Replace dotx content type with docx
ContentTypeManager ctm = wordMLPackage.getContentTypeManager();
// Get <Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml"/>
CTOverride override = ctm.getOverrideContentType().get(new URI("/word/document.xml")); // note this assumption
if (dotx.endsWith("dotm")) // // macro enabled?
{
override.setContentType(org.docx4j.openpackaging.contenttype.ContentTypes.WORDPROCESSINGML_DOCUMENT_MACROENABLED);
} else {
override.setContentType(org.docx4j.openpackaging.contenttype.ContentTypes.WORDPROCESSINGML_DOCUMENT);
}
if (attachTemplate) {
// Create settings part, and init content
DocumentSettingsPart dsp = new DocumentSettingsPart();
CTSettings settings = Context.getWmlObjectFactory().createCTSettings();
dsp.setJaxbElement(settings);
wordMLPackage.getMainDocumentPart().addTargetPart(dsp);
// Create external rel
RelationshipsPart rp = RelationshipsPart.createRelationshipsPartForPart(dsp);
org.docx4j.relationships.Relationship rel = new org.docx4j.relationships.ObjectFactory().createRelationship();
rel.setType( Namespaces.ATTACHED_TEMPLATE );
rel.setTarget(templatePath);
rel.setTargetMode("External");
rp.addRelationship(rel); // addRelationship sets the rel's @Id
settings.setAttachedTemplate(
(CTRel)XmlUtils.unmarshalString("<w:attachedTemplate xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" r:id=\"" + rel.getId() + "\"/>", Context.jc, CTRel.class)
);
// or (yuck)...
// CTRel id = new CTRel();
// id.setId( rel.getId() );
// JAXBElement<CTRel> je = new JAXBElement<CTRel>(
// new QName("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "attachedTemplate"),
// CTRel.class, null, id);
// settings.setAttachedTemplate(je.getValue());
}
// Now save it
if (save) {
wordMLPackage.save(new java.io.File(inputfilepath) );
}
}
}
| [
"jason@plutext.org"
] | jason@plutext.org |
2cf90aa9bf2442071e840a1c89a79894bde3b839 | d5f474ade956f75d6827f01ae65a73a68b91670a | /src/com/class05/AlertDemo1.java | 9c78ea113de944318a98d70ddfefc4baad7ec81a | [] | no_license | ntxm/Selenium | 891d4fcdea8a90fccf0d2075e30f88e221c40dbc | 3f7a59cf1f66d0695fc01666d9d4237b7614d9d5 | refs/heads/master | 2020-11-29T01:12:55.311664 | 2020-01-12T05:38:21 | 2020-01-12T05:38:21 | 229,972,737 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,409 | java | package com.class05;
import org.openqa.selenium.Alert;
import org.openqa.selenium.By;
import com.utils.CommonMethods;
public class AlertDemo1 extends CommonMethods{
public static final String SYNTAX_PRACTICE_URL = "http://166.62.36.207/syntaxpractice/index.html";
public static void main(String[] args) throws InterruptedException {
//The method is opening syntax Practice website using chrome browser
CommonMethods.setUp("chrome", SYNTAX_PRACTICE_URL);
Thread.sleep(2000);
//find the element Alerts and Modals and clicking on it
driver.findElement(By.xpath("//a[@href='#' and text()='Alerts & Modals']")).click();
//finding Javascript Alerts and clicking on it
driver.findElement(By.linkText("Javascript Alerts")).click();
//finding the button and click on it
driver.findElement(By.xpath("//button[@onclick='myAlertFunction()']")).click();
Thread.sleep(2000);
Alert alert=driver.switchTo().alert();
Thread.sleep(2000);
//get the text from alert box. before you hand the alert
System.out.println("Alert text: "+alert.getText());
//accept alert. any positive action. it could be OK, Yes, Accept, proceed.
alert.accept();
Thread.sleep(2000);
//get the text from the ui or main window
String text=driver.findElement(By.xpath("//p[text()='Click the button to display an alert box:']")).getText();
System.out.println(text);
}
}
| [
"51963319+ntxm@users.noreply.github.com"
] | 51963319+ntxm@users.noreply.github.com |
9330d82d4bc8297bfbceefd6620aee6f2cbf951e | 9504a46711185a701ec8eb0110d8814a37e436d7 | /src/com/massivecraft/massivebooks/cmd/ARBookInHand.java | 98e727a2100c712a524e0bdb7ecc87149c7e5f45 | [] | no_license | GodPure/MassiveBooks | 1d3915b6f2e0d80181a2247267f76bf82784724c | 91fa63a36da4421b6ff25489e4776a1c1fed22a5 | refs/heads/master | 2020-12-24T06:41:34.112063 | 2015-03-05T15:12:58 | 2015-03-05T15:12:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,939 | java | package com.massivecraft.massivebooks.cmd;
import org.bukkit.Material;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import com.massivecraft.massivebooks.Lang;
import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.cmd.arg.ArgReaderAbstract;
import com.massivecraft.massivecore.util.IdUtil;
public class ARBookInHand extends ArgReaderAbstract<ItemStack>
{
// -------------------------------------------- //
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
public static final ARBookInHand WRITTEN = new ARBookInHand(true, false);
public static ARBookInHand getWritten() { return WRITTEN; }
public static final ARBookInHand QUILL = new ARBookInHand(false, true);
public static ARBookInHand getQuill() { return QUILL; }
public static final ARBookInHand EITHER = new ARBookInHand(true, true);
public static ARBookInHand getEither() { return EITHER; }
private ARBookInHand(boolean acceptingWrittenBook, boolean acceptingBookAndQuill)
{
this.acceptingWrittenBook = acceptingWrittenBook;
this.acceptingBookAndQuill = acceptingBookAndQuill;
}
// -------------------------------------------- //
// FIELDS
// -------------------------------------------- //
private final boolean acceptingWrittenBook;
public boolean isAcceptingWrittenBook() { return this.acceptingWrittenBook; }
private final boolean acceptingBookAndQuill;
public boolean isAcceptingBookAndQuill() { return this.acceptingBookAndQuill; }
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public ItemStack read(String arg, CommandSender sender) throws MassiveException
{
ItemStack ret = this.getItemStack(sender);
if (ret != null) return ret;
throw new MassiveException().addMessage(this.getError());
}
// -------------------------------------------- //
// EXTRAS
// -------------------------------------------- //
public String getAcceptedItemsDesc()
{
if (this.acceptingWrittenBook && this.acceptingBookAndQuill) return Lang.ACCEPTED_ITEMS_EITHER;
if (this.acceptingWrittenBook) return Lang.ACCEPTED_ITEMS_WRITTEN;
return Lang.ACCEPTED_ITEMS_QUILL;
}
public String getError()
{
return String.format(Lang.BOOK_IN_HAND_ERROR_TEMPLATE, this.getAcceptedItemsDesc());
}
public ItemStack getItemStack(CommandSender sender)
{
Player player = IdUtil.getAsPlayer(sender);
if (player == null) return null;
ItemStack ret = player.getItemInHand();
if (ret == null) return null;
Material type = ret.getType();
if (type == Material.WRITTEN_BOOK && this.isAcceptingWrittenBook()) return ret;
if (type == Material.BOOK_AND_QUILL && this.isAcceptingBookAndQuill()) return ret;
return null;
}
}
| [
"olof@sylt.nu"
] | olof@sylt.nu |
0c54b609587ad939db284f87b57e4a836f34e600 | 024cc651169340a2609e99c6e7ce7544f6ebf483 | /netcar-interface/src/main/java/com/zhcx/netcar/pojo/yuzheng/YunzhengAmount.java | 52c8385ef4b46afa87e4529f332f7e2c0153e142 | [] | no_license | 3103509329/transfer_trolley | cb1df2df0c05013615091c36f87460b85a98239e | e8b8cd0f17062457a00188771c8d99ed2340e02b | refs/heads/master | 2023-01-28T23:11:45.245311 | 2020-12-09T03:30:00 | 2020-12-09T03:30:00 | 319,565,360 | 0 | 0 | null | 2020-12-10T14:11:46 | 2020-12-08T07:51:32 | Java | UTF-8 | Java | false | false | 3,958 | java | package com.zhcx.netcar.pojo.yuzheng;
import java.io.Serializable;
public class YunzhengAmount implements Serializable {
private Long uuid;
private String companyId;
private String busiregnumber;
private Integer amount;
private Integer type;
private Integer flage;
private String time;
private static final long serialVersionUID = 1L;
public Long getUuid() {
return uuid;
}
public void setUuid(Long uuid) {
this.uuid = uuid;
}
public String getCompanyId() {
return companyId;
}
public void setCompanyId(String companyId) {
this.companyId = companyId;
}
public String getBusiregnumber() {
return busiregnumber;
}
public void setBusiregnumber(String busiregnumber) {
this.busiregnumber = busiregnumber;
}
public Integer getAmount() {
return amount;
}
public void setAmount(Integer amount) {
this.amount = amount;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public Integer getFlage() {
return flage;
}
public void setFlage(Integer flage) {
this.flage = flage;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
YunzhengAmount other = (YunzhengAmount) that;
return (this.getUuid() == null ? other.getUuid() == null : this.getUuid().equals(other.getUuid()))
&& (this.getCompanyId() == null ? other.getCompanyId() == null : this.getCompanyId().equals(other.getCompanyId()))
&& (this.getBusiregnumber() == null ? other.getBusiregnumber() == null : this.getBusiregnumber().equals(other.getBusiregnumber()))
&& (this.getAmount() == null ? other.getAmount() == null : this.getAmount().equals(other.getAmount()))
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
&& (this.getFlage() == null ? other.getFlage() == null : this.getFlage().equals(other.getFlage()))
&& (this.getTime() == null ? other.getTime() == null : this.getTime().equals(other.getTime()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getUuid() == null) ? 0 : getUuid().hashCode());
result = prime * result + ((getCompanyId() == null) ? 0 : getCompanyId().hashCode());
result = prime * result + ((getBusiregnumber() == null) ? 0 : getBusiregnumber().hashCode());
result = prime * result + ((getAmount() == null) ? 0 : getAmount().hashCode());
result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
result = prime * result + ((getFlage() == null) ? 0 : getFlage().hashCode());
result = prime * result + ((getTime() == null) ? 0 : getTime().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", uuid=").append(uuid);
sb.append(", companyId=").append(companyId);
sb.append(", busiregnumber=").append(busiregnumber);
sb.append(", amount=").append(amount);
sb.append(", type=").append(type);
sb.append(", flage=").append(flage);
sb.append(", time=").append(time);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
} | [
"3103509329@qq.com"
] | 3103509329@qq.com |
4d8a37fb9d729162f31866cde6f9b33b05937f9b | 9d265892d49e97e98078f7cdba620acd33f69dd9 | /gratewall/gdsjzx/src/cn/gwssi/datachange/msg_push/api/receiver/ReceiverProtocol.java | 6e53c952e0b9d0adbb4ca9c62bd334d384d0d1cb | [] | no_license | gxlioper/collections | 70d11d5f3e6c999d40fc9f92b1fc26e6d78bf15d | 2458b9e260edd91d564b063072801905e0377a00 | refs/heads/master | 2023-06-21T22:17:49.069471 | 2021-08-10T15:43:51 | 2021-08-10T15:43:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 210 | java | package cn.gwssi.datachange.msg_push.api.receiver;
/**
* 接收者所允许的协议类型
* 暂时HTTP & FTP
* @author wuyincheng
* @date Jul 12, 2016
*
*/
public enum ReceiverProtocol {
HTTP,
FTP
}
| [
"1039288191@qq.com"
] | 1039288191@qq.com |
e24d8172b7e356681c62708120474abffd53b556 | b85d0ce8280cff639a80de8bf35e2ad110ac7e16 | /com/fasterxml/jackson/databind/introspect/AnnotatedParameter.java | 099dffa8686f65e668e5e70d6496f65848652f64 | [] | no_license | MathiasMonstrey/fosil_decompiled | 3d90433663db67efdc93775145afc0f4a3dd150c | 667c5eea80c829164220222e8fa64bf7185c9aae | refs/heads/master | 2020-03-19T12:18:30.615455 | 2018-06-07T17:26:09 | 2018-06-07T17:26:09 | 136,509,743 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,186 | java | package com.fasterxml.jackson.databind.introspect;
import com.fasterxml.jackson.databind.type.TypeFactory;
import com.fossil.ait;
import java.lang.annotation.Annotation;
import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.Member;
import java.lang.reflect.Type;
public final class AnnotatedParameter extends AnnotatedMember {
private static final long serialVersionUID = 1;
protected final int _index;
protected final AnnotatedWithParams _owner;
protected final Type _type;
public AnnotatedParameter(AnnotatedWithParams annotatedWithParams, Type type, ait com_fossil_ait, int i) {
super(annotatedWithParams == null ? null : annotatedWithParams.getContextClass(), com_fossil_ait);
this._owner = annotatedWithParams;
this._type = type;
this._index = i;
}
public AnnotatedParameter withAnnotations(ait com_fossil_ait) {
return com_fossil_ait == this._annotations ? this : this._owner.replaceParameterAnnotations(this._index, com_fossil_ait);
}
public AnnotatedElement getAnnotated() {
return null;
}
public int getModifiers() {
return this._owner.getModifiers();
}
public String getName() {
return "";
}
public <A extends Annotation> A getAnnotation(Class<A> cls) {
return this._annotations == null ? null : this._annotations.mo959j(cls);
}
public Type getGenericType() {
return this._type;
}
public Class<?> getRawType() {
if (this._type instanceof Class) {
return (Class) this._type;
}
return TypeFactory.defaultInstance().constructType(this._type).getRawClass();
}
public Class<?> getDeclaringClass() {
return this._owner.getDeclaringClass();
}
public Member getMember() {
return this._owner.getMember();
}
public void setValue(Object obj, Object obj2) throws UnsupportedOperationException {
throw new UnsupportedOperationException("Cannot call setValue() on constructor parameter of " + getDeclaringClass().getName());
}
public Object getValue(Object obj) throws UnsupportedOperationException {
throw new UnsupportedOperationException("Cannot call getValue() on constructor parameter of " + getDeclaringClass().getName());
}
public Type getParameterType() {
return this._type;
}
public AnnotatedWithParams getOwner() {
return this._owner;
}
public int getIndex() {
return this._index;
}
public int hashCode() {
return this._owner.hashCode() + this._index;
}
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (obj == null || obj.getClass() != getClass()) {
return false;
}
AnnotatedParameter annotatedParameter = (AnnotatedParameter) obj;
if (annotatedParameter._owner.equals(this._owner) && annotatedParameter._index == this._index) {
return true;
}
return false;
}
public String toString() {
return "[parameter #" + getIndex() + ", annotations: " + this._annotations + "]";
}
}
| [
"me@mathiasmonstrey.be"
] | me@mathiasmonstrey.be |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.