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
d006bfbe992f213318a3b6a9a676c70aa30526d1
3fd5c650e79da86d127b121c61160c2291c77828
/2014-5-11-minecraft-plugins/opened-booscooldowns/src/cz/boosik/boosCooldown/Listeners/BoosPlayerToggleSneakListener.java
68829bf78a2a84ee4ce616698bd30e507aa445ee
[]
no_license
jxofficial/rs-scripts-project-archive
dd85145de99e49616113efb2763900f09a0061d6
de8a460577761126135ec1d1d8e2223d9b0a26d9
refs/heads/master
2021-10-28T03:50:16.517017
2019-04-21T20:49:12
2019-04-21T20:49:12
null
0
0
null
null
null
null
WINDOWS-1250
Java
false
false
1,848
java
package cz.boosik.boosCooldown.Listeners; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerToggleSneakEvent; import util.boosChat; import cz.boosik.boosCooldown.BoosConfigManager; import cz.boosik.boosCooldown.BoosWarmUpManager; /** * Posluchač naslouchající události, která se spouští v okamžiku kdy hráč zapne * plížení (defaultně pomocí klávesy control). Pokud na příkazech hráče je * aktivní časovač warmup, ve chvíli spuštění této události jsou všechny jeho * warmup časovače stornovány a hráči je odeslána zpráva, která ho o této * skutečnosti informuje. Pokud hráč disponuje oprávněním * „booscooldowns.nocancel.sneak“, jeho warmup časovače stornovány nejsou. * * @author Jakub Kolář * */ public class BoosPlayerToggleSneakListener implements Listener { /** * Pokud hráč není null a nedisponuje oprávněním * booscooldowns.nocancel.sneak a pokud tento hráč disponuje aktivními * warmup časovači, pak je hráči odeslána zpráva, která ho informuje o * ukončení všech warmup časovačů a následně tyto časovače ukončuje pomocí * metody cancelWarmUps();. * * @param event * událost PlayerToggleSneakEvent */ @EventHandler(priority = EventPriority.NORMAL) private void onPlayerToggleSneak(PlayerToggleSneakEvent event) { if (event.isCancelled()) return; Player player = event.getPlayer(); if (player != null && !player.hasPermission("booscooldowns.nocancel.sneak")) { if (BoosWarmUpManager.hasWarmUps(player)) { boosChat.sendMessageToPlayer(player, BoosConfigManager.getCancelWarmupOnSneakMessage()); BoosWarmUpManager.cancelWarmUps(player); } } } }
[ "rabrg96@gmail.com" ]
rabrg96@gmail.com
e8688c810764429aa76108fc4f6e3387189dc32f
67653f29dfeb6989a82f6ae532141664a71e3ece
/xcEdu/xcEdu/xc-framework-parent/xc-framework-model/src/main/java/com/xuecheng/framework/domain/media/MediaFile.java
b847191d2e5ef3f2d2ba3346aa2d617f3b7b34f3
[]
no_license
xlehehe/XcEdu
5d6cdf11f996a2016226683485d3ab1ccac962c5
ef3146860adba7047dd251bd347cd7b69d651df4
refs/heads/master
2020-07-29T07:33:43.393393
2019-08-22T12:04:49
2019-08-22T12:04:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,316
java
package com.xuecheng.framework.domain.media; import lombok.Data; import lombok.ToString; import org.springframework.data.annotation.Id; import org.springframework.data.mongodb.core.mapping.Document; import java.util.Date; /** * @Author: mrt. * @Description: * @Date:Created in 2018/1/24 10:04. * @Modified By: */ @Data @ToString @Document(collection = "media_file") public class MediaFile { /* 文件id、名称、大小、文件类型、文件状态(未上传、上传完成、上传失败)、上传时间、视频处理方式、视频处理状态、hls_m3u8,hls_ts_list、课程视频信息(课程id、章节id) */ @Id //文件id private String fileId; //文件名称 private String fileName; //文件原始名称 private String fileOriginalName; //文件路径 private String filePath; //文件url private String fileUrl; //文件类型 private String fileType; //mimetype private String mimeType; //文件大小 private Long fileSize; //文件状态 private String fileStatus; //上传时间 private Date uploadTime; //处理状态 private String processStatus; //hls处理 private MediaFileProcess_m3u8 mediaFileProcess_m3u8; //tag标签用于查询 private String tag; }
[ "452419829@qq.com" ]
452419829@qq.com
d112a2fee24fa58b551e002159bb71aa17aaada3
e5431a10d8a82b382fa586724be9f804041fa0fe
/gaia-core/src/main/java/gaia/admin/editor/PluginInfo.java
07a2ffa7a943117677bb87440b1845f794d76a72
[]
no_license
whlee21/gaia
65ca1a45e3c85ac0a368a94827e53cf73834d48b
9abcb86b7c2ffc33c39ec1cf66a25e9d2144aae0
refs/heads/master
2022-12-26T14:06:44.067143
2014-05-19T16:15:47
2014-05-19T16:15:47
14,943,649
2
0
null
2022-12-14T20:22:44
2013-12-05T04:16:26
Java
UTF-8
Java
false
false
2,463
java
package gaia.admin.editor; import javax.persistence.Entity; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; import gaia.IdObject; import gaia.utils.XMLUtils; @Entity public class PluginInfo extends IdObject { private PluginType type; private boolean provided; private boolean readOnly; private String className; private String name; private boolean enabled; private String configSnippet; public PluginInfo() { } public PluginInfo(String configSnippet) { this(configSnippet, true, false); } public PluginInfo(String configSnippet, boolean enabled, boolean readOnly) { setConfigSnippet(configSnippet); this.enabled = enabled; this.readOnly = readOnly; } public boolean isReadOnly() { return readOnly; } public void setReadOnly(boolean readOnly) { this.readOnly = readOnly; } public boolean isProvided() { return provided; } public void setProvided(boolean provided) { this.provided = provided; } public PluginType getType() { return type; } public String getConfigSnippet() { return configSnippet; } public void setConfigSnippet(String configSnippet) { this.configSnippet = configSnippet; try { Node node = XMLUtils.loadDocument(configSnippet).getDocumentElement(); NamedNodeMap attributes = node.getAttributes(); className = attributes.getNamedItem("class").getNodeValue(); if ((className != null) && ((className.startsWith("org.apache.lucene")) || (className.startsWith("org.apache.solr")) || (className .startsWith("solr")))) { provided = true; } name = attributes.getNamedItem("name").getNodeValue(); String nodeName = node.getNodeName(); if (nodeName.equals("searchComponent")) type = PluginType.SEARCH_COMPONENT; else if (nodeName.equals("requestHandler")) type = PluginType.REQUEST_HANDLER; else if (nodeName.equals("fieldType")) type = PluginType.FIELD_TYPE; } catch (Exception e) { throw new RuntimeException(e); } } public String getClassName() { return className; } public boolean isEnabled() { return enabled; } public void setEnabled(boolean enabled) { this.enabled = enabled; } public String getName() { return name; } public String toString() { return "PluginInfo{className='" + className + '\'' + ", type=" + type + ", provided=" + provided + ", readOnly=" + readOnly + ", name='" + name + '\'' + ", enabled=" + enabled + ", configSnippet='" + configSnippet + '\'' + '}'; } }
[ "whlee21@gmail.com" ]
whlee21@gmail.com
7667608e53c90554fae88c04c2afb42ee48b1232
cddb9e844d48f0e039fec0de870a1f8edfe08266
/src/main/java/builder_example/PolicyService.java
a0427b0d0df00ee6d491c6572edeb9a5e824348e
[]
no_license
Jeka1978/idi3
1f0535a4009a8a324e2d1d73013195a91712535d
7f98c2a8cad61c9f5625871dc0d9954335d9c2eb
refs/heads/master
2020-04-13T02:16:25.937933
2018-12-27T14:30:44
2018-12-27T14:30:44
162,898,306
0
0
null
null
null
null
UTF-8
Java
false
false
1,432
java
package builder_example; import lombok.NonNull; /** * @author Evgeny Borisov */ public class PolicyService { @NonNull private Integer age; @NonNull private Integer vetek; @NonNull private Integer year; @java.beans.ConstructorProperties({"age", "vetek", "year"}) public PolicyService(Integer age, Integer vetek, Integer year) { this.age = age; this.vetek = vetek; this.year = year; } public static PolicyServiceBuilder builder() { return new PolicyServiceBuilder(); } public static class PolicyServiceBuilder { private Integer age; private Integer vetek; private Integer year; PolicyServiceBuilder() { } public PolicyService.PolicyServiceBuilder age(Integer age) { this.age = age; return this; } public PolicyService.PolicyServiceBuilder vetek(Integer vetek) { this.vetek = vetek; return this; } public PolicyService.PolicyServiceBuilder year(Integer year) { this.year = year; return this; } public PolicyService build() { return new PolicyService(age, vetek, year); } public String toString() { return "PolicyService.PolicyServiceBuilder(age=" + this.age + ", vetek=" + this.vetek + ", year=" + this.year + ")"; } } }
[ "kit2009" ]
kit2009
1729918fbdbbdb4ceec1a2f3bef98e4fe1c1170a
4d0f2d62d1c156d936d028482561585207fb1e49
/Ma nguon/zcs-8.0.2_GA_5570-src/ZimbraServer/src/java/com/zimbra/cs/datasource/PopMessage.java
4ee5c482be3359ddb58b25e11caa19cdd5cfc410
[]
no_license
vuhung/06-email-captinh
e3f0ff2e84f1c2bc6bdd6e4167cd7107ec42c0bd
af828ac73fc8096a3cc096806c8080e54d41251f
refs/heads/master
2020-07-08T09:09:19.146159
2013-05-18T12:57:24
2013-05-18T12:57:24
32,319,083
0
2
null
null
null
null
UTF-8
Java
false
false
3,108
java
/* * ***** BEGIN LICENSE BLOCK ***** * Zimbra Collaboration Suite Server * Copyright (C) 2009, 2010 Zimbra, Inc. * * The contents of this file are subject to the Zimbra Public License * Version 1.3 ("License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.zimbra.com/license. * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. * ***** END LICENSE BLOCK ***** */ package com.zimbra.cs.datasource; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; import java.util.Map; import java.util.Set; import com.zimbra.common.service.ServiceException; import com.zimbra.cs.account.DataSource; import com.zimbra.cs.db.DbDataSource; import com.zimbra.cs.db.DbPop3Message; import com.zimbra.cs.db.DbDataSource.DataSourceItem; public class PopMessage extends DataSourceMapping { public PopMessage(DataSource ds, DataSourceItem dsi) throws ServiceException { super(ds, dsi); } public PopMessage(DataSource ds, int itemId) throws ServiceException { super(ds, itemId); } public PopMessage(DataSource ds, String uid) throws ServiceException { super(ds, uid); } public PopMessage(DataSource ds, int itemId, String uid) throws ServiceException { super(ds, ds.getFolderId(), itemId, uid); } public static Set<PopMessage> getMappings(DataSource ds, String[] remoteIds) throws ServiceException { Collection<DataSourceItem> mappings = DbDataSource.getReverseMappings(ds, Arrays.asList(remoteIds)); Set<PopMessage> matchingMsgs = new HashSet<PopMessage>(); if (mappings.isEmpty()) { Map<Integer, String> oldMappings = DbPop3Message.getMappings( DataSourceManager.getInstance().getMailbox(ds), ds.getId()); for (Integer itemId : oldMappings.keySet()) { String uid = oldMappings.get(itemId); PopMessage mapping = new PopMessage(ds, itemId, uid); mapping.add(); for (String remoteId : remoteIds) { if (remoteId.equals(uid)) matchingMsgs.add(mapping); } } if (!oldMappings.isEmpty()) DbPop3Message.deleteUids(DataSourceManager.getInstance().getMailbox(ds), ds.getName()); } else { for (DataSourceItem mapping : mappings) matchingMsgs.add(new PopMessage(ds, mapping)); } return matchingMsgs; } public static Set<String> getMatchingUids(DataSource ds, String[] remoteIds) throws ServiceException { Set<PopMessage> matchingMsgs = getMappings(ds, remoteIds); Set<String> matchingUids = new HashSet<String>(matchingMsgs.size()); for (PopMessage msg : matchingMsgs) matchingUids.add(msg.getRemoteId()); return matchingUids; } }
[ "vuhung16plus@gmail.com@ec614674-f94a-24a8-de76-55dc00f2b931" ]
vuhung16plus@gmail.com@ec614674-f94a-24a8-de76-55dc00f2b931
1e922400357a0e5fed0b5648c937799a181624c0
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/17/17_bdabe10eed42bbab1567e9d4898039194ed80f74/Servlet30AsyncServlet/17_bdabe10eed42bbab1567e9d4898039194ed80f74_Servlet30AsyncServlet_s.java
fb648e5a691d67d0dfa7cb2acc7e958ef2fc2426
[]
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
3,274
java
/* * Copyright 2010 Richard Zschech. * * This is commercial code. Do not distribute. * * 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.zschech.gwt.comet.server.impl; import java.io.IOException; import javax.servlet.AsyncContext; import javax.servlet.AsyncEvent; import javax.servlet.AsyncListener; import javax.servlet.http.HttpServletRequest; public class Servlet30AsyncServlet extends NonBlockingAsyncServlet { @Override public Object suspend(final CometServletResponseImpl response, CometSessionImpl session, HttpServletRequest request) throws IOException { assert Thread.holdsLock(response); assert session == null || !Thread.holdsLock(session); response.flush(); AsyncContext asyncContext = request.startAsync(); asyncContext.addListener(new AsyncListener() { @Override public void onStartAsync(AsyncEvent e) throws IOException { } @Override public void onComplete(AsyncEvent e) throws IOException { } @Override public void onTimeout(AsyncEvent e) throws IOException { onError(e); } @Override public void onError(AsyncEvent e) throws IOException { synchronized (response) { if (!response.isTerminated()) { response.setTerminated(false); } } } }); asyncContext.setTimeout(Long.MAX_VALUE); write(response, session); return asyncContext; } @Override public void terminate(CometServletResponseImpl response, CometSessionImpl session, boolean serverInitiated, Object suspendInfo) { assert Thread.holdsLock(response); assert session == null || !Thread.holdsLock(session); if (serverInitiated && suspendInfo != null) { AsyncContext asyncContext = (AsyncContext) suspendInfo; asyncContext.complete(); } } @Override public void enqueued(CometSessionImpl session) { final CometServletResponseImpl response = session.getResponse(); if (response != null) { synchronized (response) { write(response, session); } } } @Override public void invalidate(CometSessionImpl session) { final CometServletResponseImpl response = session.getResponse(); if (response != null) { response.tryTerminate(); } } private void write(final CometServletResponseImpl response, final CometSessionImpl session) { assert Thread.holdsLock(response); if (!session.isEmpty()) { final AsyncContext asyncContext = (AsyncContext) response.getSuspendInfo(); asyncContext.start(new Runnable() { @Override public void run() { synchronized (response) { try { session.writeQueue(response, true); } catch (IOException e) { log("Error writing session messages"); } if (!session.isEmpty()) { asyncContext.start(this); } } } }); } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
235b20ab33bbc2fabdb6805141566dbd056bed0f
d6169243b9ca325b6a89b470a6e2ae6eace5a318
/wechat-utils/src/main/java/com/cdeledu/util/application/log/dialect/ApacheCommonsLogFactory.java
b185c2041a14ba44fa04a270302528535bba8a64
[]
no_license
0ldm0s/wechat
2b6f8dd87ede2d90d7e97d6011dd64290f37d190
fd953c87226f0cd6f056beeaea5712ba5aabf36f
refs/heads/master
2021-07-01T02:19:38.295262
2017-09-19T03:57:38
2017-09-19T03:57:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
648
java
package com.cdeledu.util.application.log.dialect; import com.cdeledu.util.application.log.Log; import com.cdeledu.util.application.log.LogFactory; /** * @类描述: Apache Commons Logging * @创建者: 独泪了无痕 * @创建日期: 2016年1月23日 上午12:20:58 * @版本: V1.0 * @since: JDK 1.7 */ public class ApacheCommonsLogFactory extends LogFactory { public ApacheCommonsLogFactory() { super("Apache Common Logging"); } @Override public Log getLog(String name) { return new ApacheCommonsLog(name); } @Override public Log getLog(Class<?> clazz) { return new ApacheCommonsLog(clazz); } }
[ "duleilewuhen@sina.com" ]
duleilewuhen@sina.com
fcf2084fe4dad14b29b61c5e5ac23a96007c1057
a666ac40ad2c33d130d9d6b06925a5948b25cc6a
/Java8/src/main/java/lambdasinaction/chap5/Transaction.java
d1760555c5e3967b468f973a96a437c423d4e3e3
[]
no_license
hotenglish/StudyInAction
e8a46ef963be6a9c506cc4606c96a7433a974c7d
941d7a254dbbd22976d8110ff5cf0d18166c0462
refs/heads/master
2022-12-22T16:04:32.592927
2020-06-23T23:30:40
2020-06-23T23:30:40
137,567,024
0
0
null
2022-12-16T07:16:06
2018-06-16T08:51:49
HTML
UTF-8
Java
false
false
642
java
package lambdasinaction.chap5; public class Transaction{ private Trader trader; private int year; private int value; public Transaction(Trader trader, int year, int value) { this.trader = trader; this.year = year; this.value = value; } public Trader getTrader() { return this.trader; } public int getYear() { return this.year; } public int getValue() { return this.value; } public String toString(){ return "{" + this.trader + ", " + "year: "+this.year+", " + "value:" + this.value +"}"; } }
[ "hotenglish@outlook.com" ]
hotenglish@outlook.com
6ce9e8ceeb8fffff420ad7f17a6e42397286bc2f
1d4108dc26c40ce21fb6f08c995f838d4acf4afd
/locations-solution/src/test/java/locations/LocationTest.java
ddb8c40039eeed87a9d90c91603fcc42fd55550b
[]
no_license
BrigiBalogh/senior-solutions
47bff12051443c422baa5ee61cab835e966a79b3
b0091eee3b31095342deb9ddc4347f83e5bd6c40
refs/heads/master
2023-06-28T06:23:20.866338
2021-07-27T13:04:14
2021-07-27T13:04:14
376,309,681
0
0
null
null
null
null
UTF-8
Java
false
false
7,909
java
package locations; import org.assertj.core.api.Condition; import org.junit.jupiter.api.*; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.CsvFileSource; import org.junit.jupiter.params.provider.MethodSource; import java.nio.file.Path; import java.nio.file.Paths; import java.util.Arrays; import java.util.List; import java.util.stream.Stream; import static org.assertj.core.api.Assertions.tuple; import static org.hamcrest.CoreMatchers.hasItem; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.params.provider.Arguments.arguments; public class LocationTest { private LocationParser locationParser; private LocationService locationService; @BeforeEach // given void init() { locationParser = new LocationParser(); locationService = new LocationService(); } @Test void testParse() { // when: a tesztelendő metódus meghívása Location location = locationParser.parse("Budapest,47.497912,19.040235"); Location city = locationParser.parse("Budapest,47.497912,19.040235"); // then: ellenőrzés assertEquals("Budapest", location.getName()); assertEquals(47.497912, location.getLat(),0.005); assertEquals(19.040235, location.getLon(), 0.005); assertNotSame(location,city); } @Test void testIsOnEquator() { assertAll("lat", () -> assertTrue(locationParser.parse("Quito,0,-78.5").isOnEquator()), () -> assertFalse(locationParser.parse("Budapest,47.497912,19.040235").isOnEquator())); } @Test void isOnEquatorTrue() { Location quito = locationParser.parse("Quito,0,-78.5"); assertTrue(quito.isOnEquator()); } @Test void isOnEquatorFalse() { Location budapest = locationParser.parse("Budapest,47.497912,19.040235"); assertFalse(budapest.isOnEquator()); } @Test void isOnPrimeMeridian() { assertAll("lon", () -> assertTrue(locationParser.parse("London,51.5,0").isOnPrimeMeridian()), () -> assertFalse(locationParser.parse("Budapest,47.497912,19.040235").isOnPrimeMeridian())); } @Test void testLonIsSloppyOrToSmall() { IllegalArgumentException iae = assertThrows(IllegalArgumentException.class, () -> new Location("Budapest",47.497912,-190.040235)); assertEquals("Invalid location!", iae.getMessage()); } private Object[][] values = { {new Location("Budapest",47.497912,-19.040235), false}, {new Location("London",51.5,0), false}, {new Location("Quito",0,-78.5), true} }; @RepeatedTest(3) void isOnEquatorTest2(RepetitionInfo repetitionInfo) { int index = repetitionInfo.getCurrentRepetition()-1; Location location = new Location("Quito",0,-78.5); assertEquals(values[index][1], location.isOnEquator()); } @ParameterizedTest //@MethodSource("createLocation") @CsvFileSource(resources = "coordinates.csv") void testDistanceWithMethodSource(double lat1, double lon1, double lat2, double lon2, int expectedDist) { Location location1 = new Location("First",lat1,lon1); Location location2 = new Location("Second",lat2,lon2); double dist = location1.distanceFrom(location2); assertEquals(expectedDist, dist); } /*static Stream<Arguments> createLocation() { return Stream.of( arguments(51.5,0,47.497912,19.040235,1449000), arguments(47,17,0,170,141685000), arguments(47.497912,19.040235,0,-78.5,10611.89) ); }*/ @ParameterizedTest @MethodSource("createOnMeridianLocation") void testIsOnPrimeMeridianWithMethodSource(double lat, double lon, boolean expectedOnMeridian) { } static Stream<Arguments> createOnMeridianLocation() { return Stream.of( arguments(51.5,0,true), arguments(47,17,false), arguments(47.497912,19.040235,false) ); } @TestFactory Stream<DynamicTest> TestIsOnEquatorFavouriteSpaceWithExpectedValues(){ return Stream .of(new Object[][]{ {new Location("Quito",0,-78.5), true}, {new Location("Papua mellett", 0, 170), true} }) .map(item -> DynamicTest.dynamicTest( "favouriteSpace" + ((Location)item[0]).getName() + "lat" + ((Location)item[0]).getLat() + "lon" + ((Location)item[0]).getLon(), () -> assertEquals(item[1], ((Location)item[0]).isOnEquator()))); } @TestFactory Stream<DynamicTest> TestIsOnEquatorFavouriteSpace(){ return Stream .of(new Location("Quito",0,-78.5), new Location("Papua mellett", 0, 170)) .map(locations -> DynamicTest.dynamicTest( "favouriteSpace" + locations.getName() + "lat" + locations.getLat() + "lon" + locations.getLon(),() -> assertTrue(locations.isOnEquator()))); } @Test void testReadLocations() { List<Location> locations = locationService.readLocations(Paths.get("favouritespace.csv")); /*List<Location> locations = Arrays.asList( new Location("Quito",0,-78.5), new Location("Budapest",47.497912,19.040235), new Location("London",51.5,0), new Location("Papua mellett", 0, 170));*/ assertThat(List.of(locations),hasItem(new Location("Quito",0,-78.5))); assertThat(List.of(locations), contains(new Location("Quito",0,-78.5), new Location("Budapest", 47.497912,19.040235), new Location("London",51.5,0), new Location("Papua mellett", 0, 170))); assertThat(List.of(locations), hasItem(hasProperty("name", startsWithIgnoringCase("Budapest")))); //nem ismeri fel a hamcrest! } @Test void testReadLocations2() { List<Location> locations = locationService.readLocations(Paths.get("favouritespace.csv")); org.assertj.core.api.Assertions.assertThat(locations) .extracting("name", "lat", "lon") .contains(tuple("Quito", 0, -78.5), tuple("Budapest", 47.497912, 19.040235), tuple("London", 51.5, 0), tuple("Papua mellett", 0, 170)); Condition<Location> latOrLongZero = new Condition<>(l -> l.getLat() == 0 || l.getLon() == 0, "Lat or long zero"); org.assertj.core.api.Assertions.assertThat(locations) .are(latOrLongZero); /*.filteredOn(l -> l.getLat() == 0 || l.getLon() == 0) .extracting(location -> location.getLat()) .containsOnly(0.0);*/ } @Test void testLocationLatOrLonEqual0() { List<Location> locations = locationService.readLocations(Paths.get("favouritespace.csv")); Condition<Location> latOrLon = new Condition<>(l -> l.getLat()==0 || l.getLon()== 0, "Lat or lon equal 0."); org.assertj.core.api.Assertions.assertThat(locations).have(latOrLon); } }
[ "73614406+BrigiBalogh@users.noreply.github.com" ]
73614406+BrigiBalogh@users.noreply.github.com
f5cb8ce25e8ea61b8422896c2c87ebdfb4efc902
e58a8e0fb0cfc7b9a05f43e38f1d01a4d8d8cf1f
/FantastleX/src/com/puttysoftware/fantastlex/maze/objects/YPlug.java
7c639c472c010208ba9c311db727a691cf4d7578
[ "Unlicense" ]
permissive
retropipes/older-java-games
777574e222f30a1dffe7936ed08c8bfeb23a21ba
786b0c165d800c49ab9977a34ec17286797c4589
refs/heads/master
2023-04-12T14:28:25.525259
2021-05-15T13:03:54
2021-05-15T13:03:54
235,693,016
0
0
null
null
null
null
UTF-8
Java
false
false
573
java
/* FantastleX: A Maze/RPG Hybrid Game Copyright (C) 2008-2010 Eric Ahnell Any questions should be directed to the author via email at: FantastleX@worldwizard.net */ package com.puttysoftware.fantastlex.maze.objects; import com.puttysoftware.fantastlex.maze.abc.AbstractPlug; import com.puttysoftware.fantastlex.resourcemanagers.ObjectImageConstants; public class YPlug extends AbstractPlug { // Constructors public YPlug() { super('Y'); } @Override public int getBaseID() { return ObjectImageConstants.OBJECT_IMAGE_Y_PLUG; } }
[ "eric.ahnell@puttysoftware.com" ]
eric.ahnell@puttysoftware.com
82d39e19f1d996de53c0fb8cf68dd595ae41e0a2
38c4451ab626dcdc101a11b18e248d33fd8a52e0
/identifiers/lucene-3.6.2/contrib/facet/src/java/org/apache/lucene/facet/enhancements/association/AssociationProperty.java
f0623ac9d837f5e4e07dee5a3b41b2fdb09b392d
[]
no_license
habeascorpus/habeascorpus-data
47da7c08d0f357938c502bae030d5fb8f44f5e01
536d55729f3110aee058ad009bcba3e063b39450
refs/heads/master
2020-06-04T10:17:20.102451
2013-02-19T15:19:21
2013-02-19T15:19:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,403
java
org PACKAGE_IDENTIFIER false apache PACKAGE_IDENTIFIER false lucene PACKAGE_IDENTIFIER false facet PACKAGE_IDENTIFIER false enhancements PACKAGE_IDENTIFIER false association PACKAGE_IDENTIFIER false org PACKAGE_IDENTIFIER false apache PACKAGE_IDENTIFIER false lucene PACKAGE_IDENTIFIER false facet PACKAGE_IDENTIFIER false index PACKAGE_IDENTIFIER false attributes PACKAGE_IDENTIFIER false CategoryAttribute TYPE_IDENTIFIER false org PACKAGE_IDENTIFIER false apache PACKAGE_IDENTIFIER false lucene PACKAGE_IDENTIFIER false facet PACKAGE_IDENTIFIER false index PACKAGE_IDENTIFIER false attributes PACKAGE_IDENTIFIER false CategoryProperty TYPE_IDENTIFIER false AssociationProperty TYPE_IDENTIFIER true CategoryProperty TYPE_IDENTIFIER false association VARIABLE_IDENTIFIER true Integer TYPE_IDENTIFIER false MAX_VALUE VARIABLE_IDENTIFIER false AssociationProperty METHOD_IDENTIFIER false value VARIABLE_IDENTIFIER true association VARIABLE_IDENTIFIER false value VARIABLE_IDENTIFIER false getAssociation METHOD_IDENTIFIER true association VARIABLE_IDENTIFIER false hasBeenSet METHOD_IDENTIFIER true association VARIABLE_IDENTIFIER false Integer TYPE_IDENTIFIER false MAX_VALUE VARIABLE_IDENTIFIER false Override TYPE_IDENTIFIER false String TYPE_IDENTIFIER false toString METHOD_IDENTIFIER true getClass METHOD_IDENTIFIER false getSimpleName METHOD_IDENTIFIER false association VARIABLE_IDENTIFIER false
[ "pschulam@gmail.com" ]
pschulam@gmail.com
646949d480623f3e7ac91eb305bc486a1ad62d81
e53ac6aec38577e8aee29a06e3ff1c94f9b694eb
/src/main/java/com/lm/ihc/controller/LoginController.java
763d65b68dd9c4b8c350355c2e17033bbfd989fa
[]
no_license
louiema1n/ihc
b3a936e046fef95cdae48135c6c86cc9bad18bcd
6c8733e560f095d8e8ea0f5467c7abe3a8e101a7
refs/heads/master
2021-07-22T02:10:06.110804
2018-08-09T08:08:49
2018-08-09T08:08:49
131,837,718
0
0
null
null
null
null
UTF-8
Java
false
false
2,824
java
package com.lm.ihc.controller; import com.lm.ihc.domain.LoginUser; import com.lm.ihc.domain.User; import com.lm.ihc.service.UserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.io.UnsupportedEncodingException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.Base64; @RestController public class LoginController { @Autowired private UserService userService; @CrossOrigin @RequestMapping(value = "/login", method = RequestMethod.POST) public LoginUser login(@RequestBody User user) { // 从数据库获取当前用户信息 User dataUser = this.userService.queryPwdByUsername(user.getUsername()); LoginUser loginUser = new LoginUser(); if (dataUser == null || !user.getUsername().equals(dataUser.getUsername())) { // 用户名不存在 loginUser.setStatus(2); } else { // 加密密码 String encryptPwd = encryptPwd(dataUser.getUsername(), dataUser.getPassword()); if (user.getPassword().equals(encryptPwd)) { loginUser.setStatus(1); loginUser.setUser(dataUser); } else { // 密码错误 loginUser.setStatus(0); } } return loginUser; } /** * 加密密码 * * @param username * @param pwd * @return */ private String encryptPwd(String username, String pwd) { String md5Pwd1 = getMd5(username + pwd); // String md5Str = md5.digest((username + pwd).getBytes()).toString(); // 截取1-6 String subMd5Pwd1 = md5Pwd1.substring(1, 6); // 再次MD5 md5Pwd1 = getMd5( md5Pwd1 + subMd5Pwd1); return Base64.getEncoder().encodeToString(md5Pwd1.getBytes()); } public String getMd5(String string) { try { // md5加密 MessageDigest md5 = MessageDigest.getInstance("MD5"); md5.reset(); md5.update(string.getBytes("UTF-8")); byte[] md5Str = md5.digest(); StringBuffer md5StrBuff = new StringBuffer(); for (int i = 0; i < md5Str.length; i++) { if (Integer.toHexString(0xFF & md5Str[i]).length() == 1) md5StrBuff.append("0").append(Integer.toHexString(0xFF & md5Str[i])); else md5StrBuff.append(Integer.toHexString(0xFF & md5Str[i])); } return md5StrBuff.toString(); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return ""; } }
[ "louielcxy@live.cn" ]
louielcxy@live.cn
667ee30db61dde2e0183993fabc37f226d2ed264
924358c01502fc238789e780465d5d169729e944
/modules/server/src/main/java/org/zodiark/service/wowza/WowzaMessage.java
9a59b5ddfdf6686433f70db8335f208364ab9ab8
[ "Apache-2.0" ]
permissive
francisdesjardins/zodiark
23e8896ac3b09bd5b4fe4bbb0d1620aa95a996a9
746337135b29179698c1af44ee3fa2c06318bc53
refs/heads/master
2021-01-14T14:23:23.783798
2014-11-30T06:26:27
2014-11-30T06:26:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,639
java
/* * Copyright 2013-2014 High-Level Technologies * * 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.zodiark.service.wowza; import java.util.ArrayList; import java.util.List; /** * An object used as {@link org.zodiark.service.chat.Message#message} used to exchange data with a remote Wowza {@link org.zodiark.service.Endpoint} */ public class WowzaMessage { public enum TYPE { OBFUSCATE, LIVE } private TYPE type = TYPE.OBFUSCATE; private List<String> uuids; private String publisherUUID; public WowzaMessage(){ uuids = new ArrayList<>(); } public WowzaMessage(List<String> uuids){ this.uuids = uuids; } public TYPE getType() { return type; } public void setType(TYPE type) { this.type = type; } public List<String> getUuids() { return uuids; } public void setUuids(List<String> uuids) { this.uuids = uuids; } public String getPublisherUUID() { return publisherUUID; } public void setPublisherUUID(String publisherUUID) { this.publisherUUID = publisherUUID; } }
[ "jfarcand@apache.org" ]
jfarcand@apache.org
2842fb1ddc9829d3cfcd937cf3cc2a24da3c5e05
0328358cbbf2a51477439d9682d31c32c758726d
/src/question/Question_114_flatten.java
2f6dc63faccf9212b50d30d661a8b616318777c5
[]
no_license
PdKingLiu/LeetCode
7fd06bf0fd2bdb0b593811c3a55da64e42a1bdeb
f740b36546c0c2d51ae8bd3ed0b7aed6659317b7
refs/heads/master
2021-07-07T22:57:55.004152
2020-08-30T17:01:13
2020-08-30T17:01:13
178,868,812
1
0
null
null
null
null
UTF-8
Java
false
false
1,799
java
package question; import common.TreeNode; import java.util.ArrayList; /** * @author liupeidong * Created on 2019/8/31 12:06 */ public class Question_114_flatten { /*给定一个二叉树,原地将它展开为链表。 例如,给定二叉树 1 / \ 2 5 / \ \ 3 4 6 将其展开为: 1 \ 2 \ 3 \ 4 \ 5 \ 6 */ ArrayList<Integer> list = new ArrayList<>(2000); public void flatten(TreeNode root) { if (root == null || (root.left == null && root.right == null)) { return; } getList(root); root.left = null; for (int i = 1; i < list.size(); i++) { root.right = new TreeNode(list.get(i)); root = root.right; } } private void getList(TreeNode root) { if (root == null) { return; } list.add(root.val); getList(root.left); getList(root.right); } public void flatten2(TreeNode root) { if (root == null) { return; } TreeNode rightTem; while (root != null) { if (root.left != null) { rightTem = root.right; root.right = root.left; root.left = null; if (rightTem != null) { TreeNode rightBottom = root.right; while (rightBottom.right != null) { rightBottom = rightBottom.right; } rightBottom.right = rightTem; } } root = root.right; } } }
[ "931942280@qq.com" ]
931942280@qq.com
64477eafcebafd92dacee6dcfc886d08900befce
0fb7a2ed774983f2ac12c8403b6269808219e9bc
/yikatong-core/src/main/java/com/alipay/api/response/AlipayEcoMycarOrderStatusQueryResponse.java
c12a118afdb7b9198e9978d36a126910526ff038
[]
no_license
zhangzh56/yikatong-parent
e605b4025c934fb4099d5c321faa3a48703f8ff7
47e8f627ba3471eff71f593189e82c6f08ceb1a3
refs/heads/master
2020-03-19T11:23:47.000077
2018-04-26T02:26:48
2018-04-26T02:26:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,475
java
package com.alipay.api.response; import com.alipay.api.internal.mapping.ApiField; import com.alipay.api.AlipayResponse; /** * ALIPAY API: alipay.eco.mycar.order.status.query response. * * @author auto create * @since 1.0, 2017-09-15 16:29:09 */ public class AlipayEcoMycarOrderStatusQueryResponse extends AlipayResponse { private static final long serialVersionUID = 3764238286718447161L; /** * 支付宝交易流水号订单 */ @ApiField("alipay_order_id") private String alipayOrderId; /** * 车平台订单 */ @ApiField("car_order_id") private String carOrderId; /** * 设备商订单id */ @ApiField("equipment_order_id") private String equipmentOrderId; /** * 支付金额 */ @ApiField("pay_money") private String payMoney; /** * 支付状态 */ @ApiField("pay_status") private String payStatus; /** * 支付的时间,格式"yyyy-MM-ddHH:mm:ss" */ @ApiField("pay_time") private String payTime; /** * 支付方式(1为支付宝在线缴费,2为支付宝代扣缴费) */ @ApiField("pay_type") private String payType; /** * 返回状态 1为成功 0为失败 */ @ApiField("status") private String status; public void setAlipayOrderId(String alipayOrderId) { this.alipayOrderId = alipayOrderId; } public String getAlipayOrderId( ) { return this.alipayOrderId; } public void setCarOrderId(String carOrderId) { this.carOrderId = carOrderId; } public String getCarOrderId( ) { return this.carOrderId; } public void setEquipmentOrderId(String equipmentOrderId) { this.equipmentOrderId = equipmentOrderId; } public String getEquipmentOrderId( ) { return this.equipmentOrderId; } public void setPayMoney(String payMoney) { this.payMoney = payMoney; } public String getPayMoney( ) { return this.payMoney; } public void setPayStatus(String payStatus) { this.payStatus = payStatus; } public String getPayStatus( ) { return this.payStatus; } public void setPayTime(String payTime) { this.payTime = payTime; } public String getPayTime( ) { return this.payTime; } public void setPayType(String payType) { this.payType = payType; } public String getPayType( ) { return this.payType; } public void setStatus(String status) { this.status = status; } public String getStatus( ) { return this.status; } }
[ "xiangyu.zhang@foxmail.com" ]
xiangyu.zhang@foxmail.com
26f1704b6af89d1f81eefa71aa2196c5b7629ad6
9a22b89e5906db0c5ae0130f88b915dd6e0cf9e6
/src/examples/java/org/nodex/examples/pubsub/PubSubServer.java
814e298c318190f5e7f973272dfff5fe9dd36424
[]
no_license
puneetlakhina/node.x
8bae7242dcb92391934350035edd81bc53e8a0a3
8e79a9a51cf9c2aea3efd9e6ff835db9270fb7ed
refs/heads/master
2021-01-17T23:53:44.490169
2011-08-15T07:09:07
2011-08-15T07:09:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,257
java
/* * Copyright 2002-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use * this file except in compliance with the License. You may obtain a copy of the * License at http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ package org.nodex.examples.pubsub; import org.nodex.core.Nodex; import org.nodex.core.buffer.Buffer; import org.nodex.core.buffer.DataHandler; import org.nodex.core.net.NetConnectHandler; import org.nodex.core.net.NetServer; import org.nodex.core.net.NetSocket; import org.nodex.core.parsetools.RecordParser; import org.nodex.core.shared.SharedData; import org.nodex.core.shared.SharedMap; import org.nodex.core.shared.SharedSet; import java.util.Set; public class PubSubServer { public static void main(String[] args) throws Exception { NetServer server = new NetServer(new NetConnectHandler() { public void onConnect(final NetSocket socket) { socket.dataHandler(RecordParser.newDelimited("\n", new DataHandler () { public void onData(Buffer frame) { String line = frame.toString().trim(); System.out.println("Got line: " + line); String[] parts = line.split("\\,"); if (line.startsWith("subscribe")) { Set<Long> set = SharedData.<Long>getSet(parts[1]); set.add(socket.writeActorID); } else if (line.startsWith("unsubscribe")) { SharedData.<Long>getSet(parts[1]).remove(socket.writeActorID); } else if (line.startsWith("publish")) { Set<Long> actorIDs = SharedData.getSet(parts[1]); for (Long actorID: actorIDs) { Nodex.instance.sendMessage(actorID, Buffer.create(parts[2])); } } } })); } }).listen(8080); System.out.println("Any key to exit"); System.in.read(); server.close(); } }
[ "timvolpe@gmail.com" ]
timvolpe@gmail.com
743fb3816d79b4adbdc50172cae3d1496050b639
0ad97606734eb050b7d3fd6c02ceab9b1515c812
/JdbcTemplate/JdbcDaoSupport/src/main/repository/BaseRepository.java
d4be1d6826c082607269e43f3ae561f96fc35ee5
[ "Apache-2.0" ]
permissive
scp504677840/Spring
93fab34c65be1fa8d31c151c512ff140997efac3
75bd622d0a5950bf2c6e69772da50c08e310e1a4
refs/heads/master
2020-03-21T13:13:38.922425
2018-06-29T07:46:51
2018-06-29T07:46:51
138,594,135
0
0
null
null
null
null
UTF-8
Java
false
false
352
java
package main.repository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.support.JdbcDaoSupport; import javax.sql.DataSource; public class BaseRepository<T> extends JdbcDaoSupport { @Autowired public void setDataSource2(DataSource dataSource){ setDataSource(dataSource); } }
[ "15335747148@163.com" ]
15335747148@163.com
ae92b82e4b073a0ddbd2045735d0a8a4ea937911
038ee6b20cae51169a2ed4ed64a7b8e99b5cbaad
/schemaOrgDomaConv/src/org/kyojo/schemaorg/m3n4/doma/healthLifesci/container/BackgroundConverter.java
ccf883d3f1568095ed3f7a7af3ea43c778b7005a
[ "Apache-2.0" ]
permissive
nagaikenshin/schemaOrg
3dec1626781913930da5585884e3484e0b525aea
4c9d6d098a2741c2dc2a814f1c708ee55c36e9a8
refs/heads/master
2021-06-25T04:52:49.995840
2019-05-12T06:22:37
2019-05-12T06:22:37
134,319,974
1
0
null
null
null
null
UTF-8
Java
false
false
592
java
package org.kyojo.schemaorg.m3n4.doma.healthLifesci.container; import org.seasar.doma.ExternalDomain; import org.seasar.doma.jdbc.domain.DomainConverter; import org.kyojo.schemaorg.m3n4.healthLifesci.impl.BACKGROUND; import org.kyojo.schemaorg.m3n4.healthLifesci.Container.Background; @ExternalDomain public class BackgroundConverter implements DomainConverter<Background, String> { @Override public String fromDomainToValue(Background domain) { return domain.getNativeValue(); } @Override public Background fromValueToDomain(String value) { return new BACKGROUND(value); } }
[ "nagai@nagaikenshin.com" ]
nagai@nagaikenshin.com
aa1a4be0f165644beea1372aed6c6c6f6e8ace40
85cfc652459ca2f015aa8c8dc55240721632cee0
/bin/platform/bootstrap/gensrc/de/hybris/platform/cmswebservices/data/NamedQueryData.java
d7d44602dd83ab9f30d9435dad8fe15217e30540
[]
no_license
varshadhamal/Hybris-test
43e5479b9909e41e6276dfde6b4f4ff1cdae9b0e
a29c6090680110ab733e2077772c9c477d497df6
refs/heads/master
2020-03-18T06:31:01.940494
2018-05-22T11:58:12
2018-05-22T11:58:12
134,400,503
0
1
null
null
null
null
UTF-8
Java
false
false
2,688
java
/* * ---------------------------------------------------------------- * --- WARNING: THIS FILE IS GENERATED AND WILL BE OVERWRITTEN! * --- Generated at May 4, 2018 2:52:05 AM * ---------------------------------------------------------------- * * [y] hybris Platform * * Copyright (c) 2000-2016 SAP SE * All rights reserved. * * This software is the confidential and proprietary information of SAP * Hybris ("Confidential Information"). You shall not disclose such * Confidential Information and shall use it only in accordance with the * terms of the license agreement you entered into with SAP Hybris. */ package de.hybris.platform.cmswebservices.data; public class NamedQueryData implements java.io.Serializable { /** <i>Generated property</i> for <code>NamedQueryData.namedQuery</code> property defined at extension <code>cmswebservices</code>. */ private String namedQuery; /** <i>Generated property</i> for <code>NamedQueryData.params</code> property defined at extension <code>cmswebservices</code>. */ private String params; /** <i>Generated property</i> for <code>NamedQueryData.sort</code> property defined at extension <code>cmswebservices</code>. */ private String sort; /** <i>Generated property</i> for <code>NamedQueryData.pageSize</code> property defined at extension <code>cmswebservices</code>. */ private String pageSize; /** <i>Generated property</i> for <code>NamedQueryData.currentPage</code> property defined at extension <code>cmswebservices</code>. */ private String currentPage; /** <i>Generated property</i> for <code>NamedQueryData.queryType</code> property defined at extension <code>cmswebservices</code>. */ private Class<?> queryType; public NamedQueryData() { // default constructor } public void setNamedQuery(final String namedQuery) { this.namedQuery = namedQuery; } public String getNamedQuery() { return namedQuery; } public void setParams(final String params) { this.params = params; } public String getParams() { return params; } public void setSort(final String sort) { this.sort = sort; } public String getSort() { return sort; } public void setPageSize(final String pageSize) { this.pageSize = pageSize; } public String getPageSize() { return pageSize; } public void setCurrentPage(final String currentPage) { this.currentPage = currentPage; } public String getCurrentPage() { return currentPage; } public void setQueryType(final Class<?> queryType) { this.queryType = queryType; } public Class<?> getQueryType() { return queryType; } }
[ "varsha.d.saste@accenture.com" ]
varsha.d.saste@accenture.com
d6e21ee2463c34a8865672f44a1b0aebe9e99136
3e4773789d9fa7d0bbc43dfb7bf3862e633352e1
/java/src/libbun/ast/binary/AssignNode.java
72cb62473de73b31f062e102e5bec5406420e6f7
[ "BSD-2-Clause" ]
permissive
libbun/libbun
6bd92825ae40e485e923bc12b3feb4a7b9d57ec9
7d6df79241b29eb2a2d3a6f762b793f782078fe8
refs/heads/master
2021-01-13T02:36:52.263069
2014-05-13T19:35:30
2014-05-13T19:35:30
17,765,705
0
0
BSD-2-Clause
2022-11-24T09:59:53
2014-03-15T01:35:34
JavaScript
UTF-8
Java
false
false
799
java
package libbun.ast.binary; import libbun.ast.AstNode; import libbun.ast.expression.GetNameNode; import libbun.lang.bun.BunPrecedence; import libbun.parser.classic.LibBunVisitor; public class AssignNode extends BinaryOperatorNode { public AssignNode(AstNode ParentNode) { super(ParentNode, BunPrecedence._CStyleAssign); } public AssignNode(String Name, AstNode RightNode) { super(null, BunPrecedence._CStyleAssign); this.SetLeftNode(new GetNameNode(null, Name)); this.SetRightNode(RightNode); } @Override public AstNode dup(boolean typedClone, AstNode ParentNode) { return this.dupField(typedClone, new AssignNode(ParentNode)); } @Override public String GetOperator() { return "="; } @Override public void Accept(LibBunVisitor Visitor) { Visitor.VisitAssignNode(this); } }
[ "kimio@konohascript.org" ]
kimio@konohascript.org
17df69ae6933fbc7636dde1575b5d01c404a1659
05e5bee54209901d233f4bfa425eb6702970d6ab
/com/avaje/ebeaninternal/server/text/json/ReadJsonContext.java
045baa388ea6881fe24a2708e316202520d3f13e
[]
no_license
TheShermanTanker/PaperSpigot-1.7.10
23f51ff301e7eb05ef6a3d6999dd2c62175c270f
ea9d33bcd075e00db27b7f26450f9dc8e6d18262
refs/heads/master
2022-12-24T10:32:09.048106
2020-09-25T15:43:22
2020-09-25T15:43:22
298,614,646
0
1
null
null
null
null
UTF-8
Java
false
false
7,249
java
/* */ package com.avaje.ebeaninternal.server.text.json; /* */ /* */ import com.avaje.ebean.bean.EntityBean; /* */ import com.avaje.ebean.bean.EntityBeanIntercept; /* */ import com.avaje.ebean.text.json.JsonElement; /* */ import com.avaje.ebean.text.json.JsonReadBeanVisitor; /* */ import com.avaje.ebean.text.json.JsonReadOptions; /* */ import com.avaje.ebean.text.json.JsonValueAdapter; /* */ import com.avaje.ebeaninternal.server.deploy.BeanDescriptor; /* */ import com.avaje.ebeaninternal.server.util.ArrayStack; /* */ import java.beans.PropertyChangeEvent; /* */ import java.beans.PropertyChangeListener; /* */ import java.util.HashSet; /* */ import java.util.LinkedHashMap; /* */ import java.util.Map; /* */ import java.util.Set; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public class ReadJsonContext /* */ extends ReadBasicJsonContext /* */ { /* */ private final Map<String, JsonReadBeanVisitor<?>> visitorMap; /* */ private final JsonValueAdapter valueAdapter; /* */ private final PathStack pathStack; /* */ private final ArrayStack<ReadBeanState> beanState; /* */ private ReadBeanState currentState; /* */ /* */ public ReadJsonContext(ReadJsonSource src, JsonValueAdapter dfltValueAdapter, JsonReadOptions options) { /* 50 */ super(src); /* 51 */ this.beanState = new ArrayStack(); /* 52 */ if (options == null) { /* 53 */ this.valueAdapter = dfltValueAdapter; /* 54 */ this.visitorMap = null; /* 55 */ this.pathStack = null; /* */ } else { /* 57 */ this.valueAdapter = getValueAdapter(dfltValueAdapter, options.getValueAdapter()); /* 58 */ this.visitorMap = options.getVisitorMap(); /* 59 */ this.pathStack = (this.visitorMap == null || this.visitorMap.isEmpty()) ? null : new PathStack(); /* */ } /* */ } /* */ /* */ private JsonValueAdapter getValueAdapter(JsonValueAdapter dfltValueAdapter, JsonValueAdapter valueAdapter) { /* 64 */ return (valueAdapter == null) ? dfltValueAdapter : valueAdapter; /* */ } /* */ /* */ public JsonValueAdapter getValueAdapter() { /* 68 */ return this.valueAdapter; /* */ } /* */ /* */ /* */ public String readScalarValue() { /* 73 */ ignoreWhiteSpace(); /* */ /* 75 */ char prevChar = nextChar(); /* 76 */ if ('"' == prevChar) { /* 77 */ return readQuotedValue(); /* */ } /* 79 */ return readUnquotedValue(prevChar); /* */ } /* */ /* */ /* */ public void pushBean(Object bean, String path, BeanDescriptor<?> beanDescriptor) { /* 84 */ this.currentState = new ReadBeanState(bean, beanDescriptor); /* 85 */ this.beanState.push(this.currentState); /* 86 */ if (this.pathStack != null) { /* 87 */ this.pathStack.pushPathKey(path); /* */ } /* */ } /* */ /* */ public ReadBeanState popBeanState() { /* 92 */ if (this.pathStack != null) { /* 93 */ String path = (String)this.pathStack.peekWithNull(); /* 94 */ JsonReadBeanVisitor<?> beanVisitor = this.visitorMap.get(path); /* 95 */ if (beanVisitor != null) { /* 96 */ this.currentState.visit((JsonReadBeanVisitor)beanVisitor); /* */ } /* 98 */ this.pathStack.pop(); /* */ } /* */ /* */ /* */ /* */ /* 104 */ ReadBeanState s = this.currentState; /* */ /* 106 */ this.beanState.pop(); /* 107 */ this.currentState = (ReadBeanState)this.beanState.peekWithNull(); /* 108 */ return s; /* */ } /* */ /* */ public void setProperty(String propertyName) { /* 112 */ this.currentState.setLoaded(propertyName); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public JsonElement readUnmappedJson(String key) { /* 124 */ JsonElement rawJsonValue = ReadJsonRawReader.readJsonElement(this); /* 125 */ if (this.visitorMap != null) { /* 126 */ this.currentState.addUnmappedJson(key, rawJsonValue); /* */ } /* 128 */ return rawJsonValue; /* */ } /* */ /* */ public static class ReadBeanState /* */ implements PropertyChangeListener { /* */ private final Object bean; /* */ private final BeanDescriptor<?> beanDescriptor; /* */ private final EntityBeanIntercept ebi; /* */ private final Set<String> loadedProps; /* */ private Map<String, JsonElement> unmapped; /* */ /* */ private ReadBeanState(Object bean, BeanDescriptor<?> beanDescriptor) { /* 140 */ this.bean = bean; /* 141 */ this.beanDescriptor = beanDescriptor; /* 142 */ if (bean instanceof EntityBean) { /* 143 */ this.ebi = ((EntityBean)bean)._ebean_getIntercept(); /* 144 */ this.loadedProps = new HashSet<String>(); /* */ } else { /* 146 */ this.ebi = null; /* 147 */ this.loadedProps = null; /* */ } /* */ } /* */ public String toString() { /* 151 */ return this.bean.getClass().getSimpleName() + " loaded:" + this.loadedProps; /* */ } /* */ /* */ /* */ /* */ /* */ public void setLoaded(String propertyName) { /* 158 */ if (this.ebi != null) { /* 159 */ this.loadedProps.add(propertyName); /* */ } /* */ } /* */ /* */ private void addUnmappedJson(String key, JsonElement value) { /* 164 */ if (this.unmapped == null) { /* 165 */ this.unmapped = new LinkedHashMap<String, JsonElement>(); /* */ } /* 167 */ this.unmapped.put(key, value); /* */ } /* */ /* */ /* */ /* */ /* */ private <T> void visit(JsonReadBeanVisitor<T> beanVisitor) { /* 174 */ if (this.ebi != null) { /* 175 */ this.ebi.addPropertyChangeListener(this); /* */ } /* 177 */ beanVisitor.visit(this.bean, this.unmapped); /* 178 */ if (this.ebi != null) { /* 179 */ this.ebi.removePropertyChangeListener(this); /* */ } /* */ } /* */ /* */ public void setLoadedState() { /* 184 */ if (this.ebi != null) /* */ { /* 186 */ this.beanDescriptor.setLoadedProps(this.ebi, this.loadedProps); /* */ } /* */ } /* */ /* */ public void propertyChange(PropertyChangeEvent evt) { /* 191 */ String propName = evt.getPropertyName(); /* 192 */ this.loadedProps.add(propName); /* */ } /* */ /* */ public Object getBean() { /* 196 */ return this.bean; /* */ } /* */ } /* */ } /* Location: D:\Paper-1.7.10\PaperSpigot-1.7.10-R0.1-SNAPSHOT-latest.jar!\com\avaje\ebeaninternal\server\text\json\ReadJsonContext.class * Java compiler version: 5 (49.0) * JD-Core Version: 1.1.3 */
[ "tanksherman27@gmail.com" ]
tanksherman27@gmail.com
2b0b054cd5b431f96b131dc33a8c6749d9c47c48
7d0f81b6a106a12273691ede231953d6878fa4bc
/schedfox/Schedfox/src/main/java/rmischedule/employee/security/EmployeeSecurityPanel.java
d894cc615d5675edc4ae43a4431b2b098aaeef19
[]
no_license
nitinguptaetz/schedfoxnitin
2f178e945462f2823aaac095b6bd98720930c5a1
2f3f54f2e9a93cc7958688b3ca0740e9dbe68867
refs/heads/master
2021-01-14T10:58:22.249402
2015-05-25T23:59:28
2015-05-25T23:59:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,223
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * EmployeeSecurityPanel.java * * Created on May 22, 2010, 4:20:45 PM */ package rmischedule.employee.security; import java.util.Hashtable; import java.util.Iterator; import javax.swing.JCheckBox; import javax.swing.JPanel; import rmischedule.components.graphicalcomponents.GenericEditSubForm; import rmischedule.security.security_detail; import rmischedule.security.security_detail.EMPLOYEE_SEC; import schedfoxlib.model.util.Record_Set; import rmischeduleserver.mysqlconnectivity.queries.GeneralQueryFormat; import rmischeduleserver.mysqlconnectivity.queries.employee.security.get_security_settings_for_emp_group_query; import rmischeduleserver.mysqlconnectivity.queries.employee.security.save_security_groups_settings_query; /** * * @author user */ public class EmployeeSecurityPanel extends GenericEditSubForm { private EmployeeSecurityGroups empGroups; private Hashtable<Integer, JCheckBox> chks; /** Creates new form EmployeeSecurityPanel */ public EmployeeSecurityPanel(EmployeeSecurityGroups empGroups) { initComponents(); chks = new Hashtable<Integer, JCheckBox>(); this.empGroups = empGroups; } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { setLayout(new javax.swing.BoxLayout(this, javax.swing.BoxLayout.Y_AXIS)); }// </editor-fold>//GEN-END:initComponents @Override public GeneralQueryFormat getQuery(boolean isSelected) { get_security_settings_for_emp_group_query updateQuery = new get_security_settings_for_emp_group_query(); updateQuery.update(this.myparent.getMyIdForSave()); return updateQuery; } @Override public GeneralQueryFormat getSaveQuery(boolean isNewData) { save_security_groups_settings_query saveQuery = new save_security_groups_settings_query(); Hashtable<Integer, Integer> values = new Hashtable<Integer, Integer>(); Iterator<Integer> checks = chks.keySet().iterator(); while (checks.hasNext()) { Integer currCheckInt = checks.next(); JCheckBox currCheck = chks.get(currCheckInt); if (currCheck.isSelected()) { values.put(currCheckInt, 1); } } try { saveQuery.update(Integer.parseInt(this.myparent.getMyIdForSave()), values); } catch (Exception e) {} return saveQuery; } @Override public void loadData(Record_Set rs) { this.removeAll(); chks.clear(); Hashtable<Integer, Integer> values = new Hashtable<Integer, Integer>(); if (rs.length() > 0) { do { values.put(rs.getInt("security_setting"), rs.getInt("employee_security_group_id")); } while (rs.moveNext()); } for (EMPLOYEE_SEC m : security_detail.EMPLOYEE_SEC.values()) { int v = m.getVal() + 1; Integer val = values.get(v); if (val == null) { val = new Integer(0); } else { val = v; } IndSecuritySettingPanel indPanel = new IndSecuritySettingPanel(m, val); chks.put(m.getVal(), indPanel.getCheckBox()); this.add(indPanel); } } @Override public boolean needsMoreRecordSets() { return false; } @Override public String getMyTabTitle() { return "Security Settings"; } @Override public JPanel getMyForm() { return this; } @Override public void doOnClear() { this.removeAll(); chks.clear(); } @Override public boolean userHasAccess() { return true; } // Variables declaration - do not modify//GEN-BEGIN:variables // End of variables declaration//GEN-END:variables }
[ "raj.jsp@gmail.com" ]
raj.jsp@gmail.com
d3b6ac199501c90fbb588143b9f3ddb07fc57760
b06b46d61f548315fab7aed8030dbb2b53d16f5d
/qtiworks-jqtiplus/src/main/java/uk/ac/ed/ph/jqtiplus/node/test/outcome/processing/ProcessOutcomeValue.java
ae40f94211730f1decfe8486d326a78bf7d8122e
[ "BSD-3-Clause" ]
permissive
davemckain/qtiworks
7e3af1f37182d374d44bbcf7206f218e1785013a
f1465aad49d575f7fc44ff9eaae3d0d57a323abb
refs/heads/master
2023-01-05T04:26:02.922223
2023-01-04T11:29:04
2023-01-04T11:29:04
4,086,423
57
48
NOASSERTION
2022-10-28T08:18:29
2012-04-20T12:48:06
Java
UTF-8
Java
false
false
4,399
java
/* Copyright (c) 2012-2013, University of Edinburgh. * 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 University of Edinburgh 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. * * * This software is derived from (and contains code from) QTItools and MathAssessEngine. * QTItools is (c) 2008, University of Southampton. * MathAssessEngine is (c) 2010, University of Edinburgh. */ package uk.ac.ed.ph.jqtiplus.node.test.outcome.processing; import uk.ac.ed.ph.jqtiplus.attribute.value.IdentifierAttribute; import uk.ac.ed.ph.jqtiplus.group.expression.ExpressionGroup; import uk.ac.ed.ph.jqtiplus.node.QtiNode; import uk.ac.ed.ph.jqtiplus.node.expression.AbstractExpression; import uk.ac.ed.ph.jqtiplus.node.expression.Expression; import uk.ac.ed.ph.jqtiplus.node.expression.ExpressionParent; import uk.ac.ed.ph.jqtiplus.types.Identifier; import uk.ac.ed.ph.jqtiplus.validation.ValidationContext; import java.util.List; /** * Abstract parent for setOutcomeValue and lookupOutcomeValue classes. * * @author Jiri Kajaba */ public abstract class ProcessOutcomeValue extends OutcomeRule implements ExpressionParent { private static final long serialVersionUID = 5260534524056284173L; /** Name of identifier attribute in xml schema. */ public static final String ATTR_IDENTIFIER_NAME = "identifier"; public ProcessOutcomeValue(final QtiNode parent, final String qtiClassName) { super(parent, qtiClassName); getAttributes().add(new IdentifierAttribute(this, ATTR_IDENTIFIER_NAME, true)); getNodeGroups().add(new ExpressionGroup(this, 1, 1)); } @Override public final String computeXPathComponent() { final Identifier identifier = getIdentifier(); if (identifier != null) { return getQtiClassName() + "[@identifier=\"" + identifier + "\"]"; } return super.computeXPathComponent(); } public Identifier getIdentifier() { return getAttributes().getIdentifierAttribute(ATTR_IDENTIFIER_NAME).getComputedValue(); } public void setIdentifier(final Identifier identifier) { getAttributes().getIdentifierAttribute(ATTR_IDENTIFIER_NAME).setValue(identifier); } @Override public List<Expression> getExpressions() { return getNodeGroups().getExpressionGroup().getExpressions(); } public Expression getExpression() { return getNodeGroups().getExpressionGroup().getExpression(); } public void setExpression(final Expression expression) { getNodeGroups().getExpressionGroup().setExpression(expression); } @Override protected void validateThis(final ValidationContext context) { super.validateThis(context); AbstractExpression.validateChildExpressionSignatures(this, context); final Identifier referenceIdentifier = getIdentifier(); if (referenceIdentifier!=null) { context.checkLocalVariableReference(this, referenceIdentifier); } } }
[ "david.mckain@ed.ac.uk" ]
david.mckain@ed.ac.uk
2ca72395f5fcad28c731c3fa19ae21f69a0878dc
ef8e7192cc0366cad6aec24fb00187d7e1bc954d
/comet/CometLauncher_free/src/com/iLoong/launcher/Desktop3D/GuidXinShou.java
f43454c383d1540b4c4362270681e8ce9a392fd5
[]
no_license
srsman/daima111
44c89d430d5e296f01663fcf02627ccc4a0ab8fd
b8c1fb8a75d390f6542c53eaec9e46c6c505f022
refs/heads/master
2021-01-22T16:31:23.754703
2015-03-26T05:40:59
2015-03-26T05:40:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,654
java
package com.iLoong.launcher.Desktop3D; import android.view.KeyEvent; import aurelienribon.tweenengine.BaseTween; import aurelienribon.tweenengine.Timeline; import aurelienribon.tweenengine.TweenCallback; import aurelienribon.tweenengine.equations.Cubic; import com.iLoong.launcher.UI3DEngine.Utils3D; import com.iLoong.launcher.UI3DEngine.View3D; import com.iLoong.launcher.UI3DEngine.ViewGroup3D; import com.iLoong.launcher.tween.View3DTweenAccessor; public class GuidXinShou extends ViewGroup3D { public static final int MSG_HIDE_ADD_VIEW = 0; private int mWidth; private int mHeight; private View3D beijing = null; private GuidXinSHouList xinshoulist; private View3D dian1 = null; private View3D dian2 = null; private View3D dian3 = null; private View3D dian4 = null; private View3D dian5 = null; public static View3D dian_click = null; private float scaleFactor; public GuidXinShou( String name ) { super( name ); mWidth = Utils3D.getScreenWidth(); mHeight = Utils3D.getScreenHeight(); scaleFactor = Utils3D.getScreenWidth() / 720f; beijing = new View3D( "beijing" , R3D.findRegion( "beijing" ) ); beijing.setPosition( 0 , 0 ); beijing.setSize( mWidth , beijing.height * scaleFactor ); this.addView( beijing ); xinshoulist = new GuidXinSHouList( "nppage" ); this.addView( xinshoulist ); dian1 = new View3D( "dian1" , R3D.findRegion( "dian" ) ); dian1.setPosition( 290 * scaleFactor , 82 * scaleFactor ); dian1.setSize( dian1.width * scaleFactor , dian1.height * scaleFactor ); this.addView( dian1 ); dian2 = new View3D( "dian2" , R3D.findRegion( "dian" ) ); dian2.setPosition( 320 * scaleFactor , 82 * scaleFactor ); dian2.setSize( dian2.width * scaleFactor , dian2.height * scaleFactor ); this.addView( dian2 ); dian3 = new View3D( "dian3" , R3D.findRegion( "dian" ) ); dian3.setPosition( 350 * scaleFactor , 82 * scaleFactor ); dian3.setSize( dian3.width * scaleFactor , dian3.height * scaleFactor ); this.addView( dian3 ); dian4 = new View3D( "dian4" , R3D.findRegion( "dian" ) ); dian4.setPosition( 380 * scaleFactor , 82 * scaleFactor ); dian4.setSize( dian4.width * scaleFactor , dian4.height * scaleFactor ); this.addView( dian4 ); dian5 = new View3D( "dian5" , R3D.findRegion( "dian" ) ); dian5.setPosition( 410 * scaleFactor , 82 * scaleFactor ); dian5.setSize( dian5.width * scaleFactor , dian5.height * scaleFactor ); this.addView( dian5 ); dian_click = new View3D( "dian_click" , R3D.findRegion( "dian_click" ) ); dian_click.setPosition( 290 * scaleFactor , 82 * scaleFactor ); dian_click.setSize( dian_click.width * scaleFactor , dian_click.height * scaleFactor ); this.addView( dian_click ); } private GuidXinShou addEditMode = null; private Timeline lasttween = null; @Override public boolean keyDown( int keycode ) { if( keycode == KeyEvent.KEYCODE_BACK ) { addEditMode = (GuidXinShou)Root3D.getInstance().findView( "guid" ); if( addEditMode != null ) { lasttween = Timeline.createSequence(); lasttween.push( addEditMode.obtainTween( View3DTweenAccessor.POS_XY , Cubic.OUT , 1f , -mWidth , 0 , 0 ) ); lasttween.start( View3DTweenAccessor.manager ).setCallback( this ); } return true; } return super.keyDown( keycode ); } @Override public void onEvent( int type , BaseTween source ) { if( type == TweenCallback.COMPLETE && source == lasttween ) { if( addEditMode != null ) { addEditMode.releaseFocus(); addEditMode.disposeRecursive(); Root3D.getInstance().removeView( addEditMode ); System.gc(); } return; } super.onEvent( type , source ); } }
[ "liangxiaoling@cooee.cn" ]
liangxiaoling@cooee.cn
5a823591f3cc324122bae6d91499eaca73e141ac
b5738a31b1ded8ae4e75c60c2be5d6e806a54388
/flow-master/src/main/java/jaxe/equations/element/MathOver.java
735a1482e485e25c60a7c20d1d1b7322030d288c
[]
no_license
niu0403/SDN-based-PubSub-System
c5f0f2e963942a9813e3a47a7a943af7567f6245
f098ff193eb23e2202d4dd035a21938ce73c5290
refs/heads/master
2021-01-14T12:10:24.629881
2015-10-08T11:30:31
2015-10-08T11:30:31
42,570,095
0
0
null
2015-09-16T06:50:38
2015-09-16T06:50:37
null
ISO-8859-1
Java
false
false
5,272
java
/* Jaxe - Editeur XML en Java Copyright (C) 2003 Observatoire de Paris-Meudon Ce programme est un logiciel libre ; vous pouvez le redistribuer et/ou le modifier conformément aux dispositions de la Licence Publique Générale GNU, telle que publiée par la Free Software Foundation ; version 2 de la licence, ou encore (à votre choix) toute version ultérieure. Ce programme est distribué dans l'espoir qu'il sera utile, mais SANS AUCUNE GARANTIE ; sans même la garantie implicite de COMMERCIALISATION ou D'ADAPTATION A UN OBJET PARTICULIER. Pour plus de détail, voir la Licence Publique Générale GNU . Vous devez avoir reçu un exemplaire de la Licence Publique Générale GNU en même temps que ce programme ; si ce n'est pas le cas, écrivez à la Free Software Foundation Inc., 675 Mass Ave, Cambridge, MA 02139, Etats-Unis. */ package jaxe.equations.element; import java.awt.Graphics; /** * This class arrange a element over an other element * * @author <a href="mailto:stephan@vern.chem.tu-berlin.de">Stephan Michels</a> * @author <a href="mailto:sielaff@vern.chem.tu-berlin.de">Marco Sielaff</a> * @version %I%, %G% */ public class MathOver extends MathElement { /** The XML element from this class */ public final static String ELEMENT = "mover"; private boolean accent = false; /** * Add a math element as a child * * @param child Math element */ @Override public void addMathElement(final MathElement child) { super.addMathElement(child); if (child != null) { if (getMathElementCount() == 2 && !accent) child.setFontSize(getFontSize() - 2); else child.setFontSize(getFontSize()); } } /** * Sets the font size for this component * * @param fontsize Font size */ @Override public void setFontSize(final int fontsize) { super.setFontSize(fontsize); if (getMathElement(1) != null && !accent) getMathElement(1).setFontSize(getFontSize()-2); } /** * Paints this element * * @param g The graphics context to use for painting * @param posX The first left position for painting * @param posY The position of the baseline */ @Override public void paint(final Graphics g, final int posX, final int posY) { final MathElement e1 = getMathElement(0); final MathElement e2 = getMathElement(1); final int width = getWidth(true); e1.paint(g, posX + (width - e1.getWidth(true)) / 2, posY); if (accent) { int h; if (e1 instanceof MathText || e1 instanceof MathIdentifier) h = e1.getRealAscentHeight(g) + 3; else h = e1.getAscentHeight(true); e2.paint(g, posX + (width - e2.getWidth(true)) / 2, posY - h); } else e2.paint(g, posX + (width - e2.getWidth(true)) / 2, posY - (e1.getAscentHeight(true) + e2.getDescentHeight(true))); } /** * Return the current width of this element * * @param dynamicParts Should be true, if the calculation consider the elements, * which has not fixed sizes * * @return Width of this element */ @Override public int getWidth(final boolean dynamicParts) { return Math.max(getMathElement(0).getWidth(dynamicParts), getMathElement(1).getWidth(dynamicParts)); } /** * Return the current height of this element * * @param dynamicParts Should be true, if the calculation consider the elements, * which has not fixed sizes * * @return Height of this element */ @Override public int getHeight(final boolean dynamicParts) { if (accent) return getMathElement(0).getHeight(dynamicParts) + getMathElement(1).getAscentHeight(dynamicParts) + 1; else return getMathElement(0).getHeight(dynamicParts) + getMathElement(1).getHeight(dynamicParts); } /** * Return the current height of the upper part * of this component from the baseline * * @param dynamicParts Should be true, if the calculation consider the elements, * which has not fixed sizes * * @return Height of the upper part */ @Override public int getAscentHeight(final boolean dynamicParts) { if (accent) return getMathElement(0).getAscentHeight(true) + getMathElement(1).getAscentHeight(true); else return getMathElement(0).getAscentHeight(true) + getMathElement(1).getHeight(true); } /** * Return the current height of the lower part * of this component from the baseline * * @param dynamicParts Should be true, if the calculation consider the elements, * which has not fixed sizes * * @return Height of the lower part */ @Override public int getDescentHeight(final boolean dynamicParts) { return getMathElement(0).getDescentHeight(true); } public void setAccent(final boolean accent) { this.accent = accent; } public boolean getAccent() { return accent; } }
[ "mikezang625@gmail.com" ]
mikezang625@gmail.com
d45aeae13994f23cb941e6c0f96059a4ed167fc5
5c8cdc4f433b7658e31fffd5adf7175d6bad9d30
/mate-examples/seata-example/seata-order-example/src/main/java/vip/mate/seata/order/service/impl/OrderServiceImpl.java
56b645fe63502bc3c478d48744cf44c2e8107281
[ "Apache-2.0" ]
permissive
matevip/matecloud
9e603dde9be212f045549332d76a18a171297714
3a39a7a7090850b5936068f228dd58d73960410e
refs/heads/dev
2023-09-03T12:41:19.704337
2023-07-30T02:05:17
2023-07-30T02:05:17
218,435,426
1,438
427
Apache-2.0
2023-06-22T11:17:52
2019-10-30T03:25:43
Java
UTF-8
Java
false
false
463
java
package vip.mate.seata.order.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; import vip.mate.seata.order.entity.Order; import vip.mate.seata.order.mapper.OrderMapper; import vip.mate.seata.order.service.IOrderService; /** * 订单业务实现类 * * @author pangu */ @Service public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements IOrderService { }
[ "7333791@qq.com" ]
7333791@qq.com
a92b12fe0bed201400e279dafa422e6e39afce64
9b8c54d9cc6675620f725a85505e23e73b773a00
/src/org/benf/cfr/reader/bytecode/analysis/parse/rewriters/XorRewriter.java
3400c4042298fc8070dd27a461e0d2a9629862ae
[ "MIT" ]
permissive
leibnitz27/cfr
d54db8d56a1e7cffe720f2144f9b7bba347afd90
d6f6758ee900ae1a1fffebe2d75c69ce21237b2a
refs/heads/master
2023-08-24T14:56:50.161997
2022-08-12T07:17:41
2022-08-12T07:20:06
19,706,727
1,758
252
MIT
2022-08-12T07:19:26
2014-05-12T16:39:42
Java
UTF-8
Java
false
false
2,402
java
package org.benf.cfr.reader.bytecode.analysis.parse.rewriters; import org.benf.cfr.reader.bytecode.analysis.parse.Expression; import org.benf.cfr.reader.bytecode.analysis.parse.LValue; import org.benf.cfr.reader.bytecode.analysis.parse.StatementContainer; import org.benf.cfr.reader.bytecode.analysis.parse.expression.*; import org.benf.cfr.reader.bytecode.analysis.parse.lvalue.StackSSALabel; import org.benf.cfr.reader.bytecode.analysis.parse.utils.SSAIdentifiers; public class XorRewriter implements ExpressionRewriter { public XorRewriter() { } @Override public Expression rewriteExpression(Expression expression, SSAIdentifiers ssaIdentifiers, StatementContainer statementContainer, ExpressionRewriterFlags flags) { if (expression instanceof ArithmeticOperation) { ArithmeticOperation arithmeticOperation = (ArithmeticOperation) expression; if (arithmeticOperation.isXorM1()) { expression = arithmeticOperation.getReplacementXorM1(); } } return expression.applyExpressionRewriter(this, ssaIdentifiers, statementContainer, flags); } @Override public void handleStatement(StatementContainer statementContainer) { } @Override public ConditionalExpression rewriteExpression(ConditionalExpression expression, SSAIdentifiers ssaIdentifiers, StatementContainer statementContainer, ExpressionRewriterFlags flags) { Expression res = expression.applyExpressionRewriter(this, ssaIdentifiers, statementContainer, flags); return (ConditionalExpression) res; } // @Override // public AbstractAssignmentExpression rewriteExpression(AbstractAssignmentExpression expression, SSAIdentifiers ssaIdentifiers, StatementContainer statementContainer, ExpressionRewriterFlags flags) { // Expression res = expression.applyExpressionRewriter(this, ssaIdentifiers, statementContainer, flags); // return (AbstractAssignmentExpression) res; // } @Override public LValue rewriteExpression(LValue lValue, SSAIdentifiers ssaIdentifiers, StatementContainer statementContainer, ExpressionRewriterFlags flags) { return lValue; } @Override public StackSSALabel rewriteExpression(StackSSALabel lValue, SSAIdentifiers ssaIdentifiers, StatementContainer statementContainer, ExpressionRewriterFlags flags) { return lValue; } }
[ "lee@benf.org" ]
lee@benf.org
e6e92fd38b07e5259f73dc6155c5749675595a6b
ae5eb1a38b4d22c82dfd67c86db73592094edc4b
/project21/src/test/java/org/gradle/test/performance/largejavamultiproject/project21/p106/Test2120.java
477bb37b32965532e358c26d731e62888d3cf81e
[]
no_license
big-guy/largeJavaMultiProject
405cc7f55301e1fd87cee5878a165ec5d4a071aa
1cd6a3f9c59e9b13dffa35ad27d911114f253c33
refs/heads/main
2023-03-17T10:59:53.226128
2021-03-04T01:01:39
2021-03-04T01:01:39
344,307,977
0
0
null
null
null
null
UTF-8
Java
false
false
2,436
java
package org.gradle.test.performance.largejavamultiproject.project21.p106; import org.gradle.test.performance.largejavamultiproject.project21.p105.Production2117; import org.gradle.test.performance.largejavamultiproject.project21.p105.Production2118; import org.gradle.test.performance.largejavamultiproject.project21.p105.Production2119; import org.junit.Test; import static org.junit.Assert.*; public class Test2120 { Production2120 objectUnderTest = new Production2120(); @Test public void testProperty0() { Production2117 value = new Production2117(); objectUnderTest.setProperty0(value); assertEquals(value, objectUnderTest.getProperty0()); } @Test public void testProperty1() { Production2118 value = new Production2118(); objectUnderTest.setProperty1(value); assertEquals(value, objectUnderTest.getProperty1()); } @Test public void testProperty2() { Production2119 value = new Production2119(); objectUnderTest.setProperty2(value); assertEquals(value, objectUnderTest.getProperty2()); } @Test public void testProperty3() { String value = "value"; objectUnderTest.setProperty3(value); assertEquals(value, objectUnderTest.getProperty3()); } @Test public void testProperty4() { String value = "value"; objectUnderTest.setProperty4(value); assertEquals(value, objectUnderTest.getProperty4()); } @Test public void testProperty5() { String value = "value"; objectUnderTest.setProperty5(value); assertEquals(value, objectUnderTest.getProperty5()); } @Test public void testProperty6() { String value = "value"; objectUnderTest.setProperty6(value); assertEquals(value, objectUnderTest.getProperty6()); } @Test public void testProperty7() { String value = "value"; objectUnderTest.setProperty7(value); assertEquals(value, objectUnderTest.getProperty7()); } @Test public void testProperty8() { String value = "value"; objectUnderTest.setProperty8(value); assertEquals(value, objectUnderTest.getProperty8()); } @Test public void testProperty9() { String value = "value"; objectUnderTest.setProperty9(value); assertEquals(value, objectUnderTest.getProperty9()); } }
[ "sterling.greene@gmail.com" ]
sterling.greene@gmail.com
04432f16229e49fea4945315a87ee3af86da2506
736fef3dcf85164cf103976e1753c506eb13ae09
/seccon_2015/Reverse-Engineering Android APK 1/files/source/src/android/support/v4/view/LayoutInflaterCompat.java
dc6aaac6eac55aa3921bc2c720d888757eb29f54
[ "MIT" ]
permissive
Hamz-a/MyCTFWriteUps
4b7dac9a7eb71fceb7d83966dc63cf4e5a796007
ffa98e4c096ff1751f5f729d0ec882e079a6b604
refs/heads/master
2021-01-10T17:46:10.014480
2018-04-01T22:14:31
2018-04-01T22:14:31
47,495,748
3
1
null
null
null
null
UTF-8
Java
false
false
2,390
java
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package android.support.v4.view; import android.view.LayoutInflater; // Referenced classes of package android.support.v4.view: // LayoutInflaterFactory, LayoutInflaterCompatBase, LayoutInflaterCompatHC, LayoutInflaterCompatLollipop public class LayoutInflaterCompat { static interface LayoutInflaterCompatImpl { public abstract void setFactory(LayoutInflater layoutinflater, LayoutInflaterFactory layoutinflaterfactory); } static class LayoutInflaterCompatImplBase implements LayoutInflaterCompatImpl { public void setFactory(LayoutInflater layoutinflater, LayoutInflaterFactory layoutinflaterfactory) { LayoutInflaterCompatBase.setFactory(layoutinflater, layoutinflaterfactory); } LayoutInflaterCompatImplBase() { } } static class LayoutInflaterCompatImplV11 extends LayoutInflaterCompatImplBase { public void setFactory(LayoutInflater layoutinflater, LayoutInflaterFactory layoutinflaterfactory) { LayoutInflaterCompatHC.setFactory(layoutinflater, layoutinflaterfactory); } LayoutInflaterCompatImplV11() { } } static class LayoutInflaterCompatImplV21 extends LayoutInflaterCompatImplV11 { public void setFactory(LayoutInflater layoutinflater, LayoutInflaterFactory layoutinflaterfactory) { LayoutInflaterCompatLollipop.setFactory(layoutinflater, layoutinflaterfactory); } LayoutInflaterCompatImplV21() { } } static final LayoutInflaterCompatImpl IMPL; private LayoutInflaterCompat() { } public static void setFactory(LayoutInflater layoutinflater, LayoutInflaterFactory layoutinflaterfactory) { IMPL.setFactory(layoutinflater, layoutinflaterfactory); } static { int i = android.os.Build.VERSION.SDK_INT; if (i >= 21) { IMPL = new LayoutInflaterCompatImplV21(); } else if (i >= 11) { IMPL = new LayoutInflaterCompatImplV11(); } else { IMPL = new LayoutInflaterCompatImplBase(); } } }
[ "dzcyberdev@gmail.com" ]
dzcyberdev@gmail.com
17e631968a8101186daa992b308b82a90570a9ca
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/6/6_517d9a41831b2487cf8e36be42f5a29edb5a5629/Capturer/6_517d9a41831b2487cf8e36be42f5a29edb5a5629_Capturer_t.java
807958bbf941b05207fb1bb2cad84765d5cb8532
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
6,746
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package webcamstudio.media.renderer; import java.awt.image.BufferedImage; import java.io.DataInputStream; import java.io.IOException; import java.net.ServerSocket; import java.net.Socket; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.IntBuffer; import java.util.logging.Level; import java.util.logging.Logger; import webcamstudio.mixers.Frame; import webcamstudio.streams.Stream; import webcamstudio.util.Tools; /** * * @author patrick */ public class Capturer { private int vport = 0; private int aport = 0; private boolean stopMe = false; private Stream stream; private int audioBufferSize = 0; private int videoBufferSize = 0; private ServerSocket videoServer = null; private ServerSocket audioServer = null; private Frame frame = null; private BufferedImage lastImage = null; public Capturer(Stream s) { stream = s; audioBufferSize = (44100 * 2 * 2) / stream.getRate(); videoBufferSize = stream.getCaptureWidth() * stream.getCaptureHeight() * 4; frame = new Frame(stream.getID(), null, null); if (stream.hasAudio()) { try { audioServer = new ServerSocket(0); aport = audioServer.getLocalPort(); } catch (IOException ex) { Logger.getLogger(Capturer.class.getName()).log(Level.SEVERE, null, ex); } } if (stream.hasVideo()) { try { videoServer = new ServerSocket(0); vport = videoServer.getLocalPort(); } catch (IOException ex) { Logger.getLogger(Capturer.class.getName()).log(Level.SEVERE, null, ex); } } System.out.println("Port used is Video:" + vport + "/Audio:" + aport); System.out.println("Size: " + stream.getCaptureWidth() + "X" + stream.getCaptureHeight()); Thread vCapture = new Thread(new Runnable() { @Override public void run() { Socket connection = null; try { connection = videoServer.accept(); System.out.println(stream.getName() + " video accepted..."); DataInputStream din = new DataInputStream(connection.getInputStream()); long mark = 0; // long count = 0; while (!stopMe) { try { // count++; mark = System.currentTimeMillis(); videoBufferSize = stream.getCaptureWidth() * stream.getCaptureHeight() * 4; byte[] vbuffer = new byte[videoBufferSize]; int[] rgb = new int[videoBufferSize / 4]; BufferedImage image = new BufferedImage(stream.getCaptureWidth(), stream.getCaptureHeight(), BufferedImage.TYPE_INT_ARGB); din.readFully(vbuffer); IntBuffer intData = ByteBuffer.wrap(vbuffer).order(ByteOrder.BIG_ENDIAN).asIntBuffer(); intData.get(rgb); //Special Effects... image.setRGB(0, 0, stream.getCaptureWidth(), stream.getCaptureHeight(), rgb, 0, stream.getCaptureWidth()); lastImage = image; Tools.wait(1000/stream.getRate(), mark); // if (count == stream.getRate()){ // System.out.println("Video Frame " + System.currentTimeMillis()); // count=0; // } } catch (IOException ioe) { stopMe = true; //ioe.printStackTrace(); } } din.close(); } catch (IOException ex) { Logger.getLogger(Capturer.class.getName()).log(Level.SEVERE, null, ex); } } }); vCapture.setPriority(Thread.MIN_PRIORITY); if (stream.hasVideo()) { vCapture.start(); } Thread aCapture = new Thread(new Runnable() { @Override public void run() { try { Socket connection = audioServer.accept(); System.out.println(stream.getName() + " audio accepted..."); DataInputStream din = new DataInputStream(connection.getInputStream()); long mark = 0; while (!stopMe) { try { mark=System.currentTimeMillis(); audioBufferSize = (44100 * 2 * 2) / stream.getRate(); byte[] abuffer = new byte[audioBufferSize]; din.readFully(abuffer); frame = new Frame(stream.getID(), lastImage, abuffer); frame.setOutputFormat(stream.getX(), stream.getY(), stream.getWidth(), stream.getHeight(), stream.getOpacity(), stream.getVolume()); frame.setZOrder(stream.getZOrder()); Tools.wait(1000/stream.getRate(), mark); } catch (IOException ioe) { stopMe = true; //ioe.printStackTrace(); } } din.close(); } catch (IOException ex) { Logger.getLogger(Capturer.class.getName()).log(Level.SEVERE, null, ex); } } }); aCapture.setPriority(Thread.MIN_PRIORITY); if (stream.hasAudio()) { aCapture.start(); } } public void abort() { try { if (videoServer != null) { videoServer.close(); videoServer=null; } if (audioServer != null) { audioServer.close(); audioServer=null; } } catch (IOException ex) { Logger.getLogger(Capturer.class.getName()).log(Level.SEVERE, null, ex); } } public int getVideoPort() { return vport; } public int getAudioPort() { return aport; } public Frame getFrame() { return frame; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
2d2acbcae250f6225c9e4a2d86d49a8f3942a55a
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/LANG-6b-1-16-NSGA_II-WeightedSum:TestLen:CallDiversity/org/apache/commons/lang3/text/translate/CharSequenceTranslator_ESTest.java
e4df894b44e6cfcbaf2ec96705b9da095b6c0a4c
[]
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
590
java
/* * This file was automatically generated by EvoSuite * Sat Jan 18 20:47:29 UTC 2020 */ package org.apache.commons.lang3.text.translate; 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 CharSequenceTranslator_ESTest extends CharSequenceTranslator_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
7bd7237dc522dc056973b4a8b0b8dfd0a0f0bf1c
56d1c5242e970ca0d257801d4e627e2ea14c8aeb
/src/com/csms/leetcode/number/other/other/LeetcodeMST_05.java
904b4c1ea20352e62348863e8f6467a08d33ecb7
[]
no_license
dai-zi/leetcode
e002b41f51f1dbd5c960e79624e8ce14ac765802
37747c2272f0fb7184b0e83f052c3943c066abb7
refs/heads/master
2022-12-14T11:20:07.816922
2020-07-24T03:37:51
2020-07-24T03:37:51
282,111,073
0
0
null
null
null
null
UTF-8
Java
false
false
668
java
package com.csms.leetcode.number.other.other; //替换空格 //简单 public class LeetcodeMST_05 { public String replaceSpace(String s) { int length = s.length(); char[] array = new char[length * 3]; int size = 0; for (int i = 0; i < length; i++) { char c = s.charAt(i); if (c == ' ') { array[size++] = '%'; array[size++] = '2'; array[size++] = '0'; } else { array[size++] = c; } } String newStr = new String(array, 0, size); return newStr; } public static void main(String[] args) { } }
[ "liuxiaotongdaizi@sina.com" ]
liuxiaotongdaizi@sina.com
1673292526646b73ed346481a76b8cdecbb61040
4f9ebffb4d17b651016800af90b9089f85607199
/concursus-mapping/src/main/java/com/opencredo/concursus/mapping/events/methods/state/DispatchingStateRepository.java
23060a3c1c009e3dac5feced16c9a33ef3d333b7
[ "MIT" ]
permissive
enekofb/concursus
66f2ec84a45f7b41d26fa884597f33c266d1c5f5
05b7e4317a2337044d522783669290e1a837f562
refs/heads/master
2021-09-03T14:46:33.302528
2018-01-09T22:13:24
2018-01-09T22:13:24
116,876,807
0
0
null
2018-01-09T22:13:54
2018-01-09T22:13:54
null
UTF-8
Java
false
false
1,861
java
package com.opencredo.concursus.mapping.events.methods.state; import com.opencredo.concursus.domain.events.sourcing.EventSource; import com.opencredo.concursus.domain.events.state.StateBuilder; import com.opencredo.concursus.domain.events.state.EventSourcingStateRepository; import com.opencredo.concursus.domain.events.state.StateRepository; import com.opencredo.concursus.mapping.events.methods.reflection.StateClassInfo; import java.util.function.Supplier; /** * Utility class which constructs a {@link StateRepository} which uses a {@link DispatchingStateBuilder} to construct * state objects. */ public final class DispatchingStateRepository { private DispatchingStateRepository() { } /** * Create a {@link StateRepository}, drawing on the supplied {@link EventSource}, which uses a {@link DispatchingStateBuilder} * to construct state objects of the given class. * @param eventSource The {@link EventSource} to retrieve events from. * @param stateClass The class of the state objects to construct. * @param <T> The type of the state objects to construct. * @return The constructed {@link StateRepository}. */ public static <T> StateRepository<T> using(EventSource eventSource, Class<? extends T> stateClass) { StateClassInfo<T> stateClassInfo = StateClassInfo.forStateClass(stateClass); final Supplier<StateBuilder<T>> aggregateStateBuilderSupplier = () -> DispatchingStateBuilder.dispatching( stateClassInfo.getInitialEventDispatcher(), stateClassInfo.getUpdateEventDispatcher()); return EventSourcingStateRepository.using( aggregateStateBuilderSupplier, eventSource, stateClassInfo.getEventTypeBinding(), stateClassInfo.getCausalOrder()); } }
[ "dominic.fox@opencredo.com" ]
dominic.fox@opencredo.com
c283cbf25ef851fc54311c52524a21f23c001a2f
0af8b92686a58eb0b64e319b22411432aca7a8f3
/single-large-project/src/test/java/org/gradle/test/performancenull_500/Testnull_49903.java
abbbc31f62743481b98b12af0df3e4789d7a447e
[]
no_license
gradle/performance-comparisons
b0d38db37c326e0ce271abebdb3c91769b860799
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
refs/heads/master
2023-08-14T19:24:39.164276
2022-11-24T05:18:33
2022-11-24T05:18:33
80,121,268
17
15
null
2022-09-30T08:04:35
2017-01-26T14:25:33
null
UTF-8
Java
false
false
308
java
package org.gradle.test.performancenull_500; import static org.junit.Assert.*; public class Testnull_49903 { private final Productionnull_49903 production = new Productionnull_49903("value"); @org.junit.Test public void test() { assertEquals(production.getProperty(), "value"); } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
7aa6df05f46999ca3803fc4ff5d1aa69c3da4f72
3814d5882b6521fadb7a018a5fe1f57244012bf4
/app/models/uk/org/siri/siri/FramedVehicleJourneyRefStructure.java
492b58a7085afa0adc8acf80b204a806155dc9d5
[]
no_license
sergmor/busteller
d41692cf2bd6e1c30e985401ac7290c6adb91440
b3f9802a1fd217f920c8bcf1ad72bdae4c1ab5b4
refs/heads/master
2021-01-01T16:31:19.876063
2014-04-30T23:43:15
2014-04-30T23:43:15
18,954,897
2
0
null
null
null
null
UTF-8
Java
false
false
3,068
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2010.11.14 at 03:28:36 PM PST // package models.uk.org.siri.siri; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; /** * Type for Identifer of a MonitoredVehicleJourney within data Horizon of a service * * <p>Java class for FramedVehicleJourneyRefStructure complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="FramedVehicleJourneyRefStructure"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="DataFrameRef" type="{http://www.siri.org.uk/siri}DataFrameRefStructure"/> * &lt;element name="DatedVehicleJourneyRef" type="{http://www.siri.org.uk/siri}DatedVehicleJourneyCodeType"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "FramedVehicleJourneyRefStructure", propOrder = { "dataFrameRef", "datedVehicleJourneyRef" }) public class FramedVehicleJourneyRefStructure { @XmlElement(name = "DataFrameRef", required = true) protected DataFrameRefStructure dataFrameRef; @XmlElement(name = "DatedVehicleJourneyRef", required = true) @XmlJavaTypeAdapter(CollapsedStringAdapter.class) protected String datedVehicleJourneyRef; /** * Gets the value of the dataFrameRef property. * * @return * possible object is * {@link DataFrameRefStructure } * */ public DataFrameRefStructure getDataFrameRef() { return dataFrameRef; } /** * Sets the value of the dataFrameRef property. * * @param value * allowed object is * {@link DataFrameRefStructure } * */ public void setDataFrameRef(DataFrameRefStructure value) { this.dataFrameRef = value; } /** * Gets the value of the datedVehicleJourneyRef property. * * @return * possible object is * {@link String } * */ public String getDatedVehicleJourneyRef() { return datedVehicleJourneyRef; } /** * Sets the value of the datedVehicleJourneyRef property. * * @param value * allowed object is * {@link String } * */ public void setDatedVehicleJourneyRef(String value) { this.datedVehicleJourneyRef = value; } }
[ "sdm2162@columbia.edu" ]
sdm2162@columbia.edu
e3cbf0e2091b2abec9664641b6180658e0bfe510
430f53a4f8296768277c3adffd35877fb656e0ad
/multi-thread/quasar-demo/src/cn/zxf/quasar/demo1/TwoChannel.java
982f63d214b5b5e8324e4f372317649169f87abc
[]
no_license
zengxf/small-frame-demo
064053c946ed164f3b24276061cfb45c0ff3bb0b
fc121d1940734b18b3703e7e663e0db271347da4
refs/heads/master
2023-08-18T19:33:23.398280
2023-08-14T07:43:50
2023-08-14T07:43:50
178,111,745
2
1
null
2021-06-07T18:27:20
2019-03-28T02:36:19
Java
UTF-8
Java
false
false
1,080
java
package cn.zxf.quasar.demo1; import java.util.concurrent.ExecutionException; import co.paralleluniverse.fibers.Fiber; import co.paralleluniverse.fibers.SuspendExecution; import co.paralleluniverse.strands.channels.Channel; import co.paralleluniverse.strands.channels.Channels; public class TwoChannel { public static void main( String[] args ) throws ExecutionException, InterruptedException, SuspendExecution { // 定义两个Channel Channel<Integer> naturals = Channels.newChannel( -1 ); Channel<Integer> squares = Channels.newChannel( -1 ); // 运行两个Fiber实现. new Fiber<>( () -> { for ( int i = 0; i < 10; i++ ) naturals.send( i ); naturals.close(); } ).start(); new Fiber<>( () -> { Integer v; while ( ( v = naturals.receive() ) != null ) squares.send( v * v ); squares.close(); } ).start(); printer( squares ); } private static void printer( Channel<Integer> in ) throws SuspendExecution, InterruptedException { Integer v; while ( ( v = in.receive() ) != null ) { System.out.println( v ); } } }
[ "fl_zxf@163.com" ]
fl_zxf@163.com
8e0c92de87ce205110d14f888effebb036c4853b
4c3c31f897b2d60c9b9974038854a04287363060
/src/main/java/com/company/project/web/DeShopController.java
1ecd13b0061914370de3f2f9837c9d0d5e61d6ba
[]
no_license
jackycaojiaqi/spring-boot-api-project-seed
370f348e51361eea476c49080d63aa73ba546b68
cf462516512096526bba00bc68d5169d3bf5eee5
refs/heads/master
2020-03-11T18:19:48.982572
2018-05-24T02:26:01
2018-05-24T02:26:01
130,174,499
0
0
null
null
null
null
UTF-8
Java
false
false
2,262
java
package com.company.project.web; import com.company.project.core.Result; import com.company.project.core.ResultGenerator; import com.company.project.model.DeShop; import com.company.project.service.DeShopService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; import org.springframework.beans.BeanUtils; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; import java.util.logging.LogManager; /** * Created by CodeGenerator on 2018/04/19. */ @RestController @RequestMapping("/de/shop") public class DeShopController { @Resource private DeShopService deShopService; @ApiOperation(value = "新增店铺", notes = "根据Shop对象创建店铺") @PostMapping("/add") public Result add(DeShop deShop) { deShopService.save(deShop); return ResultGenerator.genSuccessResult(); } @PostMapping("/delete") public Result delete(@RequestParam Integer id) { deShopService.deleteById(id); return ResultGenerator.genSuccessResult(); } @PostMapping("/update") public Result update(DeShop deShop) { deShopService.update(deShop); return ResultGenerator.genSuccessResult(); } @PostMapping("/detail") public Result detail(@RequestParam Integer id) { Log.i("1212121"); Log.e("哈哈哈"); Log.d("哈哈哈"); DeShop deShop = deShopService.findById(id); return ResultGenerator.genSuccessResult(deShop); } @ApiOperation(value = "查看店铺列表", notes = "查看所有的店铺") @PostMapping("/list") public Result list(@RequestParam(defaultValue = "0") Integer page, @RequestParam(defaultValue = "0") Integer size) { PageHelper.startPage(page, size); List<DeShop> list = deShopService.findAll(); PageInfo pageInfo = new PageInfo(list); return ResultGenerator.genSuccessResult(pageInfo); } }
[ "353938360@qq.com" ]
353938360@qq.com
bf817c31a6397fb6ebf60918fea52561371629f2
8bc41e1a19b37a19d5cf9e1c06c5a7ce206ff70e
/network/franken-servlet-api/src/main/java/javax/servlet/HttpConstraintElement.java
0dd9781dd6ce12327ffb6cb60e7ba20404782c7f
[]
no_license
pkseop/franken
5121449f406da7ad30764f8e77f01bd23ac53664
bbb4c736c35a0c5e6ba04d0845a3e4926848e1dd
refs/heads/master
2021-01-22T01:11:21.956563
2017-09-02T15:48:45
2017-09-02T15:48:45
102,206,586
0
0
null
null
null
null
UTF-8
Java
false
false
6,500
java
/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright 2008-2009 Sun Microsystems, Inc. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can obtain * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. * Sun designates this particular file as subject to the "Classpath" exception * as provided by Sun in the GPL Version 2 section of the License file that * accompanied this code. If applicable, add the following below the License * Header, with the fields enclosed by brackets [] replaced by your own * identifying information: "Portions Copyrighted [year] * [name of copyright owner]" * * Contributor(s): * * If you wish your version of this file to be governed by only the CDDL or * only the GPL Version 2, indicate your decision by adding "[Contributor] * elects to include this software in this distribution under the [CDDL or GPL * Version 2] license." If you don't indicate a single choice of license, a * recipient has the option to distribute your version of this file under * either the CDDL, the GPL Version 2 or to extend the choice of license to * its licensees as provided above. However, if you add GPL Version 2 code * and therefore, elected the GPL Version 2 license, then the option applies * only if the new code is made subject to such option by the copyright * holder. */ package javax.servlet; import java.util.*; import javax.servlet.annotation.HttpConstraint; import javax.servlet.annotation.ServletSecurity.EmptyRoleSemantic; import javax.servlet.annotation.ServletSecurity.TransportGuarantee; /** * Java Class representation of an {@link HttpConstraint} annotation value. * * @since Servlet 3.0 */ public class HttpConstraintElement { private EmptyRoleSemantic emptyRoleSemantic; private TransportGuarantee transportGuarantee; private String[] rolesAllowed; /** * Constructs a default HTTP constraint element */ public HttpConstraintElement() { this(EmptyRoleSemantic.PERMIT); } /** * Convenience constructor to establish <tt>EmptyRoleSemantic.DENY</tt> * * @param semantic should be EmptyRoleSemantic.DENY */ public HttpConstraintElement(EmptyRoleSemantic semantic) { this(semantic, TransportGuarantee.NONE, new String[0]); } /** * Constructor to establish non-empty getRolesAllowed and/or * <tt>TransportGuarantee.CONFIDENTIAL</tt>. * * @param guarantee <tt>TransportGuarantee.NONE</tt> or * <tt>TransportGuarantee.CONFIDENTIAL</tt> * @param roleNames the names of the roles that are to be * allowed access */ public HttpConstraintElement(TransportGuarantee guarantee, String... roleNames) { this(EmptyRoleSemantic.PERMIT, guarantee, roleNames); } /** * Constructor to establish all of getEmptyRoleSemantic, * getRolesAllowed, and getTransportGuarantee. * * @param semantic <tt>EmptyRoleSemantic.DENY</tt> or * <tt>EmptyRoleSemantic.PERMIT</tt> * @param guarantee <tt>TransportGuarantee.NONE</tt> or * <tt>TransportGuarantee.CONFIDENTIAL<tt> * @param roleNames the names of the roles that are to be allowed * access, or missing if the semantic is <tt>EmptyRoleSemantic.DENY</tt> */ public HttpConstraintElement(EmptyRoleSemantic semantic, TransportGuarantee guarantee, String... roleNames) { if (semantic == EmptyRoleSemantic.DENY && roleNames.length > 0) { throw new IllegalArgumentException( "Deny semantic with rolesAllowed"); } this.emptyRoleSemantic = semantic; this.transportGuarantee = guarantee; this.rolesAllowed = roleNames; } /** * Gets the default authorization semantic. * * <p>This value is insignificant when <code>getRolesAllowed</code> * returns a non-empty array, and should not be specified when a * non-empty array is specified for <tt>getRolesAllowed<tt>. * * @return the {@link EmptyRoleSemantic} to be applied when * <code>getRolesAllowed</code> returns an empty (that is, zero-length) * array */ public EmptyRoleSemantic getEmptyRoleSemantic() { return this.emptyRoleSemantic; } /** * Gets the data protection requirement (i.e., whether or not SSL/TLS is * required) that must be satisfied by the transport connection. * * @return the {@link TransportGuarantee} indicating the data * protection that must be provided by the connection */ public TransportGuarantee getTransportGuarantee() { return this.transportGuarantee; } /** * Gets the names of the authorized roles. * * <p>Duplicate role names appearing in getRolesAllowed are insignificant * and may be discarded. The String <tt>"*"</tt> has no special meaning * as a role name (should it occur in getRolesAllowed). * * @return a (possibly empty) array of role names. When the * array is empty, its meaning depends on the value of * {@link #getEmptyRoleSemantic}. If its value is <tt>DENY</tt>, * and <code>getRolesAllowed</code> returns an empty array, * access is to be denied independent of authentication state and * identity. Conversely, if its value is <code>PERMIT</code>, it * indicates that access is to be allowed independent of authentication * state and identity. When the array contains the names of one or * more roles, it indicates that access is contingent on membership in at * least one of the named roles (independent of the value of * {@link #getEmptyRoleSemantic}). */ public String[] getRolesAllowed() { return this.rolesAllowed; } }
[ "patchboys@MacBook-Pro.local" ]
patchboys@MacBook-Pro.local
246cafe4759fcb01bfce5dbeb07ead520406b445
3bf0de3aec6366a667a6465dc135f7abfe9ca638
/src/main/java/org/asciidoc/intellij/pasteProvider/AsciiDocPasteImageProvider.java
e08b3d03edc688e09c899b9cb8c9c67b857529f2
[ "Apache-2.0" ]
permissive
asciidoctor/asciidoctor-intellij-plugin
4a46dcf7abc573699e9bbcd98c11de5d235c672e
d1bab3d15e8a25b8434522654972919ea9f57cb8
refs/heads/main
2023-09-05T15:38:08.042574
2023-09-04T23:14:23
2023-09-05T05:35:00
11,637,399
325
177
Apache-2.0
2023-09-07T05:26:17
2013-07-24T14:54:35
Java
UTF-8
Java
false
false
3,610
java
package org.asciidoc.intellij.pasteProvider; import com.intellij.ide.PasteProvider; import com.intellij.openapi.actionSystem.ActionManager; import com.intellij.openapi.actionSystem.ActionPlaces; import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.CommonDataKeys; import com.intellij.openapi.actionSystem.DataContext; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.editor.actions.PasteAction; import com.intellij.psi.PsiFile; import org.asciidoc.intellij.actions.asciidoc.PasteImageAction; import org.asciidoc.intellij.file.AsciiDocFileType; import org.jetbrains.annotations.NotNull; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.Transferable; import java.awt.datatransfer.UnsupportedFlavorException; import java.io.File; import java.io.IOException; import java.util.List; import java.util.Locale; import java.util.Objects; public class AsciiDocPasteImageProvider implements PasteProvider { @Override public void performPaste(@NotNull DataContext dataContext) { final Editor editor = CommonDataKeys.EDITOR.getData(dataContext); if (editor == null) { return; } AnAction action = ActionManager.getInstance().getAction(PasteImageAction.ID); if (action != null) { action.actionPerformed(AnActionEvent.createFromDataContext(ActionPlaces.UNKNOWN, null, dataContext)); } } /** * Find out if this one should handle paste. * Will not be called for files copied externally (for example from Windows explorer), but will be called for files copied from IntelliJ. */ @Override public boolean isPastePossible(@NotNull DataContext dataContext) { final Editor editor = CommonDataKeys.EDITOR.getData(dataContext); final PsiFile file = CommonDataKeys.PSI_FILE.getData(dataContext); if (editor == null) { return false; } if (file == null) { return false; } if (file.getFileType() != AsciiDocFileType.INSTANCE) { return false; } Transferable produce = Objects.requireNonNull(dataContext.getData(PasteAction.TRANSFERABLE_PROVIDER)).produce(); if (produce.isDataFlavorSupported(DataFlavor.getTextPlainUnicodeFlavor())) { /* if the contents are text, prefer standard paste operation before trying to paste it as an image the user can still try the "paste-as-image" operation from the editor toolbar */ return false; } if (produce.isDataFlavorSupported(DataFlavor.imageFlavor)) { return true; } if (produce.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) { java.util.List<File> fileList; try { //noinspection unchecked fileList = (List<File>) produce.getTransferData(DataFlavor.javaFileListFlavor); } catch (UnsupportedFlavorException | IOException e) { return false; } //noinspection ConstantConditions -- as this if (fileList == null) { throw new IllegalStateException("The class implementation of " + produce.getClass().getName() + " did return null for getTransferData() when it shouldn't. Please report to authors!"); } for (File f : fileList) { String name = f.getName().toLowerCase(Locale.ROOT); if (name.endsWith(".png") || name.endsWith(".svg") || name.endsWith(".jpg") || name.endsWith(".jpeg") || name.endsWith(".gif")) { return true; } } } return false; } @Override public boolean isPasteEnabled(@NotNull DataContext dataContext) { return isPastePossible(dataContext); } }
[ "alexander.schwartz@gmx.net" ]
alexander.schwartz@gmx.net
6d4c8379592aa37af0ed44e15d7ee777da31ffab
2a19b2f3eb1ed8a5393676724c77b4f03206dad8
/src/main/java/org/acord/standards/life/_2/OLILUREDEMPTION.java
71c588857143e8ae94ef64d0dfdceb7ca9b81598
[]
no_license
SamratChatterjee/xsdTowsdl
489777c2d7d66e8e5379fec49dffe15a19cb5650
807f1c948490f2c021dd401ff9dd5937688a24b2
refs/heads/master
2021-05-15T03:45:56.250598
2017-11-15T10:55:24
2017-11-15T10:55:24
110,820,957
0
0
null
null
null
null
UTF-8
Java
false
false
2,299
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2017.11.13 at 07:49:02 PM IST // package org.acord.standards.life._2; import java.math.BigInteger; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlValue; /** * <p>Java class for OLI_LU_REDEMPTION complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="OLI_LU_REDEMPTION"> * &lt;simpleContent> * &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string"> * &lt;attribute name="tc" use="required" type="{http://ACORD.org/Standards/Life/2}OLI_LU_REDEMPTION_TC" /> * &lt;/extension> * &lt;/simpleContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "OLI_LU_REDEMPTION", propOrder = { "value" }) public class OLILUREDEMPTION { @XmlValue protected String value; @XmlAttribute(name = "tc", required = true) protected BigInteger tc; /** * Gets the value of the value property. * * @return * possible object is * {@link String } * */ public String getValue() { return value; } /** * Sets the value of the value property. * * @param value * allowed object is * {@link String } * */ public void setValue(String value) { this.value = value; } /** * Gets the value of the tc property. * * @return * possible object is * {@link BigInteger } * */ public BigInteger getTc() { return tc; } /** * Sets the value of the tc property. * * @param value * allowed object is * {@link BigInteger } * */ public void setTc(BigInteger value) { this.tc = value; } }
[ "33487722+SamratChatterjee@users.noreply.github.com" ]
33487722+SamratChatterjee@users.noreply.github.com
eeb879fc0bcc63be9513a41f2d793e87d2216386
96eb89b3098e2d3ed6cc13d69f66d74d0e6a92d0
/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/SpecialModelName.java
d19a20e48ba4893ed326ed766eff34dd7be5edca
[ "Apache-2.0" ]
permissive
jimschubert/openapi-generator
4be0bab81b406c8af6540cbc780b3312865c03c3
e61fe3adb786994707f6fe0b4807c870875d49ae
refs/heads/master
2021-06-02T10:19:46.179795
2018-12-01T23:42:56
2018-12-01T23:42:56
133,171,998
1
0
null
2018-05-12T18:11:33
2018-05-12T18:11:33
null
UTF-8
Java
false
false
2,434
java
/* * Swagger Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ package org.openapitools.model; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import javax.validation.constraints.*; /** * SpecialModelName */ public class SpecialModelName implements Serializable { @JsonProperty("$special[property.name]") private Long $specialPropertyName = null; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; return this; } /** * Get $specialPropertyName * @return $specialPropertyName **/ @JsonProperty("$special[property.name]") @ApiModelProperty(value = "") public Long get$SpecialPropertyName() { return $specialPropertyName; } public void set$SpecialPropertyName(Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SpecialModelName $specialModelName = (SpecialModelName) o; return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); } @Override public int hashCode() { return Objects.hash($specialPropertyName); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SpecialModelName {\n"); sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).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 "); } }
[ "wing328hk@gmail.com" ]
wing328hk@gmail.com
5be6a5fcf2b000e44d0b7c88669829406d0f37fe
25346f238005b26857afb2a635c325ffa24a95d7
/amems/src/main/java/enu/aerialmaterial/ContractDeliveryStatusEnum.java
c40bbdb0c80de12a97d1e8e3bb3c2524169dbccd
[]
no_license
xyd104449/amems
93491ff8fcf1d0650a9af764fa1fa38d7a25572a
74a0ef8dc31d27ee5d1a0e91ff4d74af47b08778
refs/heads/master
2021-09-15T03:21:15.399980
2018-05-25T03:15:58
2018-05-25T03:15:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,961
java
package enu.aerialmaterial; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map; /** * @author liub * @description 合同到货枚举 * @develop date 2016.11.04 */ public enum ContractDeliveryStatusEnum { NO_DELIVERY(1, "未到货"), PART_DELIVERY(2, "部分到货"), ALL_DELIVERY(3, "全部到货") ; private Integer id; private String name; private ContractDeliveryStatusEnum(Integer id, String name) { this.id = id; this.name = name; } public static String getName(Integer id) { for (ContractDeliveryStatusEnum c : ContractDeliveryStatusEnum.values()) { if (c.getId().intValue() == id.intValue()) { return c.name; } } return ""; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } /** * 枚举转listmap * @return */ public static List<Map<String, Object>> enumToListMap() { List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); ContractDeliveryStatusEnum[] enums = ContractDeliveryStatusEnum.values(); for (ContractDeliveryStatusEnum enumItem : enums) { Map<String, Object>map = new HashMap<String, Object>(); map.put("id", enumItem.getId()); map.put("name", enumItem.getName()); list.add(map); } Collections.sort(list, new Comparator<Map<String, Object>>() { public int compare(Map<String, Object> o1, Map<String, Object> o2) { return o1.get("name").toString().compareTo(o2.get("name").toString()) ; } }); return list; } }
[ "903654879@qq.com" ]
903654879@qq.com
5c08fc82664e697662429a519436a242b863e24b
b39d7e1122ebe92759e86421bbcd0ad009eed1db
/sources/android/media/AudioPatch.java
918059aaf0b60426de6421bfa08ec57332deae17
[]
no_license
AndSource/miuiframework
ac7185dedbabd5f619a4f8fc39bfe634d101dcef
cd456214274c046663aefce4d282bea0151f1f89
refs/heads/master
2022-03-31T11:09:50.399520
2020-01-02T09:49:07
2020-01-02T09:49:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,705
java
package android.media; import android.annotation.UnsupportedAppUsage; public class AudioPatch { @UnsupportedAppUsage private final AudioHandle mHandle; private final AudioPortConfig[] mSinks; private final AudioPortConfig[] mSources; @UnsupportedAppUsage AudioPatch(AudioHandle patchHandle, AudioPortConfig[] sources, AudioPortConfig[] sinks) { this.mHandle = patchHandle; this.mSources = sources; this.mSinks = sinks; } @UnsupportedAppUsage public AudioPortConfig[] sources() { return this.mSources; } @UnsupportedAppUsage public AudioPortConfig[] sinks() { return this.mSinks; } public int id() { return this.mHandle.id(); } public String toString() { String str; StringBuilder s = new StringBuilder(); s.append("mHandle: "); s.append(this.mHandle.toString()); s.append(" mSources: {"); AudioPortConfig[] audioPortConfigArr = this.mSources; int length = audioPortConfigArr.length; int i = 0; int i2 = 0; while (true) { str = ", "; if (i2 >= length) { break; } s.append(audioPortConfigArr[i2].toString()); s.append(str); i2++; } s.append("} mSinks: {"); audioPortConfigArr = this.mSinks; length = audioPortConfigArr.length; while (i < length) { s.append(audioPortConfigArr[i].toString()); s.append(str); i++; } s.append("}"); return s.toString(); } }
[ "shivatejapeddi@gmail.com" ]
shivatejapeddi@gmail.com
509e9b03185e9eec8461cddddd92e0b6cef82ab3
dba87418d2286ce141d81deb947305a0eaf9824f
/sources/com/google/firebase/inappmessaging/internal/injection/modules/AppMeasurementModule_ProvidesAnalyticsConnectorFactory.java
9e8f043d370b9c52ec03ff96718d8c1cc1ad1ad5
[]
no_license
Sluckson/copyOavct
1f73f47ce94bb08df44f2ba9f698f2e8589b5cf6
d20597e14411e8607d1d6e93b632d0cd2e8af8cb
refs/heads/main
2023-03-09T12:14:38.824373
2021-02-26T01:38:16
2021-02-26T01:38:16
341,292,450
0
1
null
null
null
null
UTF-8
Java
false
false
1,157
java
package com.google.firebase.inappmessaging.internal.injection.modules; import com.google.firebase.analytics.connector.AnalyticsConnector; import dagger.internal.Factory; import dagger.internal.Preconditions; public final class AppMeasurementModule_ProvidesAnalyticsConnectorFactory implements Factory<AnalyticsConnector> { private final AppMeasurementModule module; public AppMeasurementModule_ProvidesAnalyticsConnectorFactory(AppMeasurementModule appMeasurementModule) { this.module = appMeasurementModule; } public AnalyticsConnector get() { return providesAnalyticsConnector(this.module); } public static AppMeasurementModule_ProvidesAnalyticsConnectorFactory create(AppMeasurementModule appMeasurementModule) { return new AppMeasurementModule_ProvidesAnalyticsConnectorFactory(appMeasurementModule); } public static AnalyticsConnector providesAnalyticsConnector(AppMeasurementModule appMeasurementModule) { return (AnalyticsConnector) Preconditions.checkNotNull(appMeasurementModule.providesAnalyticsConnector(), "Cannot return null from a non-@Nullable @Provides method"); } }
[ "lucksonsurprice94@gmail.com" ]
lucksonsurprice94@gmail.com
e42718b00ea433d7e728cdaed0299b205a51dd3b
13c2d3db2d49c40c74c2e6420a9cd89377f1c934
/program_data/JavaProgramData/22/484.java
eca93d35b542c688a71a04494bb9a74b9f1434a4
[ "MIT" ]
permissive
qiuchili/ggnn_graph_classification
c2090fefe11f8bf650e734442eb96996a54dc112
291ff02404555511b94a4f477c6974ebd62dcf44
refs/heads/master
2021-10-18T14:54:26.154367
2018-10-21T23:34:14
2018-10-21T23:34:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
989
java
package <missing>; public class GlobalMembers { public static int Main() { int n; int a; int b; int m1; int m2; char q; String tempVar = ConsoleInput.scanfRead(); if (tempVar != null) { a = Integer.parseInt(tempVar); } m1 = a; m2 = -100; String tempVar2 = ConsoleInput.scanfRead(null, 1); if (tempVar2 != null) { q = tempVar2.charAt(0); } while (q == ',') { String tempVar3 = ConsoleInput.scanfRead(); if (tempVar3 != null) { a = Integer.parseInt(tempVar3); } String tempVar4 = ConsoleInput.scanfRead(null, 1); if (tempVar4 != null) { q = tempVar4.charAt(0); } // printf("%d %d\n",m1,m2); if (a > m1) { m2 = m1; m1 = a; } else { if ((a > m2) && (a < m1)) { m2 = a; } } } if (m2 == -100) { System.out.print("No"); } else { System.out.printf("%d\n",m2); } // scanf("%d",&a); return 0; } }
[ "y.yu@open.ac.uk" ]
y.yu@open.ac.uk
be2ab9f38493dc74491e3b3984d2a69250c45654
4ef431684e518b07288e8b8bdebbcfbe35f364e4
/elastic-tracestore/test-core/src/main/java/com/ca/apm/es/ComponentsLoadTest.java
22fc9aff822285f80b5ba1441fcea623c22598a9
[]
no_license
Sarojkswain/APMAutomation
a37c59aade283b079284cb0a8d3cbbf79f3480e3
15659ce9a0030c2e9e5b992040e05311fff713be
refs/heads/master
2020-03-30T00:43:23.925740
2018-09-27T23:42:04
2018-09-27T23:42:04
150,540,177
0
0
null
null
null
null
UTF-8
Java
false
false
1,922
java
package com.ca.apm.es; import com.fasterxml.jackson.core.JsonProcessingException; /** * Created by venpr05 on 2/21/2017. */ public class ComponentsLoadTest extends AbstractLoadTest { public ComponentsLoadTest(int bulkCount, int tCount, long duration, String esHost) { super(bulkCount, tCount, duration, esHost, "ttcomponents", "burst/ttcomponents_mapping.json"); } @Override String formSingleDocumentData() throws JsonProcessingException { EsTraceComponentData component = new EsTraceComponentData(); component.setDescription(gen.getUrl()); component.setDuration(gen.getDuration()); component.setResource(gen.getResource()); component.setStartTime(gen.getTime()); component.setTraceId(gen.getTraceId()); component.setPosId(gen.getPosId()); component.setFlags(gen.getFlags()); component.setSubNodeCount(gen.getCompCount()); component.setParameters(gen.getParameters()); return mapper.writeValueAsString(component); } public static void main(String[] args) throws Exception { int bulkCount = 1000; try { bulkCount = Integer.parseInt(System.getProperty("bulkcount")); } catch (Exception e) { bulkCount = 1000; } int tCount = 5; try { tCount = Integer.parseInt(System.getProperty("threads")); } catch (Exception e) { tCount = 5; } long duration = 30 * 60 * 1000L; try { duration = Long.parseLong(System.getProperty("durationinms")); } catch (Exception e) { duration = 30 * 60 * 1000L; } ComponentsLoadTest loadAndStoreTrace = new ComponentsLoadTest(bulkCount, tCount, duration, "localhost"); loadAndStoreTrace.createIndex(); loadAndStoreTrace.loadAndStore_SpringRest(); } }
[ "sarojkswain@gmail.com" ]
sarojkswain@gmail.com
58dea5991f61845588ec583c6cc0f9ba86a4ec22
ba7ac99921d48d8cd49c54ac54f67654c2796450
/Project51 Package/Project51 Server/src/ethos/model/players/packets/commands/all/Site.java
0f9665e247e0e61380e77e400ee0f9416372582c
[]
no_license
JacobAYoung/server
ee1052b1423942036b6c7c77f33a2109e91ce502
fd04421a6c16ce75f66556c8aeca1016a6318125
refs/heads/master
2022-11-22T22:44:10.417014
2020-07-03T02:02:06
2020-07-03T02:02:06
275,973,896
0
1
null
null
null
null
UTF-8
Java
false
false
833
java
package ethos.model.players.packets.commands.all; import java.util.Optional; import ethos.model.players.Player; import ethos.model.players.packets.commands.Command; public class Site extends Command { @Override public void execute(Player c, String input) { String[] args = input.split(" "); switch (args[0]) { case "": c.sendMessage("Usage: ::site forums"); break; case "home": c.getPA().sendFrame126("YOURLINKHERE.com", 12000); break; case "forums": c.getPA().sendFrame126("https://YOURLINKHERE.com/forums/", 12000); break; case "donate": c.getPA().sendFrame126("https://YOURLINKHERE.everythingrs.com/services/store", 12000); break; } } @Override public Optional<String> getDescription() { return Optional.of("You can visit all our different sites using this command"); } }
[ "JakeAYoung95@gmail.com" ]
JakeAYoung95@gmail.com
7af83c5fb7fc0a97e263a47c5e500a4258d31d22
e7ee311e20b40c87bf6d23a53a1d7b11fd29d2c3
/src/chosun/ciis/hd/yadjm/rec/HD_YADJM_2015_1231_LCURLISTRecord.java
91b32cb321df614066f49dc6771d62b796d1d1b8
[]
no_license
nosmoon/misdevteam
4e3695ef7bbdcd231bb84d7d8d7df54a23ff0a60
1829d5bd489eb6dd307ca244f0e183a31a1de773
refs/heads/master
2020-04-15T15:57:05.480056
2019-01-10T01:12:01
2019-01-10T01:12:01
164,812,547
1
0
null
null
null
null
UHC
Java
false
false
2,446
java
/*************************************************************************************************** * 파일명 : .java * 기능 : * 작성일자 : * 작성자 : 이태식 ***************************************************************************************************/ /*************************************************************************************************** * 수정내역 : * 수정자 : * 수정일자 : * 백업 : ***************************************************************************************************/ package chosun.ciis.hd.yadjm.rec; import java.sql.*; import chosun.ciis.hd.yadjm.dm.*; import chosun.ciis.hd.yadjm.ds.*; /** * */ public class HD_YADJM_2015_1231_LCURLISTRecord extends java.lang.Object implements java.io.Serializable{ public String bank_cd; public String account_no; public String payment; public String deduct_amt; public String adjm_rvrs_yy; public String emp_no; public String occr_dt; public String seq; public String stok_savg_type; public HD_YADJM_2015_1231_LCURLISTRecord(){} public void setBank_cd(String bank_cd){ this.bank_cd = bank_cd; } public void setAccount_no(String account_no){ this.account_no = account_no; } public void setPayment(String payment){ this.payment = payment; } public void setDeduct_amt(String deduct_amt){ this.deduct_amt = deduct_amt; } public void setAdjm_rvrs_yy(String adjm_rvrs_yy){ this.adjm_rvrs_yy = adjm_rvrs_yy; } public void setEmp_no(String emp_no){ this.emp_no = emp_no; } public void setOccr_dt(String occr_dt){ this.occr_dt = occr_dt; } public void setSeq(String seq){ this.seq = seq; } public void setStok_savg_type(String stok_savg_type){ this.stok_savg_type = stok_savg_type; } public String getBank_cd(){ return this.bank_cd; } public String getAccount_no(){ return this.account_no; } public String getPayment(){ return this.payment; } public String getDeduct_amt(){ return this.deduct_amt; } public String getAdjm_rvrs_yy(){ return this.adjm_rvrs_yy; } public String getEmp_no(){ return this.emp_no; } public String getOccr_dt(){ return this.occr_dt; } public String getSeq(){ return this.seq; } public String getStok_savg_type(){ return this.stok_savg_type; } } /* 작성시간 : Thu Jan 14 19:55:52 KST 2016 */
[ "DLCOM000@172.16.30.11" ]
DLCOM000@172.16.30.11
da9b5bff148f5114c680f7d3477cc513950774f2
1c5e8605c1a4821bc2a759da670add762d0a94a2
/easrc/markesupplier/subase/SupplierTypeCollection.java
0df7034507d93e67a7be454d2f5722619366f8ce
[]
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
UTF-8
Java
false
false
1,239
java
package com.kingdee.eas.port.markesupplier.subase; import com.kingdee.bos.dao.AbstractObjectCollection; import com.kingdee.bos.dao.IObjectPK; public class SupplierTypeCollection extends AbstractObjectCollection { public SupplierTypeCollection() { super(SupplierTypeInfo.class); } public boolean add(SupplierTypeInfo item) { return addObject(item); } public boolean addCollection(SupplierTypeCollection item) { return addObjectCollection(item); } public boolean remove(SupplierTypeInfo item) { return removeObject(item); } public SupplierTypeInfo get(int index) { return(SupplierTypeInfo)getObject(index); } public SupplierTypeInfo get(Object key) { return(SupplierTypeInfo)getObject(key); } public void set(int index, SupplierTypeInfo item) { setObject(index, item); } public boolean contains(SupplierTypeInfo item) { return containsObject(item); } public boolean contains(Object key) { return containsKey(key); } public int indexOf(SupplierTypeInfo item) { return super.indexOf(item); } }
[ "shxr_code@126.com" ]
shxr_code@126.com
4f005adcf56c94d2e9a69c5ce1e4f0baf62f0bb0
7991248e6bccacd46a5673638a4e089c8ff72a79
/backend/core/src/test/java/org/artifactory/logging/sumo/logback/SumoLogbackUpdaterTest.java
b665c6ccc35a9a8010681ea3ef8b5c9197cf66ad
[]
no_license
theoriginalshaheedra/artifactory-oss
69b7f6274cb35c79db3a3cd613302de2ae019b31
415df9a9467fee9663850b4b8b4ee5bd4c23adeb
refs/heads/master
2023-04-23T15:48:36.923648
2021-05-05T06:15:24
2021-05-05T06:15:24
364,455,815
1
0
null
2021-05-05T07:11:40
2021-05-05T03:57:33
Java
UTF-8
Java
false
false
6,752
java
/* * * Artifactory is a binaries repository manager. * Copyright (C) 2018 JFrog Ltd. * * Artifactory is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Artifactory is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with Artifactory. If not, see <http://www.gnu.org/licenses/>. * */ package org.artifactory.logging.sumo.logback; import org.apache.commons.io.FileUtils; import org.apache.commons.lang.SystemUtils; import org.artifactory.descriptor.repo.ProxyDescriptor; import org.artifactory.descriptor.sumologic.SumoLogicConfigDescriptor; import org.artifactory.logging.sumo.logback.SumoLogbackUpdater.UpdateData; import org.jfrog.common.ResourceUtils; import org.testng.SkipException; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import org.testng.reporters.Files; import java.io.File; import java.io.IOException; import static org.fest.assertions.Assertions.assertThat; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertTrue; /** * @author Shay Yaakov */ @Test public class SumoLogbackUpdaterTest { private SumoLogbackUpdater sumoLogbackUpdater; private File baseTestDir; @BeforeMethod public void createTempDir() { skipOnWindows(); baseTestDir = new File(System.getProperty("java.io.tmpdir"), "sumologictest"); baseTestDir.mkdirs(); assertTrue(baseTestDir.exists(), "Failed to create base test dir"); sumoLogbackUpdater = new SumoLogbackUpdater(); } private void skipOnWindows() { if (SystemUtils.IS_OS_WINDOWS) { throw new SkipException("Skipping test on windows OS"); } } @AfterMethod public void deleteTempDir() throws IOException { org.apache.commons.io.FileUtils.deleteDirectory(baseTestDir); } @Test public void testUpdateSumoAppenders() throws Exception { File logbackFile = new File(baseTestDir, "logback.xml"); Files.copyFile(ResourceUtils.getResource("/org/artifactory/sumologic/logback.xml"), logbackFile); // --- Add sumo appenders for the first time --- SumoLogicConfigDescriptor sumoConfig = createSumoLogicConfigDescriptor(); sumoConfig.setCollectorUrl("the-collector-url"); sumoConfig.setEnabled(true); sumoLogbackUpdater.update(logbackFile, new UpdateData(sumoConfig, "art.host", "art.node")); File expectedFile = ResourceUtils.getResourceAsFile("/org/artifactory/sumologic/logback_enabled_no_proxy.xml"); assertThat(FileUtils.readFileToString(logbackFile)).isEqualTo(FileUtils.readFileToString(expectedFile)); // --- Update sumo appenders - disable and change collector url --- sumoConfig = createSumoLogicConfigDescriptor(); sumoConfig.setCollectorUrl("the-other-collector-url"); sumoConfig.setEnabled(false); sumoLogbackUpdater.update(logbackFile, new UpdateData(sumoConfig, "art.host", "art.node")); expectedFile = ResourceUtils.getResourceAsFile("/org/artifactory/sumologic/logback_disabled_no_proxy.xml"); assertThat(FileUtils.readFileToString(logbackFile)).isEqualTo(FileUtils.readFileToString(expectedFile)); // --- Update sumo appenders - enable, change collector url and add proxy --- sumoConfig = createSumoLogicConfigDescriptor(); sumoConfig.setCollectorUrl("the-collector-url"); sumoConfig.setEnabled(true); sumoConfig.setProxy(createProxy("proxy-host", 8888)); sumoLogbackUpdater.update(logbackFile, new UpdateData(sumoConfig, "art.host", null)); expectedFile = ResourceUtils.getResourceAsFile("/org/artifactory/sumologic/logback_enabled_with_proxy.xml"); assertThat(FileUtils.readFileToString(logbackFile)).isEqualTo(FileUtils.readFileToString(expectedFile)); // --- Update sumo appenders - remove proxy --- sumoConfig = createSumoLogicConfigDescriptor(); sumoConfig.setCollectorUrl("the-collector-url"); sumoConfig.setEnabled(true); sumoConfig.setProxy(null); sumoLogbackUpdater.update(logbackFile, new UpdateData(sumoConfig, "art.host", "art.node")); expectedFile = ResourceUtils.getResourceAsFile("/org/artifactory/sumologic/logback_enabled_no_proxy.xml"); assertThat(FileUtils.readFileToString(logbackFile)).isEqualTo(FileUtils.readFileToString(expectedFile)); } @Test public void clearSumoConfig() throws IOException { File source = ResourceUtils.getResourceAsFile("/org/artifactory/sumologic/logback_enabled_no_proxy.xml"); File logbackFile = new File(baseTestDir, "logback.xml"); FileUtils.copyFile(source, logbackFile); SumoLogbackUpdater.removeSumoLogicFromXml(logbackFile); assertEquals(FileUtils.readFileToString(logbackFile), FileUtils.readFileToString( ResourceUtils.getResourceAsFile("/org/artifactory/sumologic/semi_clean_logback.xml"))); } @Test public void fixCollectorUrl() throws IOException { File source = ResourceUtils.getResourceAsFile("/org/artifactory/sumologic/logback_enabled_no_proxy.xml"); File logbackFile = new File(baseTestDir, "logback.xml"); FileUtils.copyFile(source, logbackFile); SumoLogbackUpdater.verifyAndUpdateCollectorUrl(logbackFile,"test-curl"); assertEquals(FileUtils.readFileToString(logbackFile), FileUtils.readFileToString( ResourceUtils.getResourceAsFile("/org/artifactory/sumologic/fixed_collector_logback.xml"))); } private ProxyDescriptor createProxy(String host, int port) { ProxyDescriptor proxy = new ProxyDescriptor(); proxy.setHost(host); proxy.setPort(port); return proxy; } private SumoLogicConfigDescriptor createSumoLogicConfigDescriptor() { SumoLogicConfigDescriptor sumoConfig = new SumoLogicConfigDescriptor(); sumoConfig.setClientId("the-client-id-" + System.currentTimeMillis()); sumoConfig.setSecret("the-secret-" + System.currentTimeMillis()); sumoConfig.setDashboardUrl("the-dashboard-url-" + System.currentTimeMillis()); sumoConfig.setBaseUri("the-base-uri-" + System.currentTimeMillis()); return sumoConfig; } }
[ "david.monichi@gmail.com" ]
david.monichi@gmail.com
4798f121a987afa30cf78b49e08696ff9a23fd94
19f039b593be9401d479b15f97ecb191ef478f46
/RSA-SW/PODM/pod-manager/podm-rest/src/main/java/com/intel/rsa/podm/rest/representation/json/templates/CollectionLinksJson.java
f4ae424ff92097005728cc8e1217e0b4c89198d3
[ "Apache-2.0" ]
permissive
isabella232/IntelRackScaleArchitecture
9a28e34a7f7cdc21402791f24dad842ac74d07b6
1206d2316e1bd1889b10a1c4f4a39f71bdfa88d3
refs/heads/master
2021-06-04T08:33:27.191735
2016-09-29T09:18:10
2016-09-29T09:18:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,150
java
/* * Copyright (c) 2015 Intel Corporation * * 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.intel.rsa.podm.rest.representation.json.templates; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.intel.rsa.podm.rest.odataid.ODataId; import java.util.ArrayList; import java.util.List; @JsonPropertyOrder({"Members@odata.count", "members"}) public final class CollectionLinksJson { public final List<ODataId> members = new ArrayList<>(); @JsonProperty("Members@odata.count") private int getCount() { return members.size(); } }
[ "chester.kuo@gmail.com" ]
chester.kuo@gmail.com
a70ffa1f79a071c0317bcd6a1424dbde8b472e2c
e0ae3743f37d4e2add83239accd26bb3b209f0fe
/src/multithreading/_4_sleeping_and_resuming/Main.java
ba1560e55c780b5eef0eacb576f4a8a14d11d6e6
[ "MIT", "LicenseRef-scancode-proprietary-license" ]
permissive
DyvakYA/java-design-patterns
04dc3eb82cc48a99c58d05855861f5daa7ba8ea9
5e536cd785c58c681c98bc5c632e05a338e755f4
refs/heads/master
2022-12-26T14:31:59.630090
2019-09-10T06:34:40
2019-09-10T06:34:40
74,051,625
0
0
MIT
2020-10-13T15:55:22
2016-11-17T17:38:08
Java
UTF-8
Java
false
false
448
java
package multithreading._4_sleeping_and_resuming; import java.util.concurrent.TimeUnit; public class Main { public static void main(String... args) { ConsoleClock clock = new ConsoleClock(); Thread thread = new Thread(clock); thread.start(); try { TimeUnit.SECONDS.sleep(5); } catch (InterruptedException e) { e.printStackTrace(); } thread.interrupt(); } }
[ "dyvakyurii@gmail.com" ]
dyvakyurii@gmail.com
a0adfc617054bf71b719619ef70e1e72a7173e04
ea7f3017e537d7f8c06d8308e13a53f1d67a488d
/nanoverse/compiler/pipeline/instantiate/factory/processes/continuum/DegradeProcessFactory.java
9cc29f393743e3508443abc5d6ad5b800e0fc9de
[]
no_license
avaneeshnarla/Nanoverse-Source
fc87600af07b586e382fff4703c20378abbd7171
2f8585256bb2e09396a2baf3ec933cb7338a933f
refs/heads/master
2020-05-25T23:25:42.321611
2017-02-16T18:16:31
2017-02-16T18:16:31
61,486,158
0
0
null
null
null
null
UTF-8
Java
false
false
2,274
java
/* * Nanoverse: a declarative agent-based modeling language for natural and * social science. * * Copyright (c) 2015 David Bruce Borenstein and Nanoverse, LLC. * * 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 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/> */ package nanoverse.compiler.pipeline.instantiate.factory.processes.continuum; import nanoverse.compiler.pipeline.instantiate.factory.Factory; import nanoverse.runtime.control.arguments.DoubleArgument; import nanoverse.runtime.geometry.set.CoordinateSet; import nanoverse.runtime.processes.BaseProcessArguments; import nanoverse.runtime.processes.continuum.DegradeProcess; import nanoverse.runtime.processes.continuum.DegradeProcess; public class DegradeProcessFactory implements Factory<DegradeProcess> { private final DegradeProcessFactoryHelper helper; private BaseProcessArguments arguments; private DoubleArgument valueArg; private String layerId; private CoordinateSet activeSites; public DegradeProcessFactory() { helper = new DegradeProcessFactoryHelper(); } public DegradeProcessFactory(DegradeProcessFactoryHelper helper) { this.helper = helper; } public void setArguments(BaseProcessArguments arguments) { this.arguments = arguments; } public void setValueArg(DoubleArgument valueArg) { this.valueArg = valueArg; } public void setLayerId(String layerId) { this.layerId = layerId; } public void setActiveSites(CoordinateSet activeSites) { this.activeSites = activeSites; } @Override public DegradeProcess build() { return helper.build(arguments, valueArg, layerId, activeSites); } }
[ "avaneesh.narla@gmail.com" ]
avaneesh.narla@gmail.com
3d19a79b2a71ba58171ae0f7d4c3236572b2de18
b857c0a9f29b7ff8d3aa177734526e97d3358f38
/app/src/main/java/com/lxyg/app/customer/bean/User.java
8323445a638f91f59b7bebb7b83088eb2846a104
[]
no_license
mirror5821/LXYG
a133d68b93901a375d1fef47710683c9c93cc953
d2be2366b41b5301d1d5c6bba6e0c5bbb25521e5
refs/heads/master
2021-01-21T13:41:20.864539
2016-05-05T06:50:58
2016-05-05T06:50:58
47,088,931
0
0
null
null
null
null
UTF-8
Java
false
false
2,450
java
package com.lxyg.app.customer.bean; import android.os.Parcel; import android.os.Parcelable; public class User implements Parcelable{ private String id;//22, private String phone;//private String 18837145625private String , private String shop_id;//0, private String name;//private String 18837145625private String , private String create_time;//private String 2015-07-31private String , private String uuid;//private String 9c22fcbd9122458dprivate String private String cash_pay;//0, private String score;//0, private String head_img;//private String http://wx.qlogo.cn/mmopen/aIfW3O6n5Dc3vKwMvFqHNDC5AVGFc9Cibhvt396ZkssqBFQOFSicgX6WMuusMjcWwbciaksibHX1IIdMpbxVu4aKKcBkPeo4VsbG/0private String , private String wechat_id;//private String ouUNEw3ZEEa-SidXBp-oP6bgiHQAprivate String , private String modify_time;//null, private String password;//null public String getCash_pay() { return cash_pay; } public void setCash_pay(String cash_pay) { this.cash_pay = cash_pay; } public String getScore() { return score; } public void setScore(String score) { this.score = score; } public String getHead_img() { return head_img; } public void setHead_img(String head_img) { this.head_img = head_img; } public String getWechat_id() { return wechat_id; } public void setWechat_id(String wechat_id) { this.wechat_id = wechat_id; } public String getModify_time() { return modify_time; } public void setModify_time(String modify_time) { this.modify_time = modify_time; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } public String getShop_id() { return shop_id; } public void setShop_id(String shop_id) { this.shop_id = shop_id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getCreate_time() { return create_time; } public void setCreate_time(String create_time) { this.create_time = create_time; } public String getUuid() { return uuid; } public void setUuid(String uuid) { this.uuid = uuid; } @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel dest, int flags) { } }
[ "mirror5821@163.com" ]
mirror5821@163.com
2a3f74c85a05de40379ba7687b7514d6c0876201
30efd6447c4be1422124a8cd0e083ad1d554e072
/src/com/java/advanced/features/generics/tutorial/t02_generic_types/_05_multiple_type_parameters/OrderedPair.java
bd88b453a99e99afef80e2ca9ff1f45ff5ac9668
[ "Apache-2.0" ]
permissive
jhwsx/Java_01_AdvancedFeatures
cde5e9297190f47d450bb4507347af9f8480795a
0038ca24301b5226f178ecaecd031a40c8d266b7
refs/heads/master
2022-07-18T20:52:24.020943
2022-07-06T00:36:22
2022-07-06T00:36:22
242,367,686
1
0
null
null
null
null
UTF-8
Java
false
false
1,293
java
package com.java.advanced.features.generics.tutorial.t02_generic_types._05_multiple_type_parameters; import com.java.advanced.features.generics.tutorial.t02_generic_types._02_a_generic_version_of_the_box_class.Box; /** * 多种类型的参数演示 * * @author wangzhichao * @since 2020/4/23 */ public class OrderedPair<K, V> implements Pair<K, V> { private K key; private V value; public OrderedPair(K key, V value) { this.key = key; this.value = value; } @Override public K getKey() { return key; } @Override public V getValue() { return value; } public static void main(String[] args) { // 把 String, Integer 传递给了 K, V Pair<String, Integer> p1 = new OrderedPair<String, Integer>("Even", 8); // 8 是 int 型,自动装箱为 Integer 型。 Pair<String, String> p2 = new OrderedPair<String, String>("hello", "world"); // 使用菱形表示法 OrderedPair<String, Integer> p3 = new OrderedPair<>("Even", 8); OrderedPair<String, String> p4 = new OrderedPair<>("hello", "world"); // 使用参数化类型,如List<String> 来替代类型参数 OrderedPair<String, Box<Integer>> p = new OrderedPair<>("primes", new Box<>()); } }
[ "392337950@qq.com" ]
392337950@qq.com
4580c063055a20b0f12de65ff6967c8f6e4348f7
2fd17a289fd988af1260a72c41e310005c433bf3
/app/src/main/java/li/lingfeng/ltweaks/fragments/DonateFragment.java
35fb400348a7a485d247da784176dadc6293f570
[]
no_license
txdevs/LTweaks
81b9132322406b3b3b772d6653d0b7e9ecd3a43f
90f157120291f2d39b8f29346effdb2e7a3ecb7a
refs/heads/master
2020-09-15T16:57:23.171826
2019-01-14T03:15:12
2019-01-14T03:15:12
223,509,391
1
0
null
2019-11-23T00:41:10
2019-11-23T00:41:09
null
UTF-8
Java
false
false
921
java
package li.lingfeng.ltweaks.fragments; import android.os.Bundle; import android.preference.Preference; import li.lingfeng.ltweaks.R; import li.lingfeng.ltweaks.fragments.sub.donate.AlipayDonate; import li.lingfeng.ltweaks.fragments.sub.donate.WeChatDonate; import li.lingfeng.ltweaks.lib.PreferenceClick; /** * Created by lilingfeng on 2018/1/18. */ public class DonateFragment extends BasePrefFragment { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.pref_donate); } @PreferenceClick(prefs = R.string.key_donate_alipay) private void donateWithAlipay(Preference preference) { AlipayDonate.donate(getActivity()); } @PreferenceClick(prefs = R.string.key_donate_wechat) private void donateWithWeChat(Preference preference) { WeChatDonate.donate(getActivity()); } }
[ "bluesky139@gmail.com" ]
bluesky139@gmail.com
358d3cebcf3bc88957fc1f6a37a617f3bc20d88c
c87e152078599f36c2b16edaa37803f2b571b76d
/super-devops-iam/super-devops-iam-security/src/main/java/com/wl4g/devops/iam/config/DefaultViewAutoConfiguration.java
c8fd601360223396021c5de11cb3a02ef75b740e
[ "Apache-2.0" ]
permissive
weizai118/super-devops
a3ce4c8522f5e4b6f351a524e477390125e3f660
7eca21c9f0c8455cfa41be0cefbd25c16f274b2c
refs/heads/master
2020-08-01T13:36:17.894115
2019-09-25T08:59:31
2019-09-25T08:59:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,818
java
/* * Copyright 2017 ~ 2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.wl4g.devops.iam.config; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.context.annotation.Bean; import java.lang.annotation.Annotation; import static com.wl4g.devops.iam.common.config.AbstractIamProperties.*; import com.wl4g.devops.common.config.AbstractOptionalControllerConfiguration; import com.wl4g.devops.iam.web.DefaultViewController; /** * Default view configuration * * @author Wangl.sir <983708408@qq.com> * @version v1.0 2019年1月8日 * @since */ @AutoConfigureAfter({ IamAutoConfiguration.class }) public class DefaultViewAutoConfiguration extends AbstractOptionalControllerConfiguration { @Bean public DefaultViewController defaultViewController() { return new DefaultViewController(); } @Override protected String getMappingPrefix() { return DEFAULT_VIEW_BASE_URI; } @Bean public PrefixHandlerMapping defaultViewControllerPrefixHandlerMapping() { return super.createPrefixHandlerMapping(); } @Override protected Class<? extends Annotation> annotationClass() { return com.wl4g.devops.iam.annotation.DefaultViewController.class; } }
[ "983708408@qq.com" ]
983708408@qq.com
409d9f76eead66b309c35af58f4f5f0b1dedaac8
d61d05748a59a1a73bbf3c39dd2c1a52d649d6e3
/chromium/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountManagementScreenHelper.java
9e5359b34c875e3ff289bef8371114f776826b6f
[ "BSD-3-Clause" ]
permissive
Csineneo/Vivaldi
4eaad20fc0ff306ca60b400cd5fad930a9082087
d92465f71fb8e4345e27bd889532339204b26f1e
refs/heads/master
2022-11-23T17:11:50.714160
2019-05-25T11:45:11
2019-05-25T11:45:11
144,489,531
5
4
BSD-3-Clause
2022-11-04T05:55:33
2018-08-12T18:04:37
null
UTF-8
Java
false
false
3,125
java
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package org.chromium.chrome.browser.signin; import android.app.Activity; import android.content.Intent; import android.support.annotation.Nullable; import org.chromium.base.ContextUtils; import org.chromium.base.ThreadUtils; import org.chromium.base.annotations.CalledByNative; import org.chromium.chrome.browser.ChromeFeatureList; import org.chromium.chrome.browser.profiles.ProfileAccountManagementMetrics; import org.chromium.chrome.browser.util.IntentUtils; import org.chromium.components.signin.AccountManagerFacade; import org.chromium.components.signin.GAIAServiceType; import org.chromium.ui.base.WindowAndroid; /** * Stub entry points and implementation interface for the account management fragment delegate. */ public class AccountManagementScreenHelper { @CalledByNative private static void openAccountManagementScreen( WindowAndroid windowAndroid, @GAIAServiceType int gaiaServiceType) { ThreadUtils.assertOnUiThread(); if (ChromeFeatureList.isEnabled(ChromeFeatureList.MOBILE_IDENTITY_CONSISTENCY)) { if (gaiaServiceType == GAIAServiceType.GAIA_SERVICE_TYPE_SIGNUP || gaiaServiceType == GAIAServiceType.GAIA_SERVICE_TYPE_ADDSESSION) { startAddAccountActivity(windowAndroid, gaiaServiceType); return; } SigninUtils.openSettingsForAllAccounts(ContextUtils.getApplicationContext()); return; } AccountManagementFragment.openAccountManagementScreen(gaiaServiceType); } /** * Tries starting an Activity to add a Google account to the device. If this activity cannot * be started, opens "Accounts" page in the Android Settings app. */ private static void startAddAccountActivity( WindowAndroid windowAndroid, @GAIAServiceType int gaiaServiceTypeSignup) { logEvent(ProfileAccountManagementMetrics.DIRECT_ADD_ACCOUNT, gaiaServiceTypeSignup); AccountManagerFacade.get().createAddAccountIntent((@Nullable Intent intent) -> { Activity activity = windowAndroid.getActivity().get(); if (intent == null || activity == null || !IntentUtils.safeStartActivity(activity, intent)) { // Failed to create or show an intent, open settings for all accounts so // the user has a chance to create an account manually. SigninUtils.openSettingsForAllAccounts(ContextUtils.getApplicationContext()); } }); } /** * Log a UMA event for a given metric and a signin type. * @param metric One of ProfileAccountManagementMetrics constants. * @param gaiaServiceType A signin::GAIAServiceType. */ public static void logEvent(int metric, int gaiaServiceType) { nativeLogEvent(metric, gaiaServiceType); } // Native methods. private static native void nativeLogEvent(int metric, int gaiaServiceType); }
[ "csineneo@gmail.com" ]
csineneo@gmail.com
7eb53fe07b50a25992fdb83ce6b7bcdbcba988c5
7f223ec1ddfc88fd1e8732fe227a88fddc054926
/app/androidF/application/build/tmp/kapt3/stubs/release/com/wy/adbook/mvp/model/entity/book/NetPutOn.java
3669829546008bf70c3f83d50091900d8e155fa9
[]
no_license
sengeiou/qy_book_free
93da8933e0b1bd584bf974f97ed65063615917c4
42e35f88c24ce864de61d9f4f6921ca7df2970b7
refs/heads/master
2022-04-07T11:28:18.472504
2019-06-25T07:57:58
2019-06-25T07:57:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
721
java
package com.wy.adbook.mvp.model.entity.book; import java.lang.System; /** * * Created by leafye on 2019/5/5. */ @kotlin.Metadata(mv = {1, 1, 13}, bv = {1, 0, 3}, k = 1, d1 = {"\u0000\u0010\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001B\u0005\u00a2\u0006\u0002\u0010\u0003\u00a8\u0006\u0004"}, d2 = {"Lcom/wy/adbook/mvp/model/entity/book/NetPutOn;", "Lcom/wy/adbook/app/base/BaseEntity;", "Lcom/wy/adbook/mvp/model/entity/book/PutOn;", "()V", "application_release"}) public final class NetPutOn extends com.wy.adbook.app.base.BaseEntity<com.wy.adbook.mvp.model.entity.book.PutOn> { public NetPutOn() { super(); } }
[ "chenchendedefeng@126.com" ]
chenchendedefeng@126.com
fa2891a0188e25dda3978c4f925801790deffb38
5ebb1d3d4b7e54d016a43d522a3a09a6318555e3
/Euler/Java/src/main/java/euler/Problem16.java
b4d6f051a50ce4eef325a4b74bb05d7511d5b45a
[]
no_license
redhill42/MMA
3af2c4ba5a972f1697b054057b1bfca7fc540f5c
1cf0354d43ade6669678a171f8bab01695c075b0
refs/heads/master
2021-04-26T22:57:04.401893
2018-09-01T02:27:03
2018-09-01T02:27:03
123,901,653
1
0
null
null
null
null
UTF-8
Java
false
false
375
java
package euler; import java.math.BigInteger; import static euler.algo.Library.digitSum; public final class Problem16 { private Problem16() {} public static int solve(int n) { BigInteger power = BigInteger.ONE.shiftLeft(n); return digitSum(power); } public static void main(String[] args) { System.out.println(solve(1000)); } }
[ "daniel.yuan@me.com" ]
daniel.yuan@me.com
9b769de1f4a80fd548808f3a2100a93ae18d2ba2
c4a8a89aca8a50cbb81c2255c8e33215827e5d55
/egakat-integration-core-files/src/main/java/com/egakat/integration/core/files/components/checkers/CampoChecker.java
7b9efcd55bfdf7d9324b6374fd7695cf27e749b4
[]
no_license
github-ek/egakat-integration
5dba020e97d2530471152e3580418e0f6d2d2f62
d451bf5da61c15d89df71d36a7af7dd8167b6ee9
refs/heads/master
2022-07-13T13:43:21.010260
2019-09-23T04:00:29
2019-09-23T04:00:29
136,370,505
1
1
null
2022-06-28T15:22:36
2018-06-06T18:31:59
Java
UTF-8
Java
false
false
236
java
package com.egakat.integration.core.files.components.checkers; import com.egakat.integration.commons.archivos.dto.CampoDto; public interface CampoChecker<T> { public void check(CampoDto campo, T valor); public String getError(); }
[ "esb.ega.kat@gmail.com" ]
esb.ega.kat@gmail.com
8e4dfa1e0207244025ba03bdef849f48237a2162
92bea743c7c4317aa4d75e6f8c0f9dd1bed6e652
/src/test/java/com/alibaba/json/bvt/path/JSONPath_containsValue.java
d1c8fe9af8b2e00cc47657556a4d23cd7fc29e4b
[ "LicenseRef-scancode-warranty-disclaimer", "Apache-2.0" ]
permissive
ziqin/fastjson
89e4361d7923ec242e9817c7d8456a6363c7b05c
5bdc3592655c6850eb59f89b09a7dbd19ed1ca75
refs/heads/master
2022-09-06T12:09:07.941718
2020-06-01T05:51:57
2020-06-01T05:53:36
254,939,238
3
0
Apache-2.0
2020-04-13T13:10:24
2020-04-11T19:23:43
null
UTF-8
Java
false
false
1,230
java
package com.alibaba.json.bvt.path; import java.util.ArrayList; import java.util.List; import org.junit.Assert; import com.alibaba.fastjson.JSONPath; import junit.framework.TestCase; public class JSONPath_containsValue extends TestCase { public void test_root() throws Exception { List list = new ArrayList(); list.add("kiki"); list.add("ljw2083"); list.add("wenshao"); Assert.assertTrue(JSONPath.containsValue(list, "/0", "kiki")); Assert.assertFalse(JSONPath.containsValue(list, "/0", "kiki_")); Assert.assertTrue(JSONPath.containsValue(list, "/", "kiki")); Assert.assertFalse(JSONPath.containsValue(list, "/", "kiki_")); Assert.assertTrue(JSONPath.contains(list, "/")); Assert.assertTrue(JSONPath.contains(list, "/0")); Assert.assertTrue(JSONPath.contains(list, "/1")); Assert.assertTrue(JSONPath.contains(list, "/2")); Assert.assertFalse(JSONPath.contains(list, "/3")); Assert.assertFalse(JSONPath.contains(null, "$")); Assert.assertFalse(JSONPath.compile("$").contains(null)); Assert.assertFalse(JSONPath.containsValue(null, "$", "kiki")); } }
[ "shaojin.wensj@alibaba-inc.com" ]
shaojin.wensj@alibaba-inc.com
c83d4d483e6c74a795e119e12176e1a540e2726e
67c413671ab4adb6acfd23740be07491ac4df625
/ComWebapp/src/main/java/dicka/webapp/controller/ControllerPengguna.java
7944b636db815063d9e039a0d683bc876584d9f6
[]
no_license
dickanirwansyah/springboot-restfull-postgresql-jpa
c1c3a90ba59113711af1670dccbde7949f8ab2a6
a38745c95d3671aea396330685219635da1e68b7
refs/heads/master
2021-08-28T15:12:32.941210
2017-12-12T15:03:58
2017-12-12T15:03:58
111,681,727
0
0
null
null
null
null
UTF-8
Java
false
false
2,590
java
package dicka.webapp.controller; import dicka.dao.DAOPengguna; import dicka.model.Pengguna; import dicka.model.Role; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import org.springframework.web.util.UriComponentsBuilder; import java.util.List; @RestController @RequestMapping(value = "/api") public class ControllerPengguna { private DAOPengguna daoPengguna; private static final Logger LOGGER = LoggerFactory.getLogger(ControllerPengguna.class); @Autowired public ControllerPengguna(DAOPengguna daoPengguna){ this.daoPengguna = daoPengguna; } @GetMapping(value = "/pengguna") public ResponseEntity<List<Pengguna>>getListPengguna(){ LOGGER.debug("access data pengguna"); List<Pengguna> listpengguna = daoPengguna.findAllPengguna(); if(listpengguna.isEmpty()){ LOGGER.debug("data is empty"); return new ResponseEntity<List<Pengguna>>(HttpStatus.BAD_REQUEST); } return new ResponseEntity<List<Pengguna>>(listpengguna, HttpStatus.OK); } @GetMapping(value = "/pengguna/{idpengguna}") public ResponseEntity<Pengguna>getPenggunaById(@PathVariable String idpengguna){ LOGGER.debug("access data pengguna by id"); Pengguna pengguna = daoPengguna.findOnePenggunaById(Integer.parseInt(idpengguna)); if(pengguna == null){ LOGGER.debug("data is failed"); return new ResponseEntity<Pengguna>(HttpStatus.BAD_REQUEST); } return new ResponseEntity<Pengguna>(pengguna, HttpStatus.ACCEPTED); } @PostMapping(value = "/insertPengguna") public ResponseEntity<Pengguna>insertPengguna(@RequestBody Pengguna pengguna, UriComponentsBuilder builder){ LOGGER.debug("try to access insert data"); boolean validated = daoPengguna.insertPengguna(pengguna); if(validated == false){ LOGGER.debug("data conflict"); return new ResponseEntity<Pengguna>(HttpStatus.CONFLICT); } HttpHeaders headers = new HttpHeaders(); headers.setLocation(builder.path("/insertPengguna/{idpengguna}") .buildAndExpand(pengguna.getIdpengguna()).toUri()); return new ResponseEntity<Pengguna>(headers, HttpStatus.CREATED); } }
[ "dickanirwansyah@gmail.com" ]
dickanirwansyah@gmail.com
259165a83f36b84d509625db87747f1853c43d4e
8499aea220fac1ac628b9f79de9532cc4123c73a
/src/main/java/edu/uchicago/cs/encsel/query/tpch/TPCHWorker.java
caf04d6c6b27284cf05654c76dff30ed17f82434
[ "Apache-2.0" ]
permissive
UCHI-DB/enc-selector
9e02db354c722e4282a291facc6247e251dfaa1e
a1fdc9012a6051c869fbc33bf76762c554709f29
refs/heads/master
2021-06-04T01:45:25.199870
2019-10-21T22:06:55
2019-10-21T22:06:55
111,722,588
5
3
null
2017-11-22T19:08:49
2017-11-22T19:08:49
null
UTF-8
Java
false
false
3,976
java
package edu.uchicago.cs.encsel.query.tpch; import edu.uchicago.cs.encsel.model.FloatEncoding; import edu.uchicago.cs.encsel.model.IntEncoding; import edu.uchicago.cs.encsel.model.StringEncoding; import edu.uchicago.cs.encsel.adapter.parquet.EncReaderProcessor; import edu.uchicago.cs.encsel.adapter.parquet.ParquetReaderHelper; import edu.uchicago.cs.encsel.util.perf.ProfileBean; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.parquet.column.ColumnDescriptor; import org.apache.parquet.hadoop.metadata.CompressionCodecName; import org.apache.parquet.schema.MessageType; import java.net.URI; import java.text.MessageFormat; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.stream.Collectors; public class TPCHWorker { private CompressionCodecName[] codecs = {CompressionCodecName.UNCOMPRESSED, CompressionCodecName.GZIP}; private EncReaderProcessor processor; private MessageType schema; private Configuration configuration; public TPCHWorker(EncReaderProcessor processor, MessageType schema) { this(new Configuration(), processor, schema); } public TPCHWorker(Configuration conf, EncReaderProcessor processor, MessageType schema) { this.configuration = conf; this.processor = processor; this.schema = schema; } public void work(String filePath) throws Exception { for (int i = 0; i < schema.getColumns().size(); i++) { ColumnDescriptor cd = schema.getColumns().get(i); readColumn(filePath, i + 1, cd); } } protected void readColumn(String main, int index, ColumnDescriptor cd) throws Exception { List<String> encodings = null; switch (cd.getType()) { case BINARY: encodings = Arrays.stream(StringEncoding.values()) .filter(p -> p.parquetEncoding() != null).map(e -> e.name()) .collect(Collectors.toList()); break; case INT32: encodings = Arrays.stream(IntEncoding.values()) .filter(p -> p.parquetEncoding() != null).map(e -> e.name()) .collect(Collectors.toList()); break; case DOUBLE: encodings = Arrays.stream(FloatEncoding.values()) .filter(p -> p.parquetEncoding() != null).map(e -> e.name()) .collect(Collectors.toList()); break; default: encodings = Collections.<String>emptyList(); break; } for (String e : encodings) { for (CompressionCodecName codec : codecs) { String fileName = MessageFormat.format("{0}.col{1}.{2}_{3}", main, index, e, codec.name()); URI fileURI = new URI(fileName); FileSystem fs = FileSystem.get(fileURI, configuration); Path filePath = new Path(fileURI); long fileLength; // Skip non-existing and empty file if (!fs.exists(filePath) || (fileLength = fs.getFileStatus(filePath).getLen()) == 0) { continue; } try { ProfileBean loadTime = ParquetReaderHelper.profile( configuration, fileURI, processor); System.out.println(MessageFormat.format("{0}, {1}, {2}, {3}, {4,number,#.###}", index, e, codec.name(), String.valueOf(loadTime.wallclock()), ((double) fileLength) / (1000 * loadTime.wallclock()))); } catch (Exception ex) { // ignore ex.printStackTrace(); } } } } }
[ "harperjiang@msn.com" ]
harperjiang@msn.com
aa55dec54d6521e39e01329c799504bca72d6309
f551ac18a556af60d50d32a175c8037aa95ec3ac
/shop/com/enation/app/shop/component/payment/plugin/weixin/jssdk/TokenUtil.java
b54a35e9fd2ef1382169594191253466462e5201
[]
no_license
yexingf/cxcar
06dfc7b7970f09dae964827fcf65f19fa39d35d1
0ddcf144f9682fa2847b9a350be91cedec602c60
refs/heads/master
2021-05-15T05:40:04.396174
2018-01-09T09:46:18
2018-01-09T09:46:18
116,647,698
0
5
null
null
null
null
UTF-8
Java
false
false
4,280
java
package com.enation.app.shop.component.payment.plugin.weixin.jssdk; import java.io.BufferedReader; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.net.URL; import java.net.URLConnection; import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HttpException; import org.apache.commons.httpclient.methods.GetMethod; import org.apache.log4j.Logger; import com.enation.app.shop.component.payment.plugin.weixin.config.WeixinConfig; import net.sf.json.JSONException; import net.sf.json.JSONObject; public class TokenUtil { public static Logger log = Logger.getLogger(TokenUtil.class.getName()); /** * 获取接口访问凭证 * * @param appid * 凭证 * @param appsecret * 密钥 * @return */ public static String getAccessToken() { // 凭证获取(GET) String token_url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=APPID&secret=APPSECRET"; String requestUrl = token_url.replace("APPID", WeixinConfig.APPID).replace("APPSECRET", WeixinConfig.APP_SECRET); // 发起GET请求获取凭证 JSONObject jsonObject = JSONObject.fromObject(sendGet(requestUrl)); String accessToken = null; if (null != jsonObject) { try { accessToken = jsonObject.getString("access_token"); } catch (JSONException e) { // 获取token失败 log.error("获取token失败 errcode:{" + jsonObject.getInt("errcode") + "} errmsg:{" + jsonObject.getString("errmsg") + "}"); } } return accessToken; } /** * 调用微信JS接口的临时票据 * * @param access_token * 接口访问凭证 * @return */ public static String getJsapiTicket(String accessToken) { String url = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=ACCESS_TOKEN&type=jsapi"; String requestUrl = url.replace("ACCESS_TOKEN", accessToken); // 发起GET请求获取凭证 JSONObject jsonObject = JSONObject.fromObject(sendGet(requestUrl)); String jsapiTicket = null; if (null != jsonObject) { try { jsapiTicket = jsonObject.getString("ticket"); } catch (JSONException e) { // 获取token失败 log.error("获取token失败 errcode:{" + jsonObject.getInt("errcode") + "} errmsg:{" + jsonObject.getString("errmsg") + "}"); } } return jsapiTicket; } /** * 下载素材 * * @param access_token * 接口访问凭证 * @return */ public static String downloadMedia(String accessToken, String media_id,String savePath,String saveFileName) { String url = "https://api.weixin.qq.com/cgi-bin/media/get?access_token=ACCESS_TOKEN&media_id=MEDIAID"; String requestUrl = url.replace("ACCESS_TOKEN", accessToken).replace("MEDIAID", media_id); HttpClient client = new HttpClient(); GetMethod get = new GetMethod(requestUrl); try { client.executeMethod(get); String type = get.getResponseHeader("Content-Type").getValue(); if("text/plain".equals(type)){ JSONObject result = JSONObject.fromObject(get.getResponseBodyAsString()); int code = result.getInt("errcode"); if(code==42001){ return "refreshToken"; } }else{ File storeFile = new File(savePath,saveFileName); FileOutputStream output = new FileOutputStream(storeFile); output.write(get.getResponseBody()); output.close(); return savePath+saveFileName; } } catch (HttpException e) { } catch (IOException e) { } return null; } /** * 向指定URL发送GET方法的请求 * @param url * @return * @throws IOException */ public static String sendGet(String url){ try { StringBuilder sb = new StringBuilder(); URL urlObject = new URL(url); URLConnection conn = urlObject.openConnection(); conn.setConnectTimeout(10000);// 连接主机的超时时间(单位:毫秒) conn.setReadTimeout(10000);// 从主机读取数据的超时时间(单位:毫秒) BufferedReader in = new BufferedReader(new InputStreamReader( conn.getInputStream(), "utf-8")); String inputLine = null; while ((inputLine = in.readLine()) != null) { sb.append(inputLine); } in.close(); return sb.toString(); } catch (Exception e) { } return "{}"; } }
[ "274674758_ye@sina.com" ]
274674758_ye@sina.com
40516a835e3c7961dabb0505dbdbc4932d96314d
1f6d922b7739e74c54983810d7c6e2a4c0ca84e6
/MeziBD/src/transaccion/TContrato_documento.java
5969d084b99cf4c7074dffe2d6b9d1668dba6c49
[]
no_license
Dgiulian/Mezi
44502ef22fd97629f6655f8cb80d40e64d349bb3
24ab100d1b930f4edef7ab742098bd8d1ff2f05c
refs/heads/master
2021-01-11T18:11:48.044400
2019-10-23T01:58:27
2019-10-23T01:58:27
55,608,565
0
0
null
null
null
null
UTF-8
Java
false
false
879
java
package transaccion; import bd.Contrato_documento; import java.util.List; public class TContrato_documento extends TransaccionBase<Contrato_documento> { @Override public List<Contrato_documento> getList() { return super.getList("select * from contrato_documento "); } public Boolean actualizar(Contrato_documento contrato_documento) { return super.actualizar(contrato_documento, "id"); } public Contrato_documento getById(Integer id) { String query = String .format("select * from contrato_documento where contrato_documento.id = %d ", id); return super.getById(query); } public List<Contrato_documento> getById_contrato(Integer id_contrato){ String query = String.format("select * from contrato_documento where contrato_documento.id_contrato = %d order by desde",id_contrato); return super.getList(query); } }
[ "giuliani.diego@gmail.com" ]
giuliani.diego@gmail.com
e8be036b3588f8b579a773952dc334641bfc0fe4
5225831f1df1f50b4d4069a951c9d69c2d495a49
/templating/the-morse -encoder-UI/src/main/java/nacs/at/themorseencoderui/view/controller/MorseEncoderUIController.java
2c62af7ef93d6b9a37a0f61d83914ecbf726c769
[]
no_license
mustafa1mashtah/backend-2
42629862f179e7e793bb997710931978be1cc3c5
e825fa5c93dfed3b38c4831fedc9d363cb989561
refs/heads/master
2020-04-29T17:03:20.733016
2019-06-20T17:59:14
2019-06-20T17:59:14
176,284,965
0
0
null
null
null
null
UTF-8
Java
false
false
1,285
java
package nacs.at.themorseencoderui.view.controller; import lombok.RequiredArgsConstructor; import nacs.at.themorseencoderui.logic.EncoderClient; import nacs.at.themorseencoderui.view.model.Message; import org.springframework.stereotype.Controller; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.mvc.support.RedirectAttributesModelMap; import javax.validation.Valid; @Controller @RequestMapping("/") @RequiredArgsConstructor public class MorseEncoderUIController { private final EncoderClient encoderClient; @ModelAttribute("message") Message message() { return new Message(); } @GetMapping String page() { return "morse-encoder-ui"; } @PostMapping String post(@Valid Message message, BindingResult result, RedirectAttributesModelMap redirect) { if (result.hasErrors()) { return page(); } redirect.addFlashAttribute("encoded", encoderClient.sendToEncoder(message)); return "redirect:/"; } }
[ "mashtah.moustafa@gmail.com" ]
mashtah.moustafa@gmail.com
6aa2693f491aad5ed3f3e744f51bfc6b7315242d
c253cefcf0e9b01532974e66295bed88e7bd07c0
/ExpenseManager/app/src/main/java/ict/com/expensemanager/data/database/entity/Transaction.java
9e46f0d5fc91c1db863cd8b0c3f19d247e12ebfc
[]
no_license
huyct3105/ExpenseManager
60b99715064e9919486b3743b3a0106514f65b29
3fa4e4d3cbb14592f1043e7a4240aa23155821d3
refs/heads/master
2020-03-28T06:42:45.100370
2018-09-07T17:28:12
2018-09-07T17:28:12
147,854,575
0
0
null
null
null
null
UTF-8
Java
false
false
2,535
java
package ict.com.expensemanager.data.database.entity; import android.arch.persistence.room.ColumnInfo; import android.arch.persistence.room.Entity; import android.arch.persistence.room.ForeignKey; import android.arch.persistence.room.PrimaryKey; /** * Created by PHAMHOAN on 1/18/2018. */ @Entity(tableName = "Transaction") public class Transaction { @PrimaryKey(autoGenerate = true) @ColumnInfo(name = "id_transaction") private int idTransaction; @ColumnInfo(name = "transaction_name") private String transactionName; @ColumnInfo(name = "id_user") @ForeignKey(entity = User.class, parentColumns = "id_user", childColumns = "id_user") private int idUser; @ColumnInfo(name = "id_event") @ForeignKey(entity = Event.class, parentColumns = "id_event", childColumns = "id_event") private int idEvent; @ColumnInfo(name = "id_wallet") @ForeignKey(entity = Wallet.class, parentColumns = "id_wallet", childColumns = "id_wallet") private int idWallet; @ColumnInfo(name = "id_category") @ForeignKey(entity = Category.class, parentColumns = "id_category", childColumns = "id_category",onDelete = ForeignKey.CASCADE) private int idCategory; @ColumnInfo(name = "price") private double price; @ColumnInfo(name = "time") private long time; public int getIdTransaction() { return idTransaction; } public void setIdTransaction(int idTransaction) { this.idTransaction = idTransaction; } public String getTransactionName() { return transactionName; } public void setTransactionName(String transactionName) { this.transactionName = transactionName; } public int getIdUser() { return idUser; } public void setIdUser(int idUser) { this.idUser = idUser; } public int getIdEvent() { return idEvent; } public void setIdEvent(int idEvent) { this.idEvent = idEvent; } public int getIdWallet() { return idWallet; } public void setIdWallet(int idWallet) { this.idWallet = idWallet; } public int getIdCategory() { return idCategory; } public void setIdCategory(int idCategory) { this.idCategory = idCategory; } public double getPrice() { return price; } public void setPrice(double price) { this.price = price; } public long getTime() { return time; } public void setTime(long time) { this.time = time; } }
[ "=" ]
=
9655edfe465032ac75613e768e471942c7729b60
8bf8659254983f5a2ed0d61a9e5eda2ef5e51760
/slider-core/src/main/java/org/apache/hoya/core/launch/RunningApplication.java
44a2dcc113acebbfbb5be00fa19d6caf73ce7374
[ "Apache-2.0" ]
permissive
xgong/slider
e8ef4945b4282d52e18a8fe515dc005601fa2fa7
d5a582f70393e249dbc0babbd01b50673ea5e357
refs/heads/master
2021-01-21T09:23:59.469461
2014-04-29T19:15:36
2014-04-29T19:15:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,668
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.hoya.core.launch; import org.apache.hadoop.yarn.api.records.ApplicationReport; import org.apache.hadoop.yarn.exceptions.YarnException; import org.apache.hoya.HoyaExitCodes; import org.apache.hoya.api.HoyaClusterProtocol; import org.apache.hoya.exceptions.SliderException; import org.apache.hoya.yarn.appmaster.rpc.RpcBinder; import org.apache.hoya.yarn.client.HoyaYarnClientImpl; import static org.apache.hoya.Constants.*; import java.io.IOException; /** * A running application built from an app report. This one * can be talked to */ public class RunningApplication extends LaunchedApplication { private final ApplicationReport applicationReport; public RunningApplication(HoyaYarnClientImpl yarnClient, ApplicationReport applicationReport) { super(yarnClient, applicationReport); this.applicationReport = applicationReport; } public ApplicationReport getApplicationReport() { return applicationReport; } /** * Connect to a Hoya AM * @param app application report providing the details on the application * @return an instance * @throws YarnException * @throws IOException */ public HoyaClusterProtocol connect(ApplicationReport app) throws YarnException, IOException { try { return RpcBinder.getProxy(yarnClient.getConfig(), yarnClient.getRmClient(), app, CONNECT_TIMEOUT, RPC_TIMEOUT); } catch (InterruptedException e) { throw new SliderException(HoyaExitCodes.EXIT_TIMED_OUT, e, "Interrupted waiting for communications with the Application Master"); } } }
[ "stevel@hortonworks.com" ]
stevel@hortonworks.com
a6aab182d92b018fd2347d10802887ffcb76e36c
aefc7957e92e39de0566b712727c7df66709886c
/src/main/java/com/aliyun/openservices/shade/io/netty/handler/codec/socks/SocksAuthRequest.java
912d364dd1f961cf257ec2261f6e9d435f6590a6
[ "MIT" ]
permissive
P79N6A/gw-boot-starter-aliyun-ons
71ff20d12c33fa9aa061c262f892d8bde7a93459
10ae89ce3e4f44edd383e472c987b0671244f1be
refs/heads/master
2020-05-19T10:05:00.665427
2019-05-05T01:42:57
2019-05-05T01:42:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,969
java
/* * Copyright 2012 The Netty Project * * The Netty Project licenses this file to you under the Apache License, * version 2.0 (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package com.aliyun.openservices.shade.io.netty.handler.codec.socks; import com.aliyun.openservices.shade.io.netty.buffer.ByteBuf; import com.aliyun.openservices.shade.io.netty.util.CharsetUtil; import java.nio.charset.CharsetEncoder; /** * An socks auth request. * * @see SocksAuthResponse * @see SocksAuthRequestDecoder */ public final class SocksAuthRequest extends SocksRequest { private static final CharsetEncoder asciiEncoder = CharsetUtil.encoder(CharsetUtil.US_ASCII); private static final SocksSubnegotiationVersion SUBNEGOTIATION_VERSION = SocksSubnegotiationVersion.AUTH_PASSWORD; private final String username; private final String password; public SocksAuthRequest(String username, String password) { super(SocksRequestType.AUTH); if (username == null) { throw new NullPointerException("username"); } if (password == null) { throw new NullPointerException("username"); } if (!asciiEncoder.canEncode(username) || !asciiEncoder.canEncode(password)) { throw new IllegalArgumentException( "username: " + username + " or password: **** values should be in pure ascii"); } if (username.length() > 255) { throw new IllegalArgumentException("username: " + username + " exceeds 255 char limit"); } if (password.length() > 255) { throw new IllegalArgumentException("password: **** exceeds 255 char limit"); } this.username = username; this.password = password; } /** * Returns username that needs to be authenticated * * @return username that needs to be authenticated */ public String username() { return username; } /** * Returns password that needs to be validated * * @return password that needs to be validated */ public String password() { return password; } @Override public void encodeAsByteBuf(ByteBuf byteBuf) { byteBuf.writeByte(SUBNEGOTIATION_VERSION.byteValue()); byteBuf.writeByte(username.length()); byteBuf.writeBytes(username.getBytes(CharsetUtil.US_ASCII)); byteBuf.writeByte(password.length()); byteBuf.writeBytes(password.getBytes(CharsetUtil.US_ASCII)); } }
[ "hf@geewit.io" ]
hf@geewit.io
ad92f48a91101763bf4fea32f3c8dcb1e559dd50
edb785b20b491d0506f37eb0ea9f5b12fd130e2f
/experiments/Rats!/java/input/cryptix-jce/src/cryptix.jce.provider.rsa/RSASignature_PSS_MD5.java
a08b8bc0eabbec941300ab1f6cbc22cb72bc9ee4
[ "BSD-2-Clause" ]
permissive
lives-group/APEG
21e4d7a946115c7c472950344a3c43c0b46a1eab
b95d81f1805d44a4329e172708ee9a3b7955a560
refs/heads/master
2023-06-23T19:38:20.922507
2022-04-26T17:49:20
2022-04-26T17:49:20
58,152,307
2
3
null
2023-06-13T22:54:11
2016-05-05T18:33:13
Java
UTF-8
Java
false
false
722
java
/* $Id: RSASignature_PSS_MD5.java,v 1.1 2001/06/20 17:50:37 gelderen Exp $ * * Copyright (C) 2001 The Cryptix Foundation Limited. * All rights reserved. * * Use, modification, copying and distribution of this software is subject * the terms and conditions of the Cryptix General Licence. You should have * received a copy of the Cryptix General Licence along with this library; * if not, you can download a copy from http://www.cryptix.org/ . */ package cryptix.jce.provider.rsa; /** * @version $Revision: 1.1 $ * @author Jeroen C. van Gelderen (gelderen@cryptix.org) */ public class RSASignature_PSS_MD5 extends RSASignature_PSS { public RSASignature_PSS_MD5 () { super("MD5"); } }
[ "daysekelley@live.com" ]
daysekelley@live.com
a5ff24c2da9f5abcbde175fec555a8c5cb33dcd8
d018a686f37a0c2d8b08f9d675facddb164edb94
/examples/transformed_projects/openfuxml/wiki/src/main/java/org/openfuxml/addon/wiki/processor/markup/WikiInlineProcessor.java
eb3df9110c19921ec10550822ec196a899bc8af3
[]
no_license
Mestway/Patl4J
9b7edc204afb3c55763b66254561d8390237d87f
b8985fdcc818fdb78c14e1831382f15475e186c0
refs/heads/master
2020-12-24T05:54:50.632299
2016-07-22T09:07:50
2016-07-22T09:07:50
29,904,381
8
2
null
null
null
null
UTF-8
Java
false
false
2,548
java
package org.openfuxml.addon.wiki.processor.markup; import net.sf.exlp.util.xml.JDomUtil; import net.sf.exlp.util.xml.JaxbUtil; import org.dom4j.Element; import org.openfuxml.addon.wiki.data.jaxb.MarkupProcessor; import org.openfuxml.addon.wiki.data.jaxb.Templates; import org.openfuxml.addon.wiki.data.jaxb.XhtmlProcessor; import org.openfuxml.addon.wiki.processor.ofx.xml.WikiPageProcessor; import org.openfuxml.addon.wiki.processor.xhtml.XhtmlFinalProcessor; import org.openfuxml.addon.wiki.processor.xhtml.XhtmlReplaceProcessor; import org.openfuxml.content.ofx.Section; import org.openfuxml.exception.OfxConfigurationException; import org.openfuxml.exception.OfxInternalProcessingException; import org.openfuxml.xml.renderer.cmp.Cmp; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class WikiInlineProcessor { final static Logger logger = LoggerFactory.getLogger(WikiInlineProcessor.class); public static boolean debugOutput = false; private WikiMarkupProcessor wpMarkup; private WikiModelProcessor wpModel; private XhtmlReplaceProcessor wpXhtmlR; private XhtmlFinalProcessor wpXhtmlF; private WikiPageProcessor ofxP; public WikiInlineProcessor(Cmp cmp) throws OfxConfigurationException { MarkupProcessor mpXml = cmp.getPreprocessor().getWiki().getMarkupProcessor(); XhtmlProcessor xpXml = cmp.getPreprocessor().getWiki().getXhtmlProcessor(); Templates templates = cmp.getPreprocessor().getWiki().getTemplates(); wpMarkup = new WikiMarkupProcessor(mpXml.getReplacements(), mpXml.getInjections(),templates); wpModel = new WikiModelProcessor(); wpXhtmlR = new XhtmlReplaceProcessor(xpXml.getReplacements()); wpXhtmlF = new XhtmlFinalProcessor(); ofxP = new WikiPageProcessor(); } public Section toOfx(String wikiPlain) throws OfxInternalProcessingException { if(debugOutput){logger.debug("wikiPlain: "+wikiPlain);} String wikiMarkup = wpMarkup.process(wikiPlain, "ARTICLE ... "); if(debugOutput){logger.debug("wikiMarkup: "+wikiMarkup);} String xhtmlModel = wpModel.process(wikiMarkup); if(debugOutput){logger.debug("xhtmlModel: "+xhtmlModel);} String xhtmlReplace = wpXhtmlR.process(xhtmlModel); if(debugOutput){logger.debug("xhtmlReplace: "+xhtmlReplace);} String xhtmlFinal = wpXhtmlF.process(xhtmlReplace); if(debugOutput){logger.debug("xhtmlFinal: "+xhtmlFinal);} Element xml = ofxP.process(xhtmlFinal); if(debugOutput){logger.debug(JaxbUtil.toString(xml));} // ; Section section = (Section)JDomUtil.toJaxb(xml, Section.class); return section; } }
[ "mestway@gmail.com" ]
mestway@gmail.com
d017c4acb24aa8eed3880a5bcdcd895404916b06
6d08e8820728c9332c66c316a790d6255fa1d6b6
/DasDrive/src/documentBundle/DBT_07.java
28aeeb88f79b7be3fbaf2febfa312fcce528d02b
[]
no_license
GirdhariGarg/DasDrive
6305365b44cfdbcebe1ebd56c702cde83cd6d271
0e52e643cb74849e20f551645859bdc1d022c8f5
refs/heads/master
2020-06-12T20:51:07.407189
2014-12-02T12:26:22
2014-12-02T12:26:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
323
java
package documentBundle; import java.io.IOException; import org.testng.annotations.Test; import TestBase.*; public class DBT_07 { int row = 8; @Test public void runtest() throws IOException, InterruptedException{ DocumentBundle vaf = new DocumentBundle(); vaf.login(row); vaf.validate(row); } }
[ "CBTECH5@CBTECH5-LAPTOP" ]
CBTECH5@CBTECH5-LAPTOP
72ffdd5cb1be9eea2f90cafbf18b71db579a283a
c7e514e31bd769e32cf4d2de10f1638e6899c69c
/src/test/java/com/gss/pulseworkflow/PulseWorkFlowApplicationTests.java
eeec662ac943151ffff6e6bcc3b89bf0ebdba522
[]
no_license
kumartrigital/pulse
aa4c6c19e4a3b3abe3a3b0be66c917515c46603a
635ebc2384d1605d23dc124c12cb778d6a6705d0
refs/heads/main
2023-06-20T08:37:08.714896
2021-07-09T05:42:09
2021-07-09T05:42:09
384,331,193
0
0
null
null
null
null
UTF-8
Java
false
false
222
java
package com.gss.pulseworkflow; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class PulseWorkFlowApplicationTests { //@Test void contextLoads() { } }
[ "you@example.com" ]
you@example.com
3e3025b831a6cbb6ca01806345b11fb25d219233
8c706b0cda72bc7a4d931c76210f424ef36a4895
/main/java/utils/src/test/java/io/eguan/configuration/TestConfigValidationException.java
90c47020876eca433168139cd5263160b4d540e0
[]
no_license
llbrt/eguan
6abd812f233648e8b4243d1154faac7283aa3cd5
85889da6cd7a6986468baa1019df1a0ccdd85997
refs/heads/master
2020-09-20T04:07:10.099211
2018-09-09T13:09:25
2018-09-09T13:09:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,078
java
package io.eguan.configuration; /* * #%L * Project eguan * %% * Copyright (C) 2012 - 2017 Oodrive * %% * 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 static org.junit.Assert.assertEquals; import io.eguan.configuration.ConfigValidationException; import io.eguan.configuration.ValidationError; import io.eguan.configuration.ValidationError.ErrorType; import java.util.ArrayList; import org.junit.Test; /** * Tests for the methods of {@link ConfigValidationException} not covered by {@link TestMetaConfiguration}. * * @author oodrive * @author pwehrle * */ public final class TestConfigValidationException { /** * Tests failure to construct a {@link ConfigValidationException} due to a {@code null} parameter. * * @throws IllegalArgumentException * if the report is empty. Not part of this test. * @throws NullPointerException * if the argument is {@code null}. Expected for this test. */ @Test(expected = NullPointerException.class) public final void testCreateConfigValidationExceptionFailNullReport() throws IllegalArgumentException, NullPointerException { new ConfigValidationException(null); } /** * Tests failure to construct a {@link ConfigValidationException} due to a {@code null} parameter. * * @throws IllegalArgumentException * if the report is empty. Expected for this test. * @throws NullPointerException * if the argument is {@code null}. Not part of this test. */ @Test(expected = IllegalArgumentException.class) public final void testCreateConfigValidationExceptionFailEmptyReport() throws IllegalArgumentException, NullPointerException { new ConfigValidationException(new ArrayList<ValidationError>()); } /** * Tests iterating through all constants of {@link ErrorType} and calling {@link ErrorType#valueOf(String)}. * * This is necessary for getting 100% coverage on the enum type. * * @throws IllegalArgumentException * if a value fails parsing into a constant. Not part of this test. * @throws NullPointerException * if a value is {@code null}. Not part of this test. */ @Test public final void testValidationErrorTypes() throws IllegalArgumentException, NullPointerException { for (final ErrorType currType : ErrorType.values()) { assertEquals(currType, ErrorType.valueOf(currType.toString())); } } }
[ "p.wehrle@oodrive.com" ]
p.wehrle@oodrive.com
b511a636d36e1ef744dc7b8aeb17454a3600fe9d
022980735384919a0e9084f57ea2f495b10c0d12
/src/ext_cttdt_tk/ext-impl/src/com/nss/portlet/co_quan_ban_hanh/search/CoQuanBanHanhDisplayTerms.java
6e42a01d01de697b79875d8151fad669cbd67576
[]
no_license
thaond/nsscttdt
474d8e359f899d4ea6f48dd46ccd19bbcf34b73a
ae7dacc924efe578ce655ddfc455d10c953abbac
refs/heads/master
2021-01-10T03:00:24.086974
2011-02-19T09:18:34
2011-02-19T09:18:34
50,081,202
0
0
null
null
null
null
UTF-8
Java
false
false
994
java
package com.nss.portlet.co_quan_ban_hanh.search; import javax.portlet.PortletRequest; import com.liferay.portal.kernel.dao.search.DisplayTerms; import com.liferay.portal.kernel.util.ParamUtil; public class CoQuanBanHanhDisplayTerms extends DisplayTerms{ public static final String TEN_CO_QUAN_BAN_HANH = "tenCoQuanBanHanh"; public static final String MO_TA = "moTa"; protected String tenCoQuanBanHanh; protected String moTa; public CoQuanBanHanhDisplayTerms(PortletRequest portletRequest) { super(portletRequest); tenCoQuanBanHanh = ParamUtil.getString(portletRequest, TEN_CO_QUAN_BAN_HANH); moTa = ParamUtil.getString(portletRequest, MO_TA); } public String getTenCoQuanBanHanh() { return tenCoQuanBanHanh; } public void setTenCoQuanBanHanh(String tenCoQuanBanHanh) { this.tenCoQuanBanHanh = tenCoQuanBanHanh; } public String getMoTa() { return moTa; } public void setMoTa(String moTa) { this.moTa = moTa; } }
[ "nguyentanmo@843501e3-6f96-e689-5e61-164601347e4e" ]
nguyentanmo@843501e3-6f96-e689-5e61-164601347e4e
702ecd4e1061caa62e7fcc745c7ad0434018209d
7e713646a0619267b421aafa41a9afeeaf7a0108
/src/main/java/com/gdztyy/inca/entity/PubTransport.java
9a96224eb694e2d7cbb5c0e6c4257246b2a21c74
[]
no_license
liutaota/ipl
4757e35d1100ca892f2137b690ee4b43b908dc19
9d53b9044ba56b6ea65f1347a779d4b66e075bea
refs/heads/master
2023-03-21T11:28:42.663574
2021-03-05T08:49:33
2021-03-05T08:49:33
344,747,852
0
0
null
null
null
null
UTF-8
Java
false
false
1,057
java
package com.gdztyy.inca.entity; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.extension.activerecord.Model; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; /** * <p> * * </p> * * @author peiqy * @since 2020-08-18 */ @Data @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @TableName("PUB_TRANSPORT") public class PubTransport extends Model<PubTransport> { private static final long serialVersionUID = 1L; @TableId("TRANSPORTID") private Long transportid; @TableField("TRANSPORTNAME") private String transportname; @TableField("TRANSPORTOPCODE") private String transportopcode; @TableField("MEMO") private String memo; @TableField("USESTATUS") private Integer usestatus; @Override protected Serializable pkVal() { return this.transportid; } }
[ "liutao@qq.com" ]
liutao@qq.com
5c2f7667bdce8a7c64414c871379a3bf0ef90c22
cca5f035dbbe018268b63a8ddd77b4ec8a9ac0c0
/src/test/java/com/amyliascarlet/jsontest/bvt/issue_2000/Issue2088.java
16672da7bae3167164f24fd80d3a76341434052a
[ "Apache-2.0" ]
permissive
AmyliaScarlet/amyliascarletlib
45195dc277fa16ec7f9c71f20686acaaf2b84366
6bd7f69edae8d201e41c6ccfa231ce51fb0ffe16
refs/heads/master
2020-05-25T10:53:20.312058
2019-05-21T07:04:35
2019-05-21T07:04:35
187,766,221
0
2
null
null
null
null
UTF-8
Java
false
false
1,445
java
package com.amyliascarlet.jsontest.bvt.issue_2000; import com.amyliascarlet.lib.json.JSON; import com.amyliascarlet.lib.json.annotation.JSONField; import junit.framework.TestCase; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; import java.util.TimeZone; public class Issue2088 extends TestCase { protected void setUp() throws Exception { JSON.defaultTimeZone = TimeZone.getTimeZone("Asia/Shanghai"); JSON.defaultLocale = Locale.CHINA; } public void test_for_issue() throws Exception { String json = "{\"date\":\"20181011103607186+0800\"}"; Model m = JSON.parseObject(json, Model.class); SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmssSSSZ"); format.setTimeZone(JSON.defaultTimeZone); Date date = format.parse("20181011103607186+0800"); assertEquals(date, m.date); } public void test_for_issue_1() throws Exception { String json = "{\"date\":\"20181011103607186-0800\"}"; Model m = JSON.parseObject(json, Model.class); SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmssSSSZ", JSON.defaultLocale); format.setTimeZone(JSON.defaultTimeZone); Date date = format.parse("20181011103607186-0800"); assertEquals(date, m.date); } public static class Model { @JSONField(format = "yyyyMMddHHmmssSSSZ") public Date date; } }
[ "amy373978205@outlook.com" ]
amy373978205@outlook.com
b6c6007c601d4bdfce314bd4af9f81cb1bab2dbc
d9e2e1052ef0fdea09dd2b278e8b2befd9866d1e
/src/main/java/me/cluzt/jhipster/sampleapp/domain/PersistentAuditEvent.java
9146b205e25f7d8f38c6d32b1d34a3ae09b7ed87
[]
no_license
cluzt/jhipsterSampleApplication
32b5fdb62cfd495ede79b1cb1ef27fcdfdb5e442
25b5069c3541ef83e7f18c9c79692d0c22cd92e7
refs/heads/master
2021-08-20T03:08:24.513814
2017-11-28T03:15:39
2017-11-28T03:15:39
112,279,557
0
0
null
null
null
null
UTF-8
Java
false
false
1,938
java
package me.cluzt.jhipster.sampleapp.domain; import javax.persistence.*; import javax.validation.constraints.NotNull; import java.io.Serializable; import java.time.Instant; import java.util.HashMap; import java.util.Map; /** * Persist AuditEvent managed by the Spring Boot actuator. * * @see org.springframework.boot.actuate.audit.AuditEvent */ @Entity @Table(name = "jhi_persistent_audit_event") public class PersistentAuditEvent implements Serializable { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator") @SequenceGenerator(name = "sequenceGenerator") @Column(name = "event_id") private Long id; @NotNull @Column(nullable = false) private String principal; @Column(name = "event_date") private Instant auditEventDate; @Column(name = "event_type") private String auditEventType; @ElementCollection @MapKeyColumn(name = "name") @Column(name = "value") @CollectionTable(name = "jhi_persistent_audit_evt_data", joinColumns=@JoinColumn(name="event_id")) private Map<String, String> data = new HashMap<>(); public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getPrincipal() { return principal; } public void setPrincipal(String principal) { this.principal = principal; } public Instant getAuditEventDate() { return auditEventDate; } public void setAuditEventDate(Instant auditEventDate) { this.auditEventDate = auditEventDate; } public String getAuditEventType() { return auditEventType; } public void setAuditEventType(String auditEventType) { this.auditEventType = auditEventType; } public Map<String, String> getData() { return data; } public void setData(Map<String, String> data) { this.data = data; } }
[ "jhipster-bot@users.noreply.github.com" ]
jhipster-bot@users.noreply.github.com
e200f9bad6894fe0226141c349759b0f0e0a73a9
d806c89037d16c5d104b61377207d549f831a2b3
/Java/prison/zl_permission/src/main/java/com/zhilutec/services/impl/PrisonerServiceImpl.java
7014fdd7ea72d9d5ca5900ce1683f4c164d34d95
[]
no_license
wuhlcom/uwb
eef4c2b9d68260752b35f39ea4f4a7d62d771434
9aa14745e9f76c4f0c2f1b0c577350b388a4faa2
refs/heads/master
2020-03-19T19:32:42.475138
2018-12-25T06:32:39
2018-12-25T06:32:39
136,861,886
3
5
null
null
null
null
UTF-8
Java
false
false
6,791
java
/** * @author :wuhongliang wuhongliang@zhilutec.com * @version :2017年10月24日 下午6:49:05 * */ package com.zhilutec.services.impl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.zhilutec.common.result.Result; import com.zhilutec.common.result.ResultCode; import com.zhilutec.common.result.ResultCode; import com.zhilutec.common.utils.MD5Util; import com.zhilutec.db.daos.PrisonerDao; import com.zhilutec.db.daos.ResourceDao; import com.zhilutec.db.daos.UserDao; import com.zhilutec.db.entities.PrisonerEntity; import com.zhilutec.db.entities.UserEntity; import com.zhilutec.services.PrisonerService; import com.zhilutec.services.UserService; import tk.mybatis.mapper.entity.Example; @Service public class PrisonerServiceImpl implements PrisonerService { @Autowired private PrisonerDao prisonerDao; @Override public Result add(JSONObject jsonObj) { PrisonerEntity record = new PrisonerEntity(); record.setSex(null); // 囚徒编码已存在则不添加 record.setNumber(jsonObj.getString("number")); record.setIsdel(0); int exist = prisonerDao.selectCount(record); if (exist >= 1) { return Result.error(ResultCode.REPETITION_ERR.getCode(), "囚徒编码已经存在"); } // 身份证已存在则不添加 String idcard = jsonObj.getString("idcard"); if (idcard != null && !idcard.isEmpty()) { record.setNumber(null); record.setIdcard(idcard); record.setIsdel(0); exist = prisonerDao.selectCount(record); if (exist >= 1) { return Result.error(ResultCode.REPETITION_ERR.getCode(), "身份证已经存在"); } } record = JSON.parseObject(jsonObj.toJSONString(), PrisonerEntity.class); record.setIsdel(0); record.setCreated_at(System.currentTimeMillis() / 1000); // MD5加密 int rs = prisonerDao.insertSelective(record); if (rs >= 1) { return Result.ok(ResultCode.SUCCESS.getCode(), "添加囚徒成功"); } else { return Result.error(ResultCode.Failed.getCode(), "添加囚徒失败"); } } @Override public PrisonerEntity query(JSONObject jsonObj) { String number = jsonObj.getString("number"); Long prisonerId = jsonObj.getLong("id"); PrisonerEntity prisoner = new PrisonerEntity(); prisoner.setSex(null); prisoner.setIsdel(0); if (number != null && !number.trim().isEmpty()) { prisoner.setNumber(number); } else if (prisonerId != null) { prisoner.setId(prisonerId); } else { System.out.println("参数错误!"); return null; } try { return prisonerDao.selectOne(prisoner); } catch (Exception e) { return null; } } @Override public PrisonerEntity query(String number) { PrisonerEntity prisoner = new PrisonerEntity(); prisoner.setSex(null); prisoner.setIsdel(0); if (number != null && !number.trim().isEmpty()) { prisoner.setNumber(number); } else { System.out.println("参数错误!"); return null; } try { return prisonerDao.selectOne(prisoner); } catch (Exception e) { return null; } } @Override public Result update(JSONObject jsonObj) { PrisonerEntity record = new PrisonerEntity(); record.setSex(null); String number = jsonObj.getString("number"); Long prisonerId = jsonObj.getLong("id"); if (prisonerId != null) { record.setId(prisonerId); record.setIsdel(0); int exist = prisonerDao.selectCount(record); if (exist > 1) { return Result.error(ResultCode.NODATA_ERR.getCode(), "囚徒不存在"); } } Example paramsExample = new Example(PrisonerEntity.class); Example.Criteria paramsCriteria = paramsExample.createCriteria(); // 设置查询条件 多个andEqualTo串联表示 and条件查询 if (number != null && !number.trim().isEmpty()) { paramsCriteria.andNotEqualTo("id", prisonerId).andEqualTo("isdel", 0).andEqualTo("number", number); int exist = prisonerDao.selectCountByExample(paramsExample); if (exist >= 1) { return Result.error(ResultCode.REPETITION_ERR.getCode(), "此编号已存在"); } } String idcard = jsonObj.getString("idcard"); if (idcard != null && !idcard.trim().isEmpty()) { Example paramsExample2 = new Example(PrisonerEntity.class); Example.Criteria paramsCriteria2 = paramsExample2.createCriteria(); paramsCriteria2 = paramsExample2.createCriteria(); paramsCriteria2.andNotEqualTo("id", prisonerId).andEqualTo("isdel", 0).andEqualTo("idcard", idcard); int exist = prisonerDao.selectCountByExample(paramsExample2); if (exist >= 1) { return Result.error(ResultCode.REPETITION_ERR.getCode(), "身份证已经存在"); } } record = JSON.parseObject(jsonObj.toJSONString(), PrisonerEntity.class); try { // 创建example Example example = new Example(PrisonerEntity.class); // 创建查询条件 Example.Criteria criteria = example.createCriteria(); // 设置查询条件 多个andEqualTo串联表示 and条件查询 if (prisonerId != null) { criteria.andEqualTo("id", prisonerId).andEqualTo("isdel", 0); } else { return Result.error(ResultCode.Failed.getCode(), "更新囚徒时参数错误"); } int rs = prisonerDao.updateByExampleSelective(record, example); if (rs >= 1) { return Result.ok(ResultCode.SUCCESS.getCode(), "更新囚徒成功"); } else { return Result.error(ResultCode.Failed.getCode(), "更新囚徒失败"); } } catch (Exception e) { return Result.error(ResultCode.UNKNOW_ERR.getCode(), "更新囚徒信息出错"); } } @Override public Result delete (JSONObject jsonObj){ PrisonerEntity record = new PrisonerEntity(); record.setSex(null); String number = jsonObj.getString("number"); Long prisonerId = jsonObj.getLong("id"); if (number != null) { record.setNumber(number); record.setIsdel(1); } else if (prisonerId != null) { record.setId(prisonerId); record.setIsdel(1); } // 创建example Example example = new Example(PrisonerEntity.class); // 创建查询条件 Example.Criteria recordCriteria = example.createCriteria(); // 设置查询条件 多个andEqualTo串联表示 and条件查询 try { if (number != null) { recordCriteria.andEqualTo("number", number).andEqualTo("isdel", 0); } else if (prisonerId != null) { recordCriteria.andEqualTo("id", prisonerId).andEqualTo("isdel", 0); } int rs = prisonerDao.updateByExampleSelective(record, example); if (rs >= 1) { return Result.ok(ResultCode.SUCCESS.getCode(), "删除囚徒信息成功"); } else { return Result.error(ResultCode.Failed.getCode(), "删除囚徒信息失败"); } } catch (Exception e) { return Result.error(ResultCode.UNKNOW_ERR.getCode(), "删除囚徒信息出错"); } } }
[ "wuhlcom@qq.com" ]
wuhlcom@qq.com
e5ead83a2b0f88a137f7987866f624be45aa3d89
a4a51084cfb715c7076c810520542af38a854868
/src/main/java/com/thoughtworks/xstream/converters/ConverterLookup.java
179ca7c856d8cd5ece434f4a1fec1cb3d880761d
[]
no_license
BharathPalanivelu/repotest
ddaf56a94eb52867408e0e769f35bef2d815da72
f78ae38738d2ba6c9b9b4049f3092188fabb5b59
refs/heads/master
2020-09-30T18:55:04.802341
2019-12-02T10:52:08
2019-12-02T10:52:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
132
java
package com.thoughtworks.xstream.converters; public interface ConverterLookup { Converter lookupConverterForType(Class cls); }
[ "noiz354@gmail.com" ]
noiz354@gmail.com
e380a9fd55a24c2fc9d976b68c2d8b21240f5650
963a0f42aaebbcc29879638db0f15e76d7c676fc
/wffweb-3/src/main/java/com/webfirmframework/wffweb/tag/html/attribute/CellSpacing.java
07077e4ea27f684e742b799b7462c27106aa374b
[ "Apache-2.0" ]
permissive
webfirmframework/wff
0ff8f7c4f53d4ff414ec914f5b1d5d5042aecb82
843018dac3ae842a60d758a6eb60333489c9cc73
refs/heads/master
2023-08-05T21:28:27.153138
2023-07-29T03:55:08
2023-07-29T03:55:08
46,187,719
16
5
Apache-2.0
2023-07-29T03:55:09
2015-11-14T18:56:22
Java
UTF-8
Java
false
false
2,720
java
/* * Copyright 2014-2022 Web Firm Framework * * 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. * @author WFF */ package com.webfirmframework.wffweb.tag.html.attribute; import com.webfirmframework.wffweb.tag.html.attribute.core.AbstractAttribute; import com.webfirmframework.wffweb.tag.html.attribute.core.PreIndexedAttributeName; import com.webfirmframework.wffweb.tag.html.identifier.TableAttributable; /** * <pre> * &lt;table cellspacing=&quot;pixels&quot;&gt; * The cellspacing attribute specifies the space, in pixels, between cells. * * NB:- The cellspacing attribute of &lt;table&gt; is not supported in HTML5. Use CSS instead. * </pre> * * @author WFF * @since 1.1.5 */ public class CellSpacing extends AbstractAttribute implements TableAttributable { private static final long serialVersionUID = 1_0_0L; private int value; private static final PreIndexedAttributeName PRE_INDEXED_ATTR_NAME; static { PRE_INDEXED_ATTR_NAME = (PreIndexedAttributeName.CELLSPACING); } { super.setPreIndexedAttribute(PRE_INDEXED_ATTR_NAME); init(); } @SuppressWarnings("unused") private CellSpacing() { } /** * @param value the the number of pixels * @since 1.1.5 * @author WFF */ public CellSpacing(final String value) { this.value = Integer.parseInt(value); setAttributeValue(value); } /** * @param value the the number of pixels * @since 1.1.5 * @author WFF */ public CellSpacing(final int value) { setAttributeValue(String.valueOf(value)); this.value = value; } /** * invokes only once per object * * @author WFF * @since 1.1.5 */ protected void init() { // NOP // to override and use this method } /** * @return the the number of pixels * @author WFF * @since 1.1.5 */ public int getValue() { return value; } /** * @param value the the number of pixels * @author WFF * @since 1.1.5 */ public void setValue(final int value) { setAttributeValue(String.valueOf(value)); this.value = value; } }
[ "webfirm.framework@gmail.com" ]
webfirm.framework@gmail.com
830f794d92bfbe3cdd0a469bee8b23d969b9c903
53566fda56ba067560b7bc0737bf1b633a85330f
/keepalive/src/main/java/com/zijie/keepalive/KeepManager.java
d09ba42525e5eacb94754d87454ce03718c3596e
[]
no_license
hezijie1234/FrameWorkSource_3
686dc7a75626f013751962ef726780663ddd7493
4e4b3487a5786921f895aab228d9cd5f611e3210
refs/heads/master
2020-06-11T01:57:33.593312
2020-04-15T03:22:00
2020-04-15T03:22:00
193,821,097
0
0
null
null
null
null
UTF-8
Java
false
false
1,674
java
package com.zijie.keepalive; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.support.annotation.Keep; import java.lang.ref.WeakReference; /** * Created by hezijie on 2019/7/19. */ public class KeepManager { private static final KeepManager mInstance = new KeepManager(); private KeepBroad keepBroad; private WeakReference<Activity> keepActivity; public static KeepManager getmInstance() { return mInstance; } public void registerKeepBroad(Context context) { keepBroad = new KeepBroad(); IntentFilter intent = new IntentFilter(); intent.addAction(Intent.ACTION_SCREEN_OFF); intent.addAction(Intent.ACTION_SCREEN_ON); context.registerReceiver(keepBroad, intent); } public void unRegisterKeepBroad(Context context) { if (null != keepBroad) context.unregisterReceiver(keepBroad); } /** * 单例模式容易造成内存泄露,所以使用弱引用。 * @param activity */ public void setActivity(KeepActivity activity){ keepActivity = new WeakReference<Activity>(activity); } public void startKeep(Context context){ Intent intent = new Intent(context, KeepActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(intent); } public void finishActivity(){ if (null != keepActivity){ KeepActivity activity = (KeepActivity) keepActivity.get(); if (null != activity){ activity.finish(); } } } }
[ "1710276127@qq.com" ]
1710276127@qq.com
a70ddfbc6f34fd1d56934cb1720ad155812e95e2
58da62dfc6e145a3c836a6be8ee11e4b69ff1878
/src/main/java/com/alipay/api/domain/AddressInfoKt.java
e4b67a22fc94e1b26b33bcc6e97980393e29a9e7
[ "Apache-2.0" ]
permissive
zhoujiangzi/alipay-sdk-java-all
00ef60ed9501c74d337eb582cdc9606159a49837
560d30b6817a590fd9d2c53c3cecac0dca4449b3
refs/heads/master
2022-12-26T00:27:31.553428
2020-09-07T03:39:05
2020-09-07T03:39:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,262
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-12-13 16:57:26 */ public class AddressInfoKt extends AlipayObject { private static final long serialVersionUID = 3366687424673119466L; /** * 地址。商户详细经营地址或人员所在地点 */ @ApiField("address") private String address; /** * 城市编码,城市编码是与国家统计局一致,请查询: http://www.stats.gov.cn/tjsj/tjbz/tjyqhdmhcxhfdm/ 国标省市区号下载:http://aopsdkdownload.cn-hangzhou.alipay-pub.aliyun-inc.com/doc/2016.xls?spm=a219a.7629140.0.0.qRW4KQ&file=2016.xls */ @ApiField("city_code") private String cityCode; /** * 区县编码,区县编码是与国家统计局一致,请查询: http://www.stats.gov.cn/tjsj/tjbz/tjyqhdmhcxhfdm/ 国标省市区号下载:http://aopsdkdownload.cn-hangzhou.alipay-pub.aliyun-inc.com/doc/2016.xls?spm=a219a.7629140.0.0.qRW4KQ&file=2016.xls */ @ApiField("district_code") private String districtCode; /** * 纬度,浮点型,小数点后最多保留6位 如需要录入经纬度,请以高德坐标系为准,录入时请确保经纬度参数准确。高德经纬度查询:http://lbs.amap.com/console/show/picker */ @ApiField("latitude") private String latitude; /** * 经度,浮点型, 小数点后最多保留6位。 如需要录入经纬度,请以高德坐标系为准,录入时请确保经纬度参数准确。高德经纬度查询:http://lbs.amap.com/console/show/picker */ @ApiField("longitude") private String longitude; /** * 省份编码, 省份编码是与国家统计局一致,请查询: http://www.stats.gov.cn/tjsj/tjbz/tjyqhdmhcxhfdm/ 国标省市区号下载:http://aopsdkdownload.cn-hangzhou.alipay-pub.aliyun-inc.com/doc/2016.xls?spm=a219a.7629140.0.0.qRW4KQ&file=2016.xls */ @ApiField("province_code") private String provinceCode; /** * 地址类型。取值范围:BUSINESS_ADDRESS:经营地址(默认) */ @ApiField("type") private String type; public String getAddress() { return this.address; } public void setAddress(String address) { this.address = address; } public String getCityCode() { return this.cityCode; } public void setCityCode(String cityCode) { this.cityCode = cityCode; } public String getDistrictCode() { return this.districtCode; } public void setDistrictCode(String districtCode) { this.districtCode = districtCode; } public String getLatitude() { return this.latitude; } public void setLatitude(String latitude) { this.latitude = latitude; } public String getLongitude() { return this.longitude; } public void setLongitude(String longitude) { this.longitude = longitude; } public String getProvinceCode() { return this.provinceCode; } public void setProvinceCode(String provinceCode) { this.provinceCode = provinceCode; } public String getType() { return this.type; } public void setType(String type) { this.type = type; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
08b9791e5ada526869bfde673115a9f9fb98f327
e605a77b565f59d39cb5ffbfb8cf6602ffa5242f
/app/src/main/java/com/geekband/huzhouapp/fragment/message/SuggestFragment.java
54f52e4037be99cd40d74c8feac6572c06046858
[]
no_license
saberccmiku/HuZhouApp1.0.2
16f1aa57a437275526bd52bc071cc92b1d1e7f4c
8681644925061857502b1609b8b6c57c26aa924b
refs/heads/master
2020-12-24T10:11:39.944092
2016-12-01T02:27:47
2016-12-01T02:27:47
73,154,209
0
0
null
null
null
null
UTF-8
Java
false
false
5,180
java
package com.geekband.huzhouapp.fragment.message; import android.app.ProgressDialog; import android.content.Context; import android.os.AsyncTask; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; import com.geekband.huzhouapp.utils.DataOperation; import com.geekband.huzhouapp.vo.pojo.ContentTable; import com.geekband.huzhouapp.vo.pojo.Document; import com.geekband.huzhouapp.vo.pojo.OpinionTable; import com.geekband.huzhouapp.R; import com.geekband.huzhouapp.activity.MainActivity; import com.geekband.huzhouapp.application.MyApplication; import com.geekband.huzhouapp.utils.Constants; import com.geekband.huzhouapp.utils.ViewUtils; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.text.SimpleDateFormat; import java.util.Date; /** * Created by Administrator on 2016/5/12 */ public class SuggestFragment extends Fragment { MainActivity mMainActivity; final String TAG = SuggestFragment.class.getSimpleName(); private EditText mSuggest_edit; public static SuggestFragment newInstance() { return new SuggestFragment(); } @Override public void onAttach(Context context) { super.onAttach(context); mMainActivity = (MainActivity) context; } @Nullable @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_suggest, null); String content = getCustomText(R.raw.us); TextView text_suggest = (TextView) view.findViewById(R.id.text_suggest); text_suggest.setText(content); mSuggest_edit = (EditText) view.findViewById(R.id.suggest_edit); mSuggest_edit.setOnFocusChangeListener(ViewUtils.getFocusChangeListener()); Button suggest_submit = (Button) view.findViewById(R.id.suggest_submit); suggest_submit.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String submitInfo = mSuggest_edit.getText().toString(); new SubmitTask().execute(submitInfo); } }); return view; } public String getCustomText(int id) { InputStream in = getResources().openRawResource(id); return getString(in); } //一个获取InputStream中字符串内容的方法: public String getString(InputStream in) { InputStreamReader inputStreamReader; StringBuilder sb = new StringBuilder(""); try { inputStreamReader = new InputStreamReader(in, "utf-8"); BufferedReader bufferedReader = new BufferedReader(inputStreamReader); String line; while ((line = bufferedReader.readLine()) != null) { sb.append(line); sb.append("\n"); } } catch (IOException e) { e.printStackTrace(); } return sb.toString(); } class SubmitTask extends AsyncTask<String ,Integer,Integer>{ ProgressDialog pd; @Override protected void onPreExecute() { pd = ProgressDialog.show(mMainActivity,null,"正在提交相关信息 ..."); } @Override protected Integer doInBackground(String... params) { //用户的contentId String contentId = MyApplication.sSharedPreferences.getString(Constants.AUTO_LOGIN,null); //投稿时间 Date date = new Date(); long time = date.getTime(); Date d = new Date(time); SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String postTime = sf.format(d); //插入一张需求建议表 OpinionTable opinionTable = new OpinionTable(); opinionTable.putField(OpinionTable.FIELD_USERID, contentId); opinionTable.putField(OpinionTable.FIELD_POSTTIME, postTime); opinionTable.putField(OpinionTable.FIELD_ISPASSED,"999"); if (DataOperation.insertOrUpdateTable(opinionTable,(Document) null)){ //获取内容表并插入数据 ContentTable contentTable = new ContentTable(); contentTable.putField(ContentTable.FIELD_SUBSTANCE, params[0]); contentTable.putField(ContentTable.FIELD_NEWSID, opinionTable.getContentId()); if (DataOperation.insertOrUpdateTable(contentTable,(Document) null)){ return 1; } } return 2; } @Override protected void onPostExecute(Integer integer) { pd.dismiss(); if (integer==1){ Toast.makeText(mMainActivity,"提交成功",Toast.LENGTH_SHORT).show(); mSuggest_edit.setText(null); } } } }
[ "639878266@qq.com" ]
639878266@qq.com
1a66b2dd51fb8c2728cb625b00cf6f01fca944de
dee3cbc549953b17049ef93973088db9dc39b6f6
/src/main/java/daris/web/client/model/shoppingcart/ShoppingCartCollectionRef.java
c9ae46894eb5e82bef78246b94465ddf047235ba
[ "MIT" ]
permissive
uom-daris/daris-web
060e4750ced71c1acea11bdebbaa29aae610d9aa
b5d10d33530084f35522ffcadb0f869573e6b172
refs/heads/master
2021-01-06T20:42:55.488215
2018-08-10T01:00:28
2018-08-10T01:00:28
78,803,017
0
0
null
null
null
null
UTF-8
Java
false
false
4,024
java
package daris.web.client.model.shoppingcart; import java.util.ArrayList; import java.util.Collection; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; import arc.mf.client.util.ListUtil; import arc.mf.client.xml.XmlElement; import arc.mf.client.xml.XmlStringWriter; import arc.mf.event.Filter; import arc.mf.event.Subscriber; import arc.mf.event.SystemEvent; import arc.mf.event.SystemEventChannel; import arc.mf.model.shopping.events.ShoppingCartEvent; import arc.mf.model.shopping.events.ShoppingEvent; import arc.mf.object.OrderedCollectionRef; import daris.web.client.model.shoppingcart.ShoppingCart.Status; public class ShoppingCartCollectionRef extends OrderedCollectionRef<ShoppingCartRef> implements Subscriber { public static interface Listener { void shoppingCartCollectionUpdated(); } public static final int DEFAULT_PAGE_SIZE = 100; private int _pageSize = DEFAULT_PAGE_SIZE; private Set<ShoppingCart.Status> _status; private List<Listener> _ls; private boolean _subscribed = false; public ShoppingCartCollectionRef(Collection<Status> status) { _status = new LinkedHashSet<ShoppingCart.Status>(); if (status != null && !status.isEmpty()) { _status = new LinkedHashSet<ShoppingCart.Status>(status); } _pageSize = DEFAULT_PAGE_SIZE; setCountMembers(true); } public ShoppingCartCollectionRef() { this(null); } @Override public final int defaultPagingSize() { return _pageSize; } public final ShoppingCartCollectionRef setPagingSize(int pageSize) { _pageSize = pageSize; return this; } @Override protected void resolveServiceArgs(XmlStringWriter w, long start, int size, boolean count) { if (_status != null) { for (ShoppingCart.Status status : _status) { w.add("status", status.value()); } } w.add("idx", start + 1); if (_pageSize == -1) { w.add("size", "infinity"); } else { w.add("size", size); } } @Override protected String resolveServiceName() { return "daris.shoppingcart.list"; } @Override protected ShoppingCartRef instantiate(XmlElement ce) throws Throwable { return new ShoppingCartRef(ce); } @Override protected String referentTypeName() { return ShoppingCart.TYPE_NAME; } @Override protected String[] objectElementNames() { return new String[] { "cart" }; } @Override public List<Filter> systemEventFilters() { return ListUtil.list(new Filter(ShoppingCartEvent.SYSTEM_EVENT_NAME), new Filter(ShoppingEvent.SYSTEM_EVENT_NAME)); } @Override public void process(SystemEvent se) { System.out.print(se.object()); reset(); notifyOfCollectionChange(); } public void notifyOfCollectionChange() { if (_ls != null) { for (Listener l : _ls) { l.shoppingCartCollectionUpdated(); } } } public void addListener(Listener l) { if (_ls == null) { _ls = new ArrayList<Listener>(); } _ls.add(l); } public void removeListener(Listener l) { if (_ls != null) { _ls.remove(l); } } public ShoppingCartCollectionRef subscribe() { if (!_subscribed) { SystemEventChannel.add(this); _subscribed = true; } return this; } public ShoppingCartCollectionRef unsubscribe() { if (_subscribed) { SystemEventChannel.remove(this); _subscribed = false; } return this; } @Override public boolean supportsPaging() { return _pageSize > 0; } public static final ShoppingCartCollectionRef ALL_CARTS = new ShoppingCartCollectionRef().setPagingSize(-1) .subscribe(); }
[ "wliu5@unimelb.edu.au" ]
wliu5@unimelb.edu.au
ba991bbd22299cf687c841268dee1bc9dd4b7280
1f9e1cb68c651f15d391677d873047a8e70b15ac
/src/test/java/fr/ign/cogit/geoxygene/contrib/geometrie/DistancesTest.java
12145823fc8cc7215c61dda3bf10959ff77da044
[]
no_license
GeOxygene/geoxygene-spatial
316285e7cbc1d5e90360b9517302ef3dd140a924
49b07ba9522c17fe011fea810e830f1d78e88756
refs/heads/main
2023-05-09T05:48:17.746634
2021-06-08T13:23:29
2021-06-08T13:23:29
375,009,305
0
0
null
null
null
null
UTF-8
Java
false
false
1,574
java
/** * */ package fr.ign.cogit.geoxygene.contrib.geometrie; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import fr.ign.cogit.geoxygene.api.spatial.coordgeom.ILineString; import fr.ign.cogit.geoxygene.spatial.coordgeom.DirectPosition; import fr.ign.cogit.geoxygene.spatial.coordgeom.GM_LineString; /** * @author Julien Perret * */ public class DistancesTest { /** * @throws java.lang.Exception */ @Before public void setUp() throws Exception { } /** * Test method for {@link fr.ign.cogit.geoxygene.contrib.geometrie.Distances#ecartSurface(fr.ign.cogit.geoxygene.api.spatial.coordgeom.ILineString, fr.ign.cogit.geoxygene.api.spatial.coordgeom.ILineString)}. */ @Test public void testEcartSurface() { ILineString l1 = new GM_LineString(new DirectPosition(0,0), new DirectPosition(10,0)); ILineString l2 = new GM_LineString(new DirectPosition(0,10), new DirectPosition(10,10), new DirectPosition(10,30)); double ecart = Distances.ecartSurface(l1, l2); Assert.assertEquals(100, ecart, 0.001); ILineString l3 = new GM_LineString(new DirectPosition(0,0), new DirectPosition(0,10)); ecart = Distances.ecartSurface(l1, l3); Assert.assertEquals(50, ecart, 0.001); ILineString l4 = new GM_LineString(new DirectPosition(0,0), new DirectPosition(0,10), new DirectPosition(10,10), new DirectPosition(10,0)); ILineString l5 = new GM_LineString(new DirectPosition(0,0), new DirectPosition(10,0)); ecart = Distances.ecartSurface(l5, l4); Assert.assertEquals(25, ecart, 0.001); } }
[ "micycle1@hotmail.co.uk" ]
micycle1@hotmail.co.uk
32dfb8b03b30ed054550e78a83a691d069432d63
d18af2a6333b1a868e8388f68733b3fccb0b4450
/java/src/com/showmax/app/ui/fragment/FragmentMain.java
14fb87600d5dd3c3092400e6a423f88542bb11b2
[]
no_license
showmaxAlt/showmaxAndroid
60576436172495709121f08bd9f157d36a077aad
d732f46d89acdeafea545a863c10566834ba1dec
refs/heads/master
2021-03-12T20:01:11.543987
2015-08-19T20:31:46
2015-08-19T20:31:46
41,050,587
0
1
null
null
null
null
UTF-8
Java
false
false
6,754
java
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package com.showmax.app.ui.fragment; import android.app.Activity; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.mautilus.lib.common.util.MauLog; import com.showmax.app.io.event.SubscriptionStatusChangedEvent; import com.showmax.app.ui.widget.AssetsTileView; import com.showmax.app.ui.widget.RefreshProgressBar; import com.showmax.app.ui.widget.ThreeViewPager; import com.showmax.lib.api.io.eventbus.EventBus; import com.showmax.lib.api.model.catalogue.Asset; import java.util.ArrayList; // Referenced classes of package com.showmax.app.ui.fragment: // FragmentBase public class FragmentMain extends FragmentBase implements com.showmax.app.ui.widget.ThreeViewPager.ThreeViewPagerListener { public static interface FragmentMainListener { public abstract void onAdvertisementClick(Asset asset); public abstract void onAdvertisementRefreshclick(); public abstract void onSeeAllClick(int i); } public static final String TAG = com/showmax/app/ui/fragment/FragmentMain.getSimpleName(); private ThreeViewPager mAdsThreeViewPager; private com.showmax.app.ui.widget.AssetsTileView.AssetsTileViewListener mAssetTileViewListener; private FragmentMainListener mFragmentMainListener; private FragmentBase.OnAssetClickListener mOnAssetClickListener; private RefreshProgressBar mProgressbar; private ViewGroup mTilesContainer; public FragmentMain() { mAssetTileViewListener = new com.showmax.app.ui.widget.AssetsTileView.AssetsTileViewListener() { final FragmentMain this$0; public void onAssetClick(Asset asset) { mOnAssetClickListener.onAssetClick(asset); } public void onSeeAllClick(View view, ArrayList arraylist, String s) { mFragmentMainListener.onSeeAllClick(((ViewGroup)view.getParent()).indexOfChild(view)); } { this$0 = FragmentMain.this; super(); } }; } public static FragmentMain newInstance() { MauLog.v("[FragmentMain]::[newInstance]"); FragmentMain fragmentmain = new FragmentMain(); fragmentmain.setArguments(new Bundle()); return fragmentmain; } public void appendAssetTile(com.showmax.app.ui.ActivityMain.Tile tile, boolean flag) { mProgressbar.setVisibility(8); mTilesContainer.setVisibility(0); if (flag) { mTilesContainer.removeAllViews(); } AssetsTileView assetstileview = (AssetsTileView)getActivity().getLayoutInflater().inflate(0x7f03004d, mTilesContainer, false); assetstileview.showAssets(tile.getAssets(), tile.getTileType(), tile.getCategory()); assetstileview.setAssetsTileViewListener(mAssetTileViewListener); mTilesContainer.addView(assetstileview); } protected String getSuccessorLogTag() { return TAG; } public void onActivityCreated(Bundle bundle) { super.onActivityCreated(bundle); } public void onAdvertisementClick(Asset asset) { mFragmentMainListener.onAdvertisementClick(asset); } public void onAttach(Activity activity) { try { mFragmentMainListener = (FragmentMainListener)activity; mOnAssetClickListener = (FragmentBase.OnAssetClickListener)activity; } // Misplaced declaration of an exception variable catch (Activity activity) { throw new IllegalStateException("Activity must implement fragment's callbacks."); } super.onAttach(activity); } public void onCreate(Bundle bundle) { super.onCreate(bundle); } public View onCreateView(LayoutInflater layoutinflater, ViewGroup viewgroup, Bundle bundle) { return layoutinflater.inflate(0x7f030041, viewgroup, false); } public void onDetach() { super.onDetach(); mFragmentMainListener = null; mOnAssetClickListener = null; } public void onEvent(SubscriptionStatusChangedEvent subscriptionstatuschangedevent) { MauLog.v("[%s]::[onEvent]::[SubscriptionStatusChangedEvent]", new Object[] { TAG }); if (mTilesContainer != null) { for (int i = 0; i < mTilesContainer.getChildCount(); i++) { subscriptionstatuschangedevent = mTilesContainer.getChildAt(i); if (subscriptionstatuschangedevent instanceof AssetsTileView) { ((AssetsTileView)subscriptionstatuschangedevent).refreshSubscriptionStatus(); } } } } public void onPause() { super.onPause(); } public void onResume() { super.onResume(); } public void onStart() { super.onStart(); if (mAdsThreeViewPager != null) { mAdsThreeViewPager.setAutoPageEnabled(true); } EventBus.getInstance().register(this); } public void onStop() { super.onStop(); EventBus.getInstance().unregister(this); if (mAdsThreeViewPager != null) { mAdsThreeViewPager.setAutoPageEnabled(false); } } public void onViewCreated(View view, Bundle bundle) { super.onViewCreated(view, bundle); mAdsThreeViewPager = (ThreeViewPager)view.findViewById(0x7f0b0106); mTilesContainer = (ViewGroup)view.findViewById(0x7f0b0107); mProgressbar = (RefreshProgressBar)view.findViewById(0x7f0b0108); mAdsThreeViewPager.setThreeViewPagerListener(this); mAdsThreeViewPager.setAutoPageEnabled(true); } public void showAdvertisements(ArrayList arraylist) { int i = 0; mProgressbar.setVisibility(8); mAdsThreeViewPager.setVisibility(0); if (arraylist == null || arraylist.isEmpty()) { mAdsThreeViewPager.setNoData(); return; } ThreeViewPager threeviewpager = mAdsThreeViewPager; if (isTablet()) { i = 1; } threeviewpager.setData(arraylist, i); } public void showProgressBar() { mProgressbar.setVisibility(0); mAdsThreeViewPager.setVisibility(8); mTilesContainer.setVisibility(8); } }
[ "invisible@example.com" ]
invisible@example.com
48f2294a0a090352a372775958bb2d2757dec908
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
/benchmark/test/org/sonar/server/qualityprofile/ActiveRuleChangeTest.java
6d2ac196cfc62ed04b8f19161fd836ee3f181adc
[]
no_license
STAMP-project/dspot-experiments
f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5
121487e65cdce6988081b67f21bbc6731354a47f
refs/heads/master
2023-02-07T14:40:12.919811
2019-11-06T07:17:09
2019-11-06T07:17:09
75,710,758
14
19
null
2023-01-26T23:57:41
2016-12-06T08:27:42
null
UTF-8
Java
false
false
2,068
java
/** * SonarQube * Copyright (C) 2009-2019 SonarSource SA * mailto:info AT sonarsource DOT com * * 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 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package org.sonar.server.qualityprofile; import java.util.Random; import org.junit.Test; import org.sonar.api.rule.RuleKey; import org.sonar.db.qualityprofile.ActiveRuleKey; import org.sonar.db.qualityprofile.QProfileChangeDto; import org.sonar.db.qualityprofile.QProfileDto; import org.sonar.db.rule.RuleDefinitionDto; import static Type.ACTIVATED; public class ActiveRuleChangeTest { private static final String A_USER_UUID = "A_USER_UUID"; @Test public void toDto() { QProfileDto profile = newQualityProfileDto(); ActiveRuleKey key = ActiveRuleKey.of(profile, RuleKey.of("P1", "R1")); int ruleId = new Random().nextInt(963); ActiveRuleChange underTest = new ActiveRuleChange(ACTIVATED, key, new RuleDefinitionDto().setId(ruleId)); QProfileChangeDto result = underTest.toDto(ActiveRuleChangeTest.A_USER_UUID); assertThat(result.getChangeType()).isEqualTo(Type.ACTIVATED.name()); assertThat(result.getRulesProfileUuid()).isEqualTo(profile.getRulesProfileUuid()); assertThat(result.getUserUuid()).isEqualTo(ActiveRuleChangeTest.A_USER_UUID); assertThat(result.getDataAsMap().get("ruleId")).isEqualTo(String.valueOf(ruleId)); } }
[ "benjamin.danglot@inria.fr" ]
benjamin.danglot@inria.fr
fdab81ce6989239a4d4260a276869d9da08836eb
252cacee4a8beb55a6b08be5f0fce4a99c78a6e5
/src/cloud/components/HCM_Old/TransferringWorkersITC.java
4c6a84c4d67e2de775a1e63b6889ab411d68f972
[]
no_license
vpamuriitc/SeleniumFramework_ITC
464822df38019186250ed8ffe1a109167910a7ed
9b95a4ce975a84d1e209ba9fdad94ea2453800f1
refs/heads/main
2023-05-06T10:53:34.546936
2021-05-19T08:38:16
2021-05-19T08:38:16
368,768,641
0
0
null
null
null
null
UTF-8
Java
false
false
5,947
java
package cloud.components.HCM_Old; import org.openqa.selenium.By; import org.openqa.selenium.support.ui.Select; import itc.framework.BaseTest; public class TransferringWorkersITC extends BaseTest{ public static String PersonName; public static String LegalEmployer; public static String BusinessUnit; public static String JOB; public static String Grade; public static String SalayCategory; public static String AnnualSalary; private static void run() throws InterruptedException{ // clickElement(By.id("pt1:_UISmmLink::icon")); // // clickElement(By.id("pt1:nv_itemNode_workforce_management_person_management")); setElementText(By.id("_FOpt1:_FOr1:0:_FOSritemNode_workforce_management_person_management:0:MAt1:0:pt1:Perso1:0:SP3:q1:value00::content"), PersonName); clickElement(By.id("_FOpt1:_FOr1:0:_FOSritemNode_workforce_management_person_management:0:MAt1:0:pt1:Perso1:0:SP3:q1::search")); clickElement(By.id("_FOpt1:_FOr1:0:_FOSritemNode_workforce_management_person_management:0:MAt1:0:pt1:Perso1:0:SP3:table1:_ATp:table2:0:gl1")); clickElement(By.cssSelector("span.xpc")); clickElement(By.cssSelector("td.x1fk")); Thread.sleep(2000); new Select(browser.findElement(By.id("_FOpt1:_FOr1:0:_FOSritemNode_workforce_management_person_management:0:MAt1:0:pt1:Manag1:0:AP1:actionsName1::content"))).selectByVisibleText("Global Transfer"); clickElement(By.cssSelector("option[title=\"Global Transfer\"]")); Thread.sleep(3000); new Select(browser.findElement(By.id("_FOpt1:_FOr1:0:_FOSritemNode_workforce_management_person_management:0:MAt1:0:pt1:Manag1:0:AP1:actionReason::content"))).selectByVisibleText("Career Progression"); clickElement(By.cssSelector("option[title=\"Career Progression\"]")); setElementText(By.id("_FOpt1:_FOr1:0:_FOSritemNode_workforce_management_person_management:0:MAt1:0:pt1:Manag1:0:AP1:legalEnt::content"), LegalEmployer); clickElement(By.id("_FOpt1:_FOr1:0:_FOSritemNode_workforce_management_person_management:0:MAt1:0:pt1:Manag1:0:AP1:cb10")); clickElement(By.id("_FOpt1:_FOr1:0:_FOSritemNode_workforce_management_person_management:0:MAt1:0:pt1:Manag1:0:AP1:ctb1")); clickElement(By.xpath("//div[@id='_FOpt1:_FOr1:0:_FOSritemNode_workforce_management_person_management:0:MAt1:0:pt1:Manag1:1:pt1:r1:0:AP1:tt1:next']/a/span")); setElementText(By.id("_FOpt1:_FOr1:0:_FOSritemNode_workforce_management_person_management:0:MAt1:0:pt1:Manag1:1:pt1:r1:0:AP1:NewPe1:0:pt_r1:0:df1_PersonDFFIteratorcandidate__FLEX_EMPTY::content"), "20454"); clickElement(By.linkText("Next")); Thread.sleep(2000); setElementText(By.id("_FOpt1:_FOr1:0:_FOSritemNode_workforce_management_person_management:0:MAt1:0:pt1:Manag1:1:pt1:r1:1:AP1:Perso1:0:Perso1:0:Maint1:0:i1:5:inputComboboxListOfValues28::content"), "76621"); Thread.sleep(2000); setElementText(By.id("_FOpt1:_FOr1:0:_FOSritemNode_workforce_management_person_management:0:MAt1:0:pt1:Manag1:1:pt1:r1:1:AP1:Perso1:0:Perso1:0:Maint1:0:i1:0:inputText17::content"), "Test Address"); clickElement(By.xpath("//div[contains(@id, 'tt1:next')]")); setElementText(By.id("_FOpt1:_FOr1:0:_FOSritemNode_workforce_management_person_management:0:MAt1:0:pt1:Manag1:1:pt1:r1:2:AP1:AddWo1:0:AddWo1:0:businessUnitId::content"), BusinessUnit); setElementText(By.id("_FOpt1:_FOr1:0:_FOSritemNode_workforce_management_person_management:0:MAt1:0:pt1:Manag1:1:pt1:r1:2:AP1:AddWo1:0:JobDe1:0:jobId::content"), JOB); setElementText(By.id("_FOpt1:_FOr1:0:_FOSritemNode_workforce_management_person_management:0:MAt1:0:pt1:Manag1:1:pt1:r1:2:AP1:AddWo1:0:JobDe1:0:gradeId::content"), Grade); clickElement(By.id("_FOpt1:_FOr1:0:_FOSritemNode_workforce_management_person_management:0:MAt1:0:pt1:Manag1:1:pt1:r1:2:AP1:sdi2::disAcr")); new Select(browser.findElement(By.id("_FOpt1:_FOr1:0:_FOSritemNode_workforce_management_person_management:0:MAt1:0:pt1:Manag1:1:pt1:r1:2:AP1:AddWo2:0:JobDe1:0:selectOneChoice2::content"))).selectByVisibleText("Salaried"); clickElement(By.cssSelector("option[title=\"Salaried\"]")); setElementText(By.id("_FOpt1:_FOr1:0:_FOSritemNode_workforce_management_person_management:0:MAt1:0:pt1:Manag1:1:pt1:r1:2:AP1:AddWo2:0:r7:0:idSalaryBasis::content"), SalayCategory); setElementText(By.id("_FOpt1:_FOr1:0:_FOSritemNode_workforce_management_person_management:0:MAt1:0:pt1:Manag1:1:pt1:r1:2:AP1:AddWo2:0:r7:0:idSalaryAmount::content"), AnnualSalary); new Select(browser.findElement(By.id("_FOpt1:_FOr1:0:_FOSritemNode_workforce_management_person_management:0:MAt1:0:pt1:Manag1:1:pt1:r1:2:AP1:AddWo2:0:JobDe1:0:df2_BaseWorkerAsgDFFIterator__FLEX_Context__FLEX_EMPTY::content"))).selectByVisibleText("Practice_GDC"); clickElement(By.cssSelector("option[title=\"Practice_GDC\"]")); clickElement(By.xpath("//div[@id='_FOpt1:_FOr1:0:_FOSritemNode_workforce_management_person_management:0:MAt1:0:pt1:Manag1:1:pt1:r1:2:AP1:tt1:next']/a/span")); Thread.sleep(2000); clickElement(By.linkText("Next")); Thread.sleep(2000); clickElement(By.linkText("Next")); Thread.sleep(2000); clickElement(By.xpath("//div[@id='_FOpt1:_FOr1:0:_FOSritemNode_workforce_management_person_management:0:MAt1:0:pt1:Manag1:1:pt1:r1:4:AP3:tt1:submit']/a/span")); clickElement(By.id("_FOpt1:_FOr1:0:_FOSritemNode_workforce_management_person_management:0:MAt1:0:pt1:Manag1:1:pt1:r1:4:AP3:tt1:okWarningDialog")); Thread.sleep(2000); clickElement(By.id("_FOpt1:_FOr1:0:_FOSritemNode_workforce_management_person_management:0:MAt1:0:pt1:Manag1:1:pt1:r1:4:AP3:tt1:okConfirmationDialog")); Thread.sleep(2000); clickElement(By.id("_FOpt1:_FOr1:0:_FOSritemNode_workforce_management_person_management:0:_FOTsr2:0:cb1")); } public static void run(int iterations) throws Exception{ initComponent(); for(int i=0;i<iterations;i++) { iteration=i; popluateParams(TransferringWorkersITC.class); run(); } } }
[ "vpamuri@itconvergence.com" ]
vpamuri@itconvergence.com
b507ab1792f5ad3695d4a457178f9fba6458764c
7dbbe21b902fe362701d53714a6a736d86c451d7
/BzenStudio-5.6/Source/com/zend/ide/p/d/db.java
b41e110c188f9e3edccfbb9d730d2ae9444ffbf2
[]
no_license
HS-matty/dev
51a53b4fd03ae01981549149433d5091462c65d0
576499588e47e01967f0c69cbac238065062da9b
refs/heads/master
2022-05-05T18:32:24.148716
2022-03-20T16:55:28
2022-03-20T16:55:28
196,147,486
0
0
null
null
null
null
UTF-8
Java
false
false
822
java
package com.zend.ide.p.d; import java.io.File; import javax.swing.JList; import javax.swing.ListModel; import javax.swing.event.ListDataEvent; class db implements Runnable { final ListDataEvent a; final l b; db(l paraml, ListDataEvent paramListDataEvent) { } public void run() { Object localObject = bw.a(this.b.a).getModel().getElementAt(this.a.getIndex0()); if (((localObject instanceof File)) && (((File)localObject).isDirectory())) { bw.a(this.b.a).setSelectedIndex(this.a.getIndex0()); if (this.b.a.bz) { bw.a(this.b.a, bw.a(this.b.a).getSelectedIndex()); this.b.a.bz = false; } } } } /* Location: C:\Program Files\Zend\ZendStudio-5.5.1\bin\ZendIDE.jar * Qualified Name: com.zend.ide.p.d.db * JD-Core Version: 0.6.0 */
[ "byqdes@gmail.com" ]
byqdes@gmail.com
c990b0b399519b27d0b6ac66f6cf19234ca2a75b
139960e2d7d55e71c15e6a63acb6609e142a2ace
/mobile_app1/module1180/src/main/java/module1180packageJava0/Foo21.java
7701f301878e239aa7776e4b20c860f87ef7a1ca
[ "Apache-2.0" ]
permissive
uber-common/android-build-eval
448bfe141b6911ad8a99268378c75217d431766f
7723bfd0b9b1056892cef1fef02314b435b086f2
refs/heads/master
2023-02-18T22:25:15.121902
2023-02-06T19:35:34
2023-02-06T19:35:34
294,831,672
83
7
Apache-2.0
2021-09-24T08:55:30
2020-09-11T23:27:37
Java
UTF-8
Java
false
false
431
java
package module1180packageJava0; import java.lang.Integer; public class Foo21 { Integer int0; Integer int1; public void foo0() { new module1180packageJava0.Foo20().foo6(); } public void foo1() { foo0(); } public void foo2() { foo1(); } public void foo3() { foo2(); } public void foo4() { foo3(); } public void foo5() { foo4(); } public void foo6() { foo5(); } }
[ "oliviern@uber.com" ]
oliviern@uber.com
08af7c597746080a726f56c877546b9d8682822f
08b13a4133c14f827bc51a2a6947a0852f2f7777
/src/test/java/test/pivotal/pal/trackerapi/TimeEntryApiTest.java
18387988ef5d38688abf6fcaccf8a9ed0ba09d92
[]
no_license
reeshreya/archive-pal-tracker
808e0416ac9c78b0d1ad12644784607fd2b08924
4e76a6e6320ba3091ff8f08c578ff1012af4d312
refs/heads/master
2021-10-08T00:10:48.307404
2018-12-05T08:58:38
2018-12-05T08:58:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,209
java
package test.pivotal.pal.trackerapi; import com.jayway.jsonpath.DocumentContext; import io.pivotal.pal.tracker.Pal; import io.pivotal.pal.tracker.TimeEntry; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.http.HttpEntity; import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.test.context.junit4.SpringRunner; import java.time.LocalDate; import java.util.Collection; import static com.jayway.jsonpath.JsonPath.parse; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; @RunWith(SpringRunner.class) @SpringBootTest(classes = Pal.class, webEnvironment = RANDOM_PORT) public class TimeEntryApiTest { @Autowired private TestRestTemplate restTemplate; private final long projectId = 123L; private final long userId = 456L; private TimeEntry timeEntry = new TimeEntry(projectId, userId, LocalDate.parse("2017-01-08"), 8); @Test public void testCreate() throws Exception { ResponseEntity<String> createResponse = restTemplate.postForEntity("/time-entries", timeEntry, String.class); assertThat(createResponse.getStatusCode()).isEqualTo(HttpStatus.CREATED); DocumentContext createJson = parse(createResponse.getBody()); assertThat(createJson.read("$.id", Long.class)).isGreaterThan(0); assertThat(createJson.read("$.projectId", Long.class)).isEqualTo(projectId); assertThat(createJson.read("$.userId", Long.class)).isEqualTo(userId); assertThat(createJson.read("$.date", String.class)).isEqualTo("2017-01-08"); assertThat(createJson.read("$.hours", Long.class)).isEqualTo(8); } @Test public void testList() throws Exception { Long id = createTimeEntry(); ResponseEntity<String> listResponse = restTemplate.getForEntity("/time-entries", String.class); assertThat(listResponse.getStatusCode()).isEqualTo(HttpStatus.OK); DocumentContext listJson = parse(listResponse.getBody()); Collection timeEntries = listJson.read("$[*]", Collection.class); assertThat(timeEntries.size()).isEqualTo(1); Long readId = listJson.read("$[0].id", Long.class); assertThat(readId).isEqualTo(id); } @Test public void testRead() throws Exception { Long id = createTimeEntry(); ResponseEntity<String> readResponse = this.restTemplate.getForEntity("/time-entries/" + id, String.class); assertThat(readResponse.getStatusCode()).isEqualTo(HttpStatus.OK); DocumentContext readJson = parse(readResponse.getBody()); assertThat(readJson.read("$.id", Long.class)).isEqualTo(id); assertThat(readJson.read("$.projectId", Long.class)).isEqualTo(projectId); assertThat(readJson.read("$.userId", Long.class)).isEqualTo(userId); assertThat(readJson.read("$.date", String.class)).isEqualTo("2017-01-08"); assertThat(readJson.read("$.hours", Long.class)).isEqualTo(8); } @Test public void testUpdate() throws Exception { Long id = createTimeEntry(); long projectId = 2L; long userId = 3L; TimeEntry updatedTimeEntry = new TimeEntry(projectId, userId, LocalDate.parse("2017-01-09"), 9); ResponseEntity<String> updateResponse = restTemplate.exchange("/time-entries/" + id, HttpMethod.PUT, new HttpEntity<>(updatedTimeEntry, null), String.class); assertThat(updateResponse.getStatusCode()).isEqualTo(HttpStatus.OK); DocumentContext updateJson = parse(updateResponse.getBody()); assertThat(updateJson.read("$.id", Long.class)).isEqualTo(id); assertThat(updateJson.read("$.projectId", Long.class)).isEqualTo(projectId); assertThat(updateJson.read("$.userId", Long.class)).isEqualTo(userId); assertThat(updateJson.read("$.date", String.class)).isEqualTo("2017-01-09"); assertThat(updateJson.read("$.hours", Long.class)).isEqualTo(9); } @Test public void testDelete() throws Exception { Long id = createTimeEntry(); ResponseEntity<String> deleteResponse = restTemplate.exchange("/time-entries/" + id, HttpMethod.DELETE, null, String.class); assertThat(deleteResponse.getStatusCode()).isEqualTo(HttpStatus.NO_CONTENT); ResponseEntity<String> deletedReadResponse = this.restTemplate.getForEntity("/time-entries/" + id, String.class); assertThat(deletedReadResponse.getStatusCode()).isEqualTo(HttpStatus.NOT_FOUND); } private Long createTimeEntry() { HttpEntity<TimeEntry> entity = new HttpEntity<>(timeEntry); ResponseEntity<TimeEntry> response = restTemplate.exchange("/time-entries", HttpMethod.POST, entity, TimeEntry.class); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.CREATED); return response.getBody().getId(); } }
[ "you@example.com" ]
you@example.com
ead2fde929d7ac80531600130c86ae4774c001c2
fb7efe44f4d9f30d623f880d0eb620f3a81f0fbd
/android_webview/javatests/src/org/chromium/android_webview/test/GetTitleTest.java
612cdab5a6c81afdc7ac45e60818236174898bf4
[ "BSD-3-Clause" ]
permissive
wzyy2/chromium-browser
2644b0daf58f8b3caee8a6c09a2b448b2dfe059c
eb905f00a0f7e141e8d6c89be8fb26192a88c4b7
refs/heads/master
2022-11-23T20:25:08.120045
2018-01-16T06:41:26
2018-01-16T06:41:26
117,618,467
3
2
BSD-3-Clause
2022-11-20T22:03:57
2018-01-16T02:09:10
null
UTF-8
Java
false
false
6,462
java
// Copyright 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package org.chromium.android_webview.test; import android.support.test.filters.SmallTest; import org.junit.Assert; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; import org.chromium.android_webview.AwContents; import org.chromium.base.test.util.Feature; import org.chromium.net.test.util.TestWebServer; /** * A test suite for ContentView.getTitle(). */ @RunWith(AwJUnit4ClassRunner.class) public class GetTitleTest { @Rule public AwActivityTestRule mActivityTestRule = new AwActivityTestRule(); private static final String TITLE = "TITLE"; private static final String GET_TITLE_TEST_PATH = "/get_title_test.html"; private static final String GET_TITLE_TEST_EMPTY_PATH = "/get_title_test_empty.html"; private static final String GET_TITLE_TEST_NO_TITLE_PATH = "/get_title_test_no_title.html"; private TestAwContentsClient mContentsClient; private AwContents mAwContents; private static class PageInfo { public final String mTitle; public final String mUrl; public PageInfo(String title, String url) { mTitle = title; mUrl = url; } } @Before public void setUp() throws Exception { mContentsClient = new TestAwContentsClient(); final AwTestContainerView testContainerView = mActivityTestRule.createAwTestContainerViewOnMainSync(mContentsClient); mAwContents = testContainerView.getAwContents(); } private static final String getHtml(String title) { StringBuilder html = new StringBuilder(); html.append("<html><head>"); if (title != null) { html.append("<title>" + title + "</title>"); } html.append("</head><body>BODY</body></html>"); return html.toString(); } private String loadFromDataAndGetTitle(String html) throws Throwable { mActivityTestRule.loadDataSync( mAwContents, mContentsClient.getOnPageFinishedHelper(), html, "text/html", false); return mActivityTestRule.getTitleOnUiThread(mAwContents); } private PageInfo loadFromUrlAndGetTitle(String html, String filename) throws Throwable { TestWebServer webServer = TestWebServer.start(); try { final String url = webServer.setResponse(filename, html, null); mActivityTestRule.loadUrlSync( mAwContents, mContentsClient.getOnPageFinishedHelper(), url); return new PageInfo(mActivityTestRule.getTitleOnUiThread(mAwContents), url.replaceAll("http:\\/\\/", "")); } finally { webServer.shutdown(); } } /** * When the data has title info, the page title is set to it. * @throws Throwable */ @Test @SmallTest @Feature({"AndroidWebView", "Main"}) public void testLoadDataGetTitle() throws Throwable { final String title = loadFromDataAndGetTitle(getHtml(TITLE)); Assert.assertEquals("Title should be " + TITLE, TITLE, title); } /** * When the data has empty title, the page title is set to the loaded content. * @throws Throwable */ @Test @SmallTest @Feature({"AndroidWebView"}) public void testGetTitleOnDataContainingEmptyTitle() throws Throwable { final String content = getHtml(""); final String expectedTitle = "data:text/html," + content; final String title = loadFromDataAndGetTitle(content); Assert.assertEquals( "Title should be set to the loaded data:text/html content", expectedTitle, title); } /** * When the data has no title, the page title is set to the loaded content. * @throws Throwable */ @Test @SmallTest @Feature({"AndroidWebView"}) public void testGetTitleOnDataContainingNoTitle() throws Throwable { final String content = getHtml(null); final String expectedTitle = "data:text/html," + content; final String title = loadFromDataAndGetTitle(content); Assert.assertEquals( "Title should be set to the data:text/html content", expectedTitle, title); } /** * When url-file has the title info, the page title is set to it. * @throws Throwable */ @Test @SmallTest @Feature({"AndroidWebView"}) public void testLoadUrlGetTitle() throws Throwable { final PageInfo info = loadFromUrlAndGetTitle(getHtml(TITLE), GET_TITLE_TEST_PATH); Assert.assertEquals("Title should be " + TITLE, TITLE, info.mTitle); } /** * When the loaded file has empty title, the page title is set to the url it loads from. * It also contains: hostName, portNumber information if its part of the loaded URL. * @throws Throwable */ @Test @SmallTest @Feature({"AndroidWebView"}) public void testGetTitleOnLoadUrlFileContainingEmptyTitle() throws Throwable { final PageInfo info = loadFromUrlAndGetTitle(getHtml(""), GET_TITLE_TEST_EMPTY_PATH); Assert.assertEquals("Incorrect title :: ", info.mUrl, info.mTitle); } /** * When the loaded file has no title, the page title is set to the urk it loads from. * It also contains: hostName, portNumber information if its part of the loaded URL. * @throws Throwable */ @Test @SmallTest @Feature({"AndroidWebView"}) public void testGetTitleOnLoadUrlFileContainingNoTitle() throws Throwable { final PageInfo info = loadFromUrlAndGetTitle(getHtml(null), GET_TITLE_TEST_NO_TITLE_PATH); Assert.assertEquals("Incorrect title :: ", info.mUrl, info.mTitle); } @Test @SmallTest @Feature({"AndroidWebView"}) public void testGetTitleSetFromJS() throws Throwable { final String expectedTitle = "Expected"; final String page = "<html><head>" + "<script>document.title=\"" + expectedTitle + "\"</script>" + "</head><body>" + "</body></html>"; mActivityTestRule.getAwSettingsOnUiThread(mAwContents).setJavaScriptEnabled(true); final String title = loadFromDataAndGetTitle(page); Assert.assertEquals("Incorrect title :: ", expectedTitle, title); } }
[ "jacob-chen@iotwrt.com" ]
jacob-chen@iotwrt.com
a0d1769d55b125e4efe96f02576c325aacff7f66
6ee92ecc85ba29f13769329bc5a90acea6ef594f
/bizcore/WEB-INF/retailscm_core_src/com/doublechaintech/retailscm/employeequalifier/EmployeeQualifierTokens.java
9ab49efa44f5e0e528c6749b719e0b49b3d5b909
[]
no_license
doublechaintech/scm-biz-suite
b82628bdf182630bca20ce50277c41f4a60e7a08
52db94d58b9bd52230a948e4692525ac78b047c7
refs/heads/master
2023-08-16T12:16:26.133012
2023-05-26T03:20:08
2023-05-26T03:20:08
162,171,043
1,387
500
null
2023-07-08T00:08:42
2018-12-17T18:07:12
Java
UTF-8
Java
false
false
4,226
java
package com.doublechaintech.retailscm.employeequalifier; import com.doublechaintech.retailscm.CommonTokens; import java.util.Map; import java.util.Objects; import com.doublechaintech.retailscm.employee.EmployeeTokens; public class EmployeeQualifierTokens extends CommonTokens { static final String ALL = "__all__"; // do not assign this to common users. static final String SELF = "__self__"; static final String OWNER_OBJECT_NAME = "employeeQualifier"; public static boolean checkOptions(Map<String, Object> options, String optionToCheck) { if (options == null) { return false; // completely no option here } if (options.containsKey(ALL)) { // danger, debug only, might load the entire database!, really terrible return true; } String ownerKey = getOwnerObjectKey(); Object ownerObject = (String) options.get(ownerKey); if (ownerObject == null) { return false; } if (!ownerObject.equals(OWNER_OBJECT_NAME)) { // is the owner? return false; } if (options.containsKey(optionToCheck)) { // options.remove(optionToCheck); // consume the key, can not use any more to extract the data with the same token. return true; } return false; } protected EmployeeQualifierTokens() { // ensure not initialized outside the class } public static EmployeeQualifierTokens of(Map<String, Object> options) { // ensure not initialized outside the class EmployeeQualifierTokens tokens = new EmployeeQualifierTokens(options); return tokens; } protected EmployeeQualifierTokens(Map<String, Object> options) { this.options = options; } public EmployeeQualifierTokens merge(String[] tokens) { this.parseTokens(tokens); return this; } public static EmployeeQualifierTokens mergeAll(String[] tokens) { return allTokens().merge(tokens); } protected EmployeeQualifierTokens setOwnerObject(String objectName) { ensureOptions(); addSimpleOptions(getOwnerObjectKey(), objectName); return this; } public static EmployeeQualifierTokens start() { return new EmployeeQualifierTokens().setOwnerObject(OWNER_OBJECT_NAME); } public EmployeeQualifierTokens withTokenFromListName(String listName) { addSimpleOptions(listName); return this; } public static EmployeeQualifierTokens loadGroupTokens(String... groupNames) { EmployeeQualifierTokens tokens = start(); if (groupNames == null || groupNames.length == 0) { return allTokens(); } addToken(tokens, EMPLOYEE, groupNames, new String[] {"default"}); return tokens; } private static void addToken( EmployeeQualifierTokens pTokens, String pTokenName, String[] pGroupNames, String[] fieldGroups) { if (pGroupNames == null || fieldGroups == null) { return; } for (String groupName : pGroupNames) { for (String g : fieldGroups) { if (Objects.equals(groupName, g)) { pTokens.addSimpleOptions(pTokenName); break; } } } } public static EmployeeQualifierTokens filterWithTokenViewGroups(String[] viewGroups) { return start().withEmployee(); } public static EmployeeQualifierTokens allTokens() { return start().withEmployee(); } public static EmployeeQualifierTokens withoutListsTokens() { return start().withEmployee(); } public static Map<String, Object> all() { return allTokens().done(); } public static Map<String, Object> withoutLists() { return withoutListsTokens().done(); } public static Map<String, Object> empty() { return start().done(); } public EmployeeQualifierTokens analyzeAllLists() { addSimpleOptions(ALL_LISTS_ANALYZE); return this; } protected static final String EMPLOYEE = "employee"; public String getEmployee() { return EMPLOYEE; } // public EmployeeQualifierTokens withEmployee() { addSimpleOptions(EMPLOYEE); return this; } public EmployeeTokens withEmployeeTokens() { // addSimpleOptions(EMPLOYEE); return EmployeeTokens.start(); } public EmployeeQualifierTokens searchEntireObjectText(String verb, String value) { return this; } }
[ "zhangxilai@doublechaintech.com" ]
zhangxilai@doublechaintech.com
ef565a475f7aa4574c19997ec9e83408d8e58776
fa1408365e2e3f372aa61e7d1e5ea5afcd652199
/src/testcases/CWE605_Multiple_Binds_Same_Port/CWE605_Multiple_Binds_Same_Port__basic_07.java
4dcbdd68b5f159751379f41fd63f56e07aec45a6
[]
no_license
bqcuong/Juliet-Test-Case
31e9c89c27bf54a07b7ba547eddd029287b2e191
e770f1c3969be76fdba5d7760e036f9ba060957d
refs/heads/master
2020-07-17T14:51:49.610703
2019-09-03T16:22:58
2019-09-03T16:22:58
206,039,578
1
2
null
null
null
null
UTF-8
Java
false
false
6,354
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE605_Multiple_Binds_Same_Port__basic_07.java Label Definition File: CWE605_Multiple_Binds_Same_Port__basic.label.xml Template File: point-flaw-07.tmpl.java */ /* * @description * CWE: 605 Multiple binds to the same port * Sinks: * GoodSink: two binds on different ports * BadSink : two binds on one port * Flow Variant: 07 Control flow: if(privateFive==5) and if(privateFive!=5) * * */ package testcases.CWE605_Multiple_Binds_Same_Port; import testcasesupport.*; import java.net.ServerSocket; import java.net.InetSocketAddress; import java.io.IOException; import java.util.logging.Level; public class CWE605_Multiple_Binds_Same_Port__basic_07 extends AbstractTestCase { /* The variable below is not declared "final", but is never assigned * any other value so a tool should be able to identify that reads of * this will always give its initialized value. */ private int privateFive = 5; public void bad() throws Throwable { if (privateFive == 5) { ServerSocket socket1 = null; ServerSocket socket2 = null; try { socket1 = new ServerSocket(); socket1.bind(new InetSocketAddress(15000)); socket2 = new ServerSocket(); /* FLAW: This will bind a second Socket to port 15000, but only for connections from localhost */ socket2.bind(new InetSocketAddress("localhost", 15000)); } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Unable to bind a socket", exceptIO); } finally { try { if (socket2 != null) { socket2.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing Socket", exceptIO); } try { if (socket1 != null) { socket1.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing Socket", exceptIO); } } } } /* good1() changes privateFive==5 to privateFive!=5 */ private void good1() throws Throwable { if (privateFive != 5) { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ IO.writeLine("Benign, fixed string"); } else { ServerSocket socket1 = null; ServerSocket socket2 = null; try { socket1 = new ServerSocket(); socket1.bind(new InetSocketAddress(15000)); socket2 = new ServerSocket(); /* FIX: This will bind the second Socket to a different port */ socket2.bind(new InetSocketAddress("localhost", 15001)); } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Unable to bind a socket", exceptIO); } finally { try { if (socket2 != null) { socket2.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing Socket", exceptIO); } try { if (socket1 != null) { socket1.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing Socket", exceptIO); } } } } /* good2() reverses the bodies in the if statement */ private void good2() throws Throwable { if (privateFive == 5) { ServerSocket socket1 = null; ServerSocket socket2 = null; try { socket1 = new ServerSocket(); socket1.bind(new InetSocketAddress(15000)); socket2 = new ServerSocket(); /* FIX: This will bind the second Socket to a different port */ socket2.bind(new InetSocketAddress("localhost", 15001)); } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Unable to bind a socket", exceptIO); } finally { try { if (socket2 != null) { socket2.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing Socket", exceptIO); } try { if (socket1 != null) { socket1.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing Socket", exceptIO); } } } } public void good() throws Throwable { good1(); good2(); } /* Below is the main(). It is only used when building this testcase on * its own for testing or for building a binary to use in testing binary * analysis tools. It is not used when compiling all the testcases as one * application, which is how source code analysis tools are tested. */ public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException { mainFromParent(args); } }
[ "bqcuong2212@gmail.com" ]
bqcuong2212@gmail.com
ebf8d8b6b7b84dd86ea9c8abfac5a4e056111cb2
47bbb2f7d41b6b8c0e72744f78b57b6f1bfa3a05
/java/com/project/fms/activity/JspModule.java
aa710279900a85377a954a9f8e72cfe55351e8dd
[]
no_license
devmanager-oxy/oxysystem_sp
bd43a9abacc184f611e2ba780921cf85d9bea5b1
cc1871d03d2bf952d571b9ec3d57ce9716cc156e
refs/heads/master
2022-12-22T12:49:30.057223
2020-09-29T09:48:30
2020-09-29T09:48:30
294,572,696
0
0
null
null
null
null
UTF-8
Java
false
false
4,754
java
package com.project.fms.activity; import java.io.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; import com.project.util.jsp.*; import com.project.general.*; import com.project.util.*; public class JspModule extends JSPHandler implements I_JSPInterface, I_JSPType { private Module module; public static final String JSP_NAME_MODULE = "module" ; public static final int JSP_MODULE_ID = 0 ; public static final int JSP_PARENT_ID = 1 ; public static final int JSP_CODE = 2 ; public static final int JSP_LEVEL = 3 ; public static final int JSP_DESCRIPTION = 4 ; public static final int JSP_OUTPUT_DELIVER = 5 ; public static final int JSP_PERFORM_INDICATOR = 6 ; public static final int JSP_ASSUM_RISK = 7 ; public static final int JSP_STATUS = 8 ; public static final int JSP_TYPE = 9 ; public static final int JSP_COST_IMPLICATION = 10; public static final int JSP_PARENT_ID_M = 11; public static final int JSP_PARENT_ID_S = 12; public static final int JSP_PARENT_ID_SH = 13; public static final int JSP_PARENT_ID_A = 14; public static final int JSP_STATUS_POST = 15; public static final int JSP_INITIAL = 16; public static final int JSP_EXPIRED_DATE = 17; public static final int JSP_POSITION_LEVEL = 18; public static final int JSP_ACTIVITY_PERIOD_ID = 19; public static final int JSP_PARENT_ID_SA = 20; public static String[] colNames = { "x_module_id", "x_parent_id", "x_code", "x_level", "x_description", "x_output_deliver", "x_perform_indicator", "x_assum_risk", "x_status", "x_type", "x_cimp", "M", "S", "SH", "A", "postab", "JSP_INITIAL", "JSP_EXPIRED_DATE", "JSP_POSITION_LEVEL", "JSP_ACTIVITY_PERIOD_ID", "SA" } ; public static int[] fieldTypes = { TYPE_LONG, TYPE_LONG, TYPE_STRING + ENTRY_REQUIRED, TYPE_STRING + ENTRY_REQUIRED, TYPE_STRING, TYPE_STRING, TYPE_STRING, TYPE_STRING, TYPE_STRING, TYPE_STRING, TYPE_STRING, TYPE_LONG, TYPE_LONG, TYPE_LONG, TYPE_LONG, TYPE_STRING, TYPE_STRING, TYPE_STRING, TYPE_STRING, TYPE_LONG, TYPE_LONG } ; public JspModule(){ } public JspModule(Module module){ this.module = module; } public JspModule(HttpServletRequest request, Module module){ super(new JspModule(module), request); this.module = module; } public String getFormName() { return JSP_NAME_MODULE; } public int[] getFieldTypes() { return fieldTypes; } public String[] getFieldNames() { return colNames; } public int getFieldSize() { return colNames.length; } public Module getEntityObject(){ return module; } public void requestEntityObject(Module module) { try{ this.requestParam(); module.setParentId(getLong(JSP_PARENT_ID)); module.setCode(getString(JSP_CODE)); module.setLevel(getString(JSP_LEVEL)); module.setDescription(getString(JSP_DESCRIPTION)); module.setOutputDeliver(getString(JSP_OUTPUT_DELIVER)); module.setPerformIndicator(getString(JSP_PERFORM_INDICATOR)); module.setAssumRisk(getString(JSP_ASSUM_RISK)); module.setStatus(getString(JSP_STATUS)); module.setType(getString(JSP_TYPE)); module.setCostImplication(getString(JSP_COST_IMPLICATION)); module.setParentIdM(getLong(JSP_PARENT_ID_M)); module.setParentIdS(getLong(JSP_PARENT_ID_S)); module.setParentIdSH(getLong(JSP_PARENT_ID_SH)); module.setParentIdA(getLong(JSP_PARENT_ID_A)); module.setStatusPost(getString(JSP_STATUS_POST)); module.setInitial(getString(JSP_INITIAL)); module.setExpiredDate(JSPFormater.formatDate(getString(JSP_EXPIRED_DATE), "dd/MM/yyyy")); module.setPositionLevel(getString(JSP_POSITION_LEVEL)); module.setActivityPeriodId(getLong(JSP_ACTIVITY_PERIOD_ID)); module.setParentIdSA(getLong(JSP_PARENT_ID_SA)); }catch(Exception e){ System.out.println("Error on requestEntityObject : "+e.toString()); } } }
[ "devmgr@oxysystem.com" ]
devmgr@oxysystem.com
696817c054e79619454fd5bd0736ac425346e180
36609e6cab59d6d580b34d9ad950df9cbce9c3ee
/schemacrawler-sqlserver/src/test/java/schemacrawler/integration/test/TestBundledDistributions.java
c5267f39db3142d55cded9df6223ad3e18ad4805
[ "MIT" ]
permissive
adriens/SchemaCrawler
b78cbc21677a258461595fbb3c32046915b0a58d
0b7dfdd6e05ece0e66f931e753a45d562861150d
refs/heads/master
2020-04-04T21:52:26.541833
2018-11-05T23:23:33
2018-11-05T23:23:33
156,301,332
0
0
NOASSERTION
2018-12-26T07:10:57
2018-11-06T00:16:22
Java
UTF-8
Java
false
false
2,192
java
/* ======================================================================== SchemaCrawler http://www.schemacrawler.com Copyright (c) 2000-2018, Sualeh Fatehi <sualeh@hotmail.com>. All rights reserved. ------------------------------------------------------------------------ SchemaCrawler 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. SchemaCrawler and the accompanying materials are made available under the terms of the Eclipse Public License v1.0, GNU General Public License v3 or GNU Lesser General Public License v3. You may elect to redistribute this code under any of these licenses. The Eclipse Public License is available at: http://www.eclipse.org/legal/epl-v10.html The GNU General Public License v3 and the GNU Lesser General Public License v3 are available at: http://www.gnu.org/licenses/ ======================================================================== */ package schemacrawler.integration.test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.sql.Connection; import org.junit.Test; import schemacrawler.test.utility.BaseSchemaCrawlerTest; import schemacrawler.tools.databaseconnector.DatabaseConnector; import schemacrawler.tools.databaseconnector.DatabaseConnectorRegistry; public class TestBundledDistributions extends BaseSchemaCrawlerTest { @Test public void testInformationSchema_sqlserver() throws Exception { final Connection connection = null; final DatabaseConnectorRegistry registry = new DatabaseConnectorRegistry(); final DatabaseConnector databaseSystemIdentifier = registry .lookupDatabaseConnector("sqlserver"); assertEquals(8, databaseSystemIdentifier .getSchemaRetrievalOptionsBuilder(connection).toOptions() .getInformationSchemaViews().size()); } @Test public void testPlugin_sqlserver() throws Exception { final DatabaseConnectorRegistry registry = new DatabaseConnectorRegistry(); assertTrue(registry.hasDatabaseSystemIdentifier("sqlserver")); } }
[ "sualeh@hotmail.com" ]
sualeh@hotmail.com
80d0105d873e977dd7e67f7d03a56fcfbd54c0bd
180e78725121de49801e34de358c32cf7148b0a2
/dataset/protocol1/spoon/learning/1058/SourceFragmentCreator.java
4570525bab5d064bcba96b0b31e2cbaa2df02d7b
[]
no_license
ASSERT-KTH/synthetic-checkstyle-error-dataset
40e8d1e0a7ebe7f7711def96a390891a6922f7bd
40c057e1669584bfc6fecf789b5b2854660222f3
refs/heads/master
2023-03-18T12:50:55.410343
2019-01-25T09:54:39
2019-01-25T09:54:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,803
java
/** * Copyright (C) 2006-2018 INRIA and contributors * Spoon - http://spoon.gforge.inria.fr/ * * This software is governed by the CeCILL-C License under French law and * abiding by the rules of distribution of free software. You can use, modify * and/or redistribute the software under the terms of the CeCILL-C license as * circulated by CEA, CNRS and INRIA at http://www.cecill.info. * * 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 CeCILL-C License for more details. * * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ package spoon.support.modelobs; import spoon.reflect.cu.CompilationUnit; import spoon.reflect.declaration.CtElement; import spoon.reflect.path.CtRole; import spoon.support.sniper.internal.ElementSourceFragment; /** * A {@link ChangeCollector}, which builds a tree of {@link ElementSourceFragment}s of {@link CompilationUnit} of the modified element * lazily just before the element is changed */ public class SourceFragmentCreator extends ChangeCollector { @Override protected void onChange(CtElement currentElement, CtRole role) { if (!currentElement.isParentInitialized()) { //parent is not initialized. It is just creation of a temporary element //ignore such "change" return; } CompilationUnit cu = currentElement.getPosition().getCompilationUnit(); if (cu != null) { //getOriginalSourceFragment is not only a getter, it actually //builds a tree of SourceFragments of compilation unit of the modified element cu.getOriginalSourceFragment (); } super.onChange(currentElement, role); } }
[ "bloriot97@gmail.com" ]
bloriot97@gmail.com
0d37825ff32f4389682f4f911e7bb4a55dbd5513
bf8824df760ed2db3de1ce63cda90e94c112288b
/src/main/java/com/heshidai/gold/console/common/util/SpringContextHolder.java
0af18d1dec1eabf7bc92837bc783f71c00399a12
[]
no_license
xiexionghui/console-pc
095d2ebb509431d12f1f27885a74ffb1407b4059
0455fefa5eb85233b42560722a179242ccefaab9
refs/heads/master
2021-01-19T19:01:57.984358
2017-08-23T13:12:31
2017-08-23T13:12:31
101,180,661
0
0
null
null
null
null
UTF-8
Java
false
false
3,403
java
/** * Copyright &copy; 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved. */ package com.heshidai.gold.console.common.util; import org.apache.commons.lang3.Validate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.DisposableBean; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; /** * 功能:以静态变量保存Spring ApplicationContext, 可在任何代码任何地方任何时候取出ApplicaitonContext * * @version 2017年1月4日下午2:33:47 * @author baocheng.ren */ @Service @Lazy(false) public class SpringContextHolder implements ApplicationContextAware, DisposableBean { private static ApplicationContext APPLICATION_CONTEXT = null; private static Logger logger = LoggerFactory.getLogger(SpringContextHolder.class); /** * 功能:取得存储在静态变量中的ApplicationContext * * @version 2017年1月4日下午2:34:57 * @author baocheng.ren * @return ApplicationContext */ public static ApplicationContext getApplicationContext() { assertContextInjected(); return APPLICATION_CONTEXT; } /** * 功能:从静态变量applicationContext中取得Bean, 自动转型为所赋值对象的类型 * * @version 2017年1月4日下午2:35:17 * @author baocheng.ren * @param name 名称 * @param <T> object * @return <T> */ @SuppressWarnings("unchecked") public static <T> T getBean(String name) { assertContextInjected(); return (T) APPLICATION_CONTEXT.getBean(name); } /** * 功能:从静态变量applicationContext中取得Bean, 自动转型为所赋值对象的类型 * * @version 2017年1月4日下午2:35:36 * @author baocheng.ren * @param requiredType 类型 * @param <T> object * @return <T> */ public static <T> T getBean(Class<T> requiredType) { assertContextInjected(); return APPLICATION_CONTEXT.getBean(requiredType); } /** * 功能:清除SpringContextHolder中的ApplicationContext为Null * * @version 2017年1月4日下午2:35:55 * @author baocheng.ren */ public static void clearHolder() { if (logger.isDebugEnabled()) { logger.debug("清除SpringContextHolder中的ApplicationContext:" + APPLICATION_CONTEXT); } APPLICATION_CONTEXT = null; } /** * 实现ApplicationContextAware接口, 注入Context到静态变量中 */ @Override public void setApplicationContext(ApplicationContext applicationContext) { SpringContextHolder.APPLICATION_CONTEXT = applicationContext; } /** * 实现DisposableBean接口, 在Context关闭时清理静态变量. */ @Override public void destroy() throws Exception { SpringContextHolder.clearHolder(); } /** * 检查ApplicationContext不为空. */ private static void assertContextInjected() { Validate.validState(APPLICATION_CONTEXT != null, "applicaitonContext属性未注入, 请在applicationContext.xml中定义SpringContextHolder."); } }
[ "you@example.com" ]
you@example.com