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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9ca33efa23ad249812ae87016638a4a74bd2097d | b66bdee811ed0eaea0b221fea851f59dd41e66ec | /src/com/braintreepayments/api/threedsecure/a.java | fc1aeeb29b85d9ad6c3b969014816ed62eaec46b | [] | no_license | reverseengineeringer/com.grubhub.android | 3006a82613df5f0183e28c5e599ae5119f99d8da | 5f035a4c036c9793483d0f2350aec2997989f0bb | refs/heads/master | 2021-01-10T05:08:31.437366 | 2016-03-19T20:41:23 | 2016-03-19T20:41:23 | 54,286,207 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,233 | java | package com.braintreepayments.api.threedsecure;
import android.os.Message;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebView.WebViewTransport;
public class a
extends WebChromeClient
{
private ThreeDSecureWebViewActivity a;
public a(ThreeDSecureWebViewActivity paramThreeDSecureWebViewActivity)
{
a = paramThreeDSecureWebViewActivity;
}
public void onCloseWindow(WebView paramWebView)
{
a.a();
}
public boolean onCreateWindow(WebView paramWebView, boolean paramBoolean1, boolean paramBoolean2, Message paramMessage)
{
paramWebView = new b(a);
paramWebView.a(a);
a.a(paramWebView);
((WebView.WebViewTransport)obj).setWebView(paramWebView);
paramMessage.sendToTarget();
return true;
}
public void onProgressChanged(WebView paramWebView, int paramInt)
{
super.onProgressChanged(paramWebView, paramInt);
if (paramInt < 100)
{
a.setProgress(paramInt);
a.setProgressBarVisibility(true);
return;
}
a.setProgressBarVisibility(false);
}
}
/* Location:
* Qualified Name: com.braintreepayments.api.threedsecure.a
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"reverseengineeringer@hackeradmin.com"
] | reverseengineeringer@hackeradmin.com |
f26b8b883f4b9b0e843edba47d6d488c06789b55 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/32/32_ea97d8157d1049cdbd393557a31063ba9276c96f/ServerConnection/32_ea97d8157d1049cdbd393557a31063ba9276c96f_ServerConnection_s.java | 33f84fce45ec55059c6d5ddeaf4c6798e911d704 | [] | 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,774 | java | package network;
import java.io.IOException;
import java.net.ServerSocket;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import logic.Debt;
import logic.DebtStatus;
import logic.User;
import requests.xml.XMLSerializable;
public class ServerConnection {
private Map<String, User> users;
private List<ServerConnectionHandler> handlers;
private long nextDebtId;
public ServerConnection() {
this.handlers = new ArrayList<ServerConnectionHandler>();
users = new HashMap<String, User>();
}
public synchronized void addConnectionHandler(ServerConnectionHandler handler) {
this.handlers.add(handler);
}
public synchronized void removeConnectionHandler(ServerConnectionHandler handler) {
this.handlers.remove(handler);
}
/**
* @return The next available debt id
*/
public synchronized long getNextDebtId() {
return nextDebtId++;
}
/**
* Notifies the specified user by sending the given object to the user's UpdateListener
* @param username The user to notify
* @param objectToSend The object to send
*/
public void notifyUser(String username, XMLSerializable objectToSend) {
System.out.println("Notifying " + username);
ServerConnectionHandler handler = getHandler(username);
if(handler != null) {
handler.sendUpdate(objectToSend.toXML());
System.out.println("Sent to: " + handler.getUser().getUsername());
}
}
/**
* Returns the specified user's ServerConnectionHandler
* @param username The user's user name
* @return The user's ServerConnectionHandler
*/
public ServerConnectionHandler getHandler(String username) {
for (ServerConnectionHandler h : handlers) {
if(h.getUser().getUsername().equals(username)) return h;
}
return null;
}
/**
* Listens at the specified port for incoming connections.
* Incoming connections are given to a ServerConnectionHandler that is started in a separate Thread.
* This method will run "forever"
* @param port The port to listen to
*/
public void accept(int port) {
ServerSocket ss = null;
try {
ss = new ServerSocket(port);
while(true) {
System.out.println("Listening for incomming connections..");
new ServerConnectionHandler(ss.accept(), this).start();
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
try {
ss.close();
} catch (Exception e) {}
}
}
synchronized public User getUser(String username) {
return users.get(username);
}
synchronized public void addUser(User user) {
users.put(user.getUsername(), user);
}
public static void main(String[] args) {
ServerConnection server = new ServerConnection();
server.nextDebtId = 1;
User arne = new User("arnegopro", "qazqaz");
User stian = new User("stian", "asd");
stian.addFriend(arne);
arne.addFriend(stian);
server.users.put("arnegopro", arne);
server.users.put("stian", stian);
System.out.println("Loaded users:");
for (String s : server.users.keySet()) {
System.out.println(s);
}
// TODO: TEST IF LOADED DEBTS IS SENT
Debt d1 = new Debt(0, 100, "g", arne, stian, "goldz", stian);
Debt d2 = new Debt(1, 12, "s", stian, arne, "s", stian);
Debt d3 = new Debt(2, 1337, "slaps", stian, arne, ":D", arne);
Debt d4 = new Debt(2, 42, "42ere", arne, stian, "haha", arne);
d4.setStatus(DebtStatus.CONFIRMED);
stian.addPendingDebt(d1);
stian.addPendingDebt(d2);
stian.addPendingDebt(d3);
stian.addConfirmedDebt(d4);
arne.addPendingDebt(d1);
arne.addPendingDebt(d2);
arne.addPendingDebt(d3);
arne.addConfirmedDebt(d4);
server.accept(13337);
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
9e4ccc32d291446c41ca980fc46f5c20b33760b3 | dd80a584130ef1a0333429ba76c1cee0eb40df73 | /external/antlr/antlr-3.4/runtime/Java/src/main/java/org/antlr/runtime/tree/RewriteRuleTokenStream.java | 4cd7b087e2e78c76080d20a80ea3c365d6b6746f | [
"MIT",
"BSD-3-Clause"
] | permissive | karunmatharu/Android-4.4-Pay-by-Data | 466f4e169ede13c5835424c78e8c30ce58f885c1 | fcb778e92d4aad525ef7a995660580f948d40bc9 | refs/heads/master | 2021-03-24T13:33:01.721868 | 2017-02-18T17:48:49 | 2017-02-18T17:48:49 | 81,847,777 | 0 | 2 | MIT | 2020-03-09T00:02:12 | 2017-02-13T16:47:00 | null | UTF-8 | Java | false | false | 2,685 | java | /*
[The "BSD license"]
Copyright (c) 2005-2009 Terence Parr
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.antlr.runtime.tree;
import org.antlr.runtime.Token;
import java.util.List;
public class RewriteRuleTokenStream extends RewriteRuleElementStream {
public RewriteRuleTokenStream(TreeAdaptor adaptor, String elementDescription) {
super(adaptor, elementDescription);
}
/** Create a stream with one element */
public RewriteRuleTokenStream(TreeAdaptor adaptor,
String elementDescription,
Object oneElement)
{
super(adaptor, elementDescription, oneElement);
}
/** Create a stream, but feed off an existing list */
public RewriteRuleTokenStream(TreeAdaptor adaptor,
String elementDescription,
List elements)
{
super(adaptor, elementDescription, elements);
}
/** Get next token from stream and make a node for it */
public Object nextNode() {
Token t = (Token)_next();
return adaptor.create(t);
}
public Token nextToken() {
return (Token)_next();
}
/** Don't convert to a tree unless they explicitly call nextTree.
* This way we can do hetero tree nodes in rewrite.
*/
protected Object toTree(Object el) {
return el;
}
protected Object dup(Object el) {
throw new UnsupportedOperationException("dup can't be called for a token stream.");
}
}
| [
"karun.matharu@gmail.com"
] | karun.matharu@gmail.com |
f1139d4d56b4a6b34156e992b61b492786665d85 | de325819e931c79b25fde0ec5db511e6235e98bd | /src/main/java/net/sagebits/tmp/isaac/rest/api1/data/semantic/dataTypes/RestDynamicSemanticString.java | 3d60316735e62a1c6ef4a79522dde0ce41e423bf | [
"Apache-2.0"
] | permissive | Sagebits/uts-rest-api | d5f318d0be7de6b64801eb3478abc6911973ac88 | 65c749c16b5f8241bea4511b855e4274c330e0af | refs/heads/develop | 2023-05-11T07:37:57.918343 | 2020-05-18T06:49:48 | 2020-05-18T06:49:48 | 157,817,215 | 0 | 0 | Apache-2.0 | 2023-05-09T18:06:40 | 2018-11-16T05:29:17 | Java | UTF-8 | Java | false | false | 2,183 | java | /*
* Copyright 2018 VetsEZ Inc, Sagebits LLC
*
* 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.
*
* Contributions from 2015-2017 where performed either by US government
* employees, or under US Veterans Health Administration contracts.
*
* US Veterans Health Administration contributions by government employees
* are work of the U.S. Government and are not subject to copyright
* protection in the United States. Portions contributed by government
* employees are USGovWork (17USC §105). Not subject to copyright.
*
* Contribution by contractors to the US Veterans Health Administration
* during this period are contractually contributed under the
* Apache License, Version 2.0.
*
* See: https://www.usa.gov/government-works
*/
package net.sagebits.tmp.isaac.rest.api1.data.semantic.dataTypes;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import net.sagebits.tmp.isaac.rest.api1.data.semantic.RestDynamicSemanticData;
/**
*
* {@link RestDynamicSemanticString}
*
* @author <a href="mailto:daniel.armbrust.list@sagebits.net">Dan Armbrust</a>
*/
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY, getterVisibility = JsonAutoDetect.Visibility.NONE, setterVisibility = JsonAutoDetect.Visibility.NONE)
@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY)
public class RestDynamicSemanticString extends RestDynamicSemanticData
{
public RestDynamicSemanticString(int columnNumber, String string)
{
super(columnNumber, string);
}
public String getString()
{
return (String) data;
}
protected RestDynamicSemanticString()
{
// for jaxb
}
}
| [
"daniel.armbrust.list@gmail.com"
] | daniel.armbrust.list@gmail.com |
7839e40fdfd8d14df5be53b64db34177ac43f43c | 647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4 | /com.tencent.mm/classes.jar/com/tencent/mm/autogen/b/gf.java | 903a9fb6583a81b2c09c69107c50ea3971abaaaf | [] | no_license | tsuzcx/qq_apk | 0d5e792c3c7351ab781957bac465c55c505caf61 | afe46ef5640d0ba6850cdefd3c11badbd725a3f6 | refs/heads/main | 2022-07-02T10:32:11.651957 | 2022-02-01T12:41:38 | 2022-02-01T12:41:38 | 453,860,108 | 36 | 9 | null | 2022-01-31T09:46:26 | 2022-01-31T02:43:22 | Java | UTF-8 | Java | false | false | 5,891 | java | package com.tencent.mm.autogen.b;
import android.content.ContentValues;
import android.database.Cursor;
import com.tencent.mm.sdk.storage.IAutoDBItem;
import com.tencent.mm.sdk.storage.IAutoDBItem.MAutoDBInfo;
import com.tencent.mm.sdk.storage.observer.StorageObserverOwner;
import com.tencent.mm.sdk.storage.sql.Column;
import com.tencent.mm.sdk.storage.sql.SingleTable;
import java.lang.reflect.Field;
import java.util.Map;
public abstract class gf
extends IAutoDBItem
{
public static final IAutoDBItem.MAutoDBInfo DB_INFO = aJm();
public static final String[] INDEX_CREATE;
public static final Column ROWID;
public static final SingleTable TABLE = new SingleTable("PersistentWxaSyncInvalidContactCmd");
public static final Column USERNAME;
public static final Column jMP;
private static final int jMZ;
public static final Column kkd;
private static final int kkx;
private static final StorageObserverOwner<gf> observerOwner = new StorageObserverOwner();
private static final int rowid_HASHCODE;
private static final int username_HASHCODE;
private boolean __hadSetusername = true;
public int field_reportId;
public long field_timestamp;
public String field_username;
private boolean jMU = true;
private boolean kkn = true;
static
{
ROWID = new Column("rowid", "long", TABLE.getName(), "");
USERNAME = new Column("username", "string", TABLE.getName(), "");
kkd = new Column("timestamp", "long", TABLE.getName(), "");
jMP = new Column("reportId", "int", TABLE.getName(), "");
INDEX_CREATE = new String[0];
username_HASHCODE = "username".hashCode();
kkx = "timestamp".hashCode();
jMZ = "reportId".hashCode();
rowid_HASHCODE = "rowid".hashCode();
}
public static IAutoDBItem.MAutoDBInfo aJm()
{
IAutoDBItem.MAutoDBInfo localMAutoDBInfo = new IAutoDBItem.MAutoDBInfo();
localMAutoDBInfo.fields = new Field[3];
localMAutoDBInfo.columns = new String[4];
StringBuilder localStringBuilder = new StringBuilder();
localMAutoDBInfo.columns[0] = "username";
localMAutoDBInfo.colsMap.put("username", "TEXT PRIMARY KEY ");
localStringBuilder.append(" username TEXT PRIMARY KEY ");
localStringBuilder.append(", ");
localMAutoDBInfo.primaryKey = "username";
localMAutoDBInfo.columns[1] = "timestamp";
localMAutoDBInfo.colsMap.put("timestamp", "LONG");
localStringBuilder.append(" timestamp LONG");
localStringBuilder.append(", ");
localMAutoDBInfo.columns[2] = "reportId";
localMAutoDBInfo.colsMap.put("reportId", "INTEGER");
localStringBuilder.append(" reportId INTEGER");
localMAutoDBInfo.columns[3] = "rowid";
localMAutoDBInfo.sql = localStringBuilder.toString();
if (localMAutoDBInfo.primaryKey == null) {
localMAutoDBInfo.primaryKey = "rowid";
}
return localMAutoDBInfo;
}
public void convertFrom(ContentValues paramContentValues, boolean paramBoolean)
{
if (paramContentValues.containsKey("username"))
{
this.field_username = paramContentValues.getAsString("username");
if (paramBoolean) {
this.__hadSetusername = true;
}
}
if (paramContentValues.containsKey("timestamp"))
{
this.field_timestamp = paramContentValues.getAsLong("timestamp").longValue();
if (paramBoolean) {
this.kkn = true;
}
}
if (paramContentValues.containsKey("reportId"))
{
this.field_reportId = paramContentValues.getAsInteger("reportId").intValue();
if (paramBoolean) {
this.jMU = true;
}
}
if (paramContentValues.containsKey("rowid")) {
this.systemRowid = paramContentValues.getAsLong("rowid").longValue();
}
}
public void convertFrom(Cursor paramCursor)
{
String[] arrayOfString = paramCursor.getColumnNames();
if (arrayOfString == null) {
return;
}
int i = 0;
int j = arrayOfString.length;
label20:
int k;
if (i < j)
{
k = arrayOfString[i].hashCode();
if (username_HASHCODE != k) {
break label65;
}
this.field_username = paramCursor.getString(i);
this.__hadSetusername = true;
}
for (;;)
{
i += 1;
break label20;
break;
label65:
if (kkx == k) {
this.field_timestamp = paramCursor.getLong(i);
} else if (jMZ == k) {
this.field_reportId = paramCursor.getInt(i);
} else if (rowid_HASHCODE == k) {
this.systemRowid = paramCursor.getLong(i);
}
}
}
public ContentValues convertTo()
{
ContentValues localContentValues = new ContentValues();
if (this.__hadSetusername) {
localContentValues.put("username", this.field_username);
}
if (this.kkn) {
localContentValues.put("timestamp", Long.valueOf(this.field_timestamp));
}
if (this.jMU) {
localContentValues.put("reportId", Integer.valueOf(this.field_reportId));
}
if (this.systemRowid > 0L) {
localContentValues.put("rowid", Long.valueOf(this.systemRowid));
}
return localContentValues;
}
public IAutoDBItem.MAutoDBInfo getDBInfo()
{
return DB_INFO;
}
public String[] getIndexCreateSQL()
{
return INDEX_CREATE;
}
public StorageObserverOwner<? extends gf> getObserverOwner()
{
return observerOwner;
}
public Object getPrimaryKeyValue()
{
return this.field_username;
}
public SingleTable getTable()
{
return TABLE;
}
public String getTableName()
{
return TABLE.getName();
}
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes4.jar
* Qualified Name: com.tencent.mm.autogen.b.gf
* JD-Core Version: 0.7.0.1
*/ | [
"98632993+tsuzcx@users.noreply.github.com"
] | 98632993+tsuzcx@users.noreply.github.com |
4ebfb91ade9911fb6b77d82c4998e61c324ac369 | a5cc2986f55fcf96e50174b7bb455a0a1a28c7b4 | /src/main/java/jim/katunguka/crib/exception/NoSuchResourceException.java | 61ccb4838e35d68036425df6351e7939ea4ade45 | [] | no_license | jimkatunguka/myCrib | e0c93e63db18f3faaab562982dba790282951e6b | 2a34154456050c8eb8bc1dbf21c43a7f43794f87 | refs/heads/master | 2022-11-20T05:22:42.788490 | 2020-07-14T06:09:07 | 2020-07-14T06:09:07 | 279,467,169 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 543 | java | package jim.katunguka.crib.exception;
public class NoSuchResourceException extends RuntimeException {
private static final long serialVersionUID = 1L;
private long resourceId;
private String resourceType;
public NoSuchResourceException(String resourceType, long resourceId) {
super();
this.resourceType = resourceType;
this.resourceId = resourceId;
}
public long getResourceId() {
return resourceId;
}
public String getResourceType() {
return resourceType;
}
}
| [
"jimkatunguka@gmail.com"
] | jimkatunguka@gmail.com |
fcafdd9ff1842eb94be3d87f17e01b464a22a466 | 4ac940a00d7d626a6bf6385d31fe3bcf9bb274e7 | /src/main/java/com/prueba/roulette/data/RouletteDATA.java | 42061b089b9e63b33fb1343a4fcb337c29263c9e | [] | no_license | jpzuluaga9/Roulette-masivian | c230764d9a61590f40029923c29c85e17c605c1f | 3bd595c5d7cf50214187b92cf040a39cd2ecf043 | refs/heads/master | 2022-12-07T06:40:26.728892 | 2020-08-17T17:27:44 | 2020-08-17T17:27:44 | 288,204,970 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 709 | java | package com.prueba.roulette.data;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
public class RouletteDATA {
@JsonProperty("apuestas")
private List<BetDATA> bets;
@JsonProperty("resultado")
private String result;
public RouletteDATA() {
super();
// TODO Auto-generated constructor stub
}
public RouletteDATA(String resultado, List<BetDATA> apuestas) {
super();
this.result = resultado;
this.bets = apuestas;
}
public String getResult() {
return result;
}
public void setResult(String result) {
this.result = result;
}
public List<BetDATA> getBets() {
return bets;
}
public void setBets(List<BetDATA> bets) {
this.bets = bets;
}
}
| [
"you@example.com"
] | you@example.com |
12bfd505675ceb6618c97cd8839bd937a4c1e860 | 3ab35f8af2058e822e060172c1213567a48f1fa4 | /asis_sharel_files/shareL/sources/okhttp3/internal/http/RealInterceptorChain.java | e8d4b505a110463fb9187894baa1011528a68ea2 | [] | no_license | Voorivex/ctf | 9aaf4e799e0ae47bb7959ffd830bd82f4a7e7b78 | a0adad53cbdec169c72cf08c86fa481cd00918b6 | refs/heads/master | 2021-06-06T03:46:43.844696 | 2019-11-17T16:25:25 | 2019-11-17T16:25:25 | 222,276,972 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,687 | java | package okhttp3.internal.http;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.TimeUnit;
import okhttp3.Call;
import okhttp3.Connection;
import okhttp3.EventListener;
import okhttp3.Interceptor;
import okhttp3.Interceptor.Chain;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.internal.Util;
import okhttp3.internal.connection.RealConnection;
import okhttp3.internal.connection.StreamAllocation;
public final class RealInterceptorChain implements Chain {
private final Call call;
private int calls;
private final int connectTimeout;
private final RealConnection connection;
private final EventListener eventListener;
private final HttpCodec httpCodec;
private final int index;
private final List<Interceptor> interceptors;
private final int readTimeout;
private final Request request;
private final StreamAllocation streamAllocation;
private final int writeTimeout;
public RealInterceptorChain(List<Interceptor> list, StreamAllocation streamAllocation2, HttpCodec httpCodec2, RealConnection realConnection, int i, Request request2, Call call2, EventListener eventListener2, int i2, int i3, int i4) {
this.interceptors = list;
this.connection = realConnection;
this.streamAllocation = streamAllocation2;
this.httpCodec = httpCodec2;
this.index = i;
this.request = request2;
this.call = call2;
this.eventListener = eventListener2;
this.connectTimeout = i2;
this.readTimeout = i3;
this.writeTimeout = i4;
}
public Connection connection() {
return this.connection;
}
public int connectTimeoutMillis() {
return this.connectTimeout;
}
public Chain withConnectTimeout(int i, TimeUnit timeUnit) {
RealInterceptorChain realInterceptorChain = new RealInterceptorChain(this.interceptors, this.streamAllocation, this.httpCodec, this.connection, this.index, this.request, this.call, this.eventListener, Util.checkDuration("timeout", (long) i, timeUnit), this.readTimeout, this.writeTimeout);
return realInterceptorChain;
}
public int readTimeoutMillis() {
return this.readTimeout;
}
public Chain withReadTimeout(int i, TimeUnit timeUnit) {
RealInterceptorChain realInterceptorChain = new RealInterceptorChain(this.interceptors, this.streamAllocation, this.httpCodec, this.connection, this.index, this.request, this.call, this.eventListener, this.connectTimeout, Util.checkDuration("timeout", (long) i, timeUnit), this.writeTimeout);
return realInterceptorChain;
}
public int writeTimeoutMillis() {
return this.writeTimeout;
}
public Chain withWriteTimeout(int i, TimeUnit timeUnit) {
RealInterceptorChain realInterceptorChain = new RealInterceptorChain(this.interceptors, this.streamAllocation, this.httpCodec, this.connection, this.index, this.request, this.call, this.eventListener, this.connectTimeout, this.readTimeout, Util.checkDuration("timeout", (long) i, timeUnit));
return realInterceptorChain;
}
public StreamAllocation streamAllocation() {
return this.streamAllocation;
}
public HttpCodec httpStream() {
return this.httpCodec;
}
public Call call() {
return this.call;
}
public EventListener eventListener() {
return this.eventListener;
}
public Request request() {
return this.request;
}
public Response proceed(Request request2) throws IOException {
return proceed(request2, this.streamAllocation, this.httpCodec, this.connection);
}
public Response proceed(Request request2, StreamAllocation streamAllocation2, HttpCodec httpCodec2, RealConnection realConnection) throws IOException {
if (this.index < this.interceptors.size()) {
this.calls++;
String str = "network interceptor ";
if (this.httpCodec == null || this.connection.supportsUrl(request2.url())) {
String str2 = " must call proceed() exactly once";
if (this.httpCodec == null || this.calls <= 1) {
RealInterceptorChain realInterceptorChain = new RealInterceptorChain(this.interceptors, streamAllocation2, httpCodec2, realConnection, this.index + 1, request2, this.call, this.eventListener, this.connectTimeout, this.readTimeout, this.writeTimeout);
Interceptor interceptor = (Interceptor) this.interceptors.get(this.index);
Response intercept = interceptor.intercept(realInterceptorChain);
if (httpCodec2 == null || this.index + 1 >= this.interceptors.size() || realInterceptorChain.calls == 1) {
String str3 = "interceptor ";
if (intercept == null) {
StringBuilder sb = new StringBuilder();
sb.append(str3);
sb.append(interceptor);
sb.append(" returned null");
throw new NullPointerException(sb.toString());
} else if (intercept.body() != null) {
return intercept;
} else {
StringBuilder sb2 = new StringBuilder();
sb2.append(str3);
sb2.append(interceptor);
sb2.append(" returned a response with no body");
throw new IllegalStateException(sb2.toString());
}
} else {
StringBuilder sb3 = new StringBuilder();
sb3.append(str);
sb3.append(interceptor);
sb3.append(str2);
throw new IllegalStateException(sb3.toString());
}
} else {
StringBuilder sb4 = new StringBuilder();
sb4.append(str);
sb4.append(this.interceptors.get(this.index - 1));
sb4.append(str2);
throw new IllegalStateException(sb4.toString());
}
} else {
StringBuilder sb5 = new StringBuilder();
sb5.append(str);
sb5.append(this.interceptors.get(this.index - 1));
sb5.append(" must retain the same host and port");
throw new IllegalStateException(sb5.toString());
}
} else {
throw new AssertionError();
}
}
}
| [
"voorivex@tutanota.com"
] | voorivex@tutanota.com |
36254ee7aebd78b34c00bcb120b1fd151bb3230b | f379a93728c71b2384c78afbe7604853de34b8fd | /app/src/main/java/com/app/mobile/royal/DriverBatchesGet/AssignedTo.java | c2c394194bb5a96e01523ebd77c8a2cbd5ad0390 | [] | no_license | priyankagiri14/royal_mobile | 20fe91c893ac342148f7b73f8a86a4b787302ac1 | 1d8887c3c19feee68db737b73971ace8b683d0bc | refs/heads/master | 2020-09-25T14:17:23.660783 | 2020-02-18T11:46:25 | 2020-02-18T11:46:25 | 226,021,648 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 771 | java | package com.app.mobile.royal.DriverBatchesGet;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class AssignedTo {
@SerializedName("id")
@Expose
private Integer id;
@SerializedName("name")
@Expose
private String name;
@SerializedName("enabled")
@Expose
private Boolean enabled;
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;
}
public Boolean getEnabled() {
return enabled;
}
public void setEnabled(Boolean enabled) {
this.enabled = enabled;
}
}
| [
"priyanka@ontrackis.com"
] | priyanka@ontrackis.com |
2b5bf9d5abfd7c48289ce9872293b7755909e804 | 647ce242e20bc792b334cf445d1fb3243f0f3b47 | /chintai-migration-cms/src/net/chintai/backend/sysadmin/dataoutput/action/ShopSkipSettingUploadAction.java | f5b4dd47945eb9dcd153e7ac1e7b97f6fc373ba1 | [] | no_license | sangjiexun/20191031test | 0ce6c9e3dabb7eed465d4add33a107e5b5525236 | 3248d86ce282c1455f2e6ce0e05f0dbd15e51518 | refs/heads/master | 2020-12-14T20:31:05.085987 | 2019-11-01T06:03:50 | 2019-11-01T06:03:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,500 | java | package net.chintai.backend.sysadmin.dataoutput.action;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import net.chintai.backend.sysadmin.common.AuthorityId;
import net.chintai.backend.sysadmin.common.BaseActionSupport;
import net.chintai.backend.sysadmin.common.BusinessContext;
import net.chintai.backend.sysadmin.common.exception.ApplicationException;
import net.chintai.backend.sysadmin.common.properties.ApplicationResources;
import net.chintai.backend.sysadmin.common.service.AuthService;
import net.chintai.backend.sysadmin.common.util.BeanUtilsWrapper;
import net.chintai.backend.sysadmin.common.util.CsvException;
import net.chintai.backend.sysadmin.common.util.CsvStatusBean;
import net.chintai.backend.sysadmin.common.util.UploadUtil;
import net.chintai.backend.sysadmin.dataoutput.action.view.ShopSkipSettingView;
import net.chintai.backend.sysadmin.dataoutput.service.ShopSkipSettingService;
import net.chintai.backend.sysadmin.dataoutput.service.bean.ShopSkipSettingUploadInServiceBean;
import net.chintai.backend.sysadmin.logging.SessionStatus;
import net.chintai.backend.sysadmin.logging.service.OperationLoggingService;
import net.chintai.backend.sysadmin.shop_bukken.action.ShopUploadAction;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts.action.DynaActionForm;
import org.apache.struts.upload.FormFile;
import org.springframework.context.ApplicationContext;
/**
* 店舗別除外設定アップロードAction
* @author watanabe
* Copyright: (C) CHINTAI Corporation All Right Reserved.
*/
public class ShopSkipSettingUploadAction extends BaseActionSupport{
/** ログインスタンス */
private static Log log = LogFactory.getLog(ShopUploadAction.class);
/* (非 Javadoc)
* @see net.chintai.backend.sysadmin.common.BaseActionSupport#doExecute(net.chintai.backend.sysadmin.common.BusinessContext)
*/
@Override
protected void doExecute(BusinessContext context) throws Exception {
// 画面のデータ取得
ShopSkipSettingUploadInServiceBean inServiceBean = new ShopSkipSettingUploadInServiceBean();
DynaActionForm form = (DynaActionForm) context.getForm();
BeanUtilsWrapper.copyProperties(inServiceBean, form);
FormFile formFile = (FormFile) form.get("uploadFile");
String acceptFlg = (String) form.get("acceptFlg");
ShopSkipSettingView view = new ShopSkipSettingView();
BeanUtilsWrapper.copyProperties(view, form);
// Injection
ApplicationContext ac = getWebApplicationContext();
OperationLoggingService loggingService = (OperationLoggingService) ac.getBean("operationLoggingService");
String userId = context.getSessionBean().getUserId();
int fileSize = formFile.getFileSize();
int fileMaxSize = Integer.parseInt(ApplicationResources.getProperty("dataoutput.fileMaxSize"));
// CSVファイルチェック
// 対象の連携先のデータ全件削除を承諾済みの場合は飛ばす
List<String[]> uplist = new ArrayList<String[]>();
if (!acceptFlg.equals("1")) {
if (fileSize == 0) {
loggingService.write("19006", userId, SessionStatus.FAILURE, "", this.getClass().getName());
context.setError("WARN.M.DATAOUTPUT.0012", ApplicationResources.getProperty("dataoutput.CSV"), ApplicationResources
.getProperty("dataoutput.CSV"));
context.setForward("failure", view);
return;
}
if (fileSize > fileMaxSize) {
loggingService.write("19006", userId, SessionStatus.FAILURE, "", this.getClass().getName());
context.setError("ERROR.M.DATAOUTPUT.0004", ApplicationResources.getProperty("dataoutput.uploadFileSize"));
context.setForward("failure", view);
return;
}
if (!ApplicationResources.getProperty("dataoutput.uploadFileExtensions")
.equals(formFile.getFileName().replaceAll("^.*?([^\\.]+$)", "$1").toUpperCase())){
loggingService.write("19006", userId, SessionStatus.FAILURE, "", this.getClass().getName());
context.setError("WARN.M.DATAOUTPUT.0013", ApplicationResources.getProperty("dataoutput.upload"),
ApplicationResources.getProperty("dataoutput.uploadFileExtensions"), ApplicationResources
.getProperty("dataoutput.file"));
context.setForward("failure", view);
return;
}
try {
InputStream in = formFile.getInputStream();
CsvStatusBean csvStatusBean = new CsvStatusBean();
csvStatusBean.setFileName(formFile.getFileName());
csvStatusBean.setIgnoreStartLine(true);
uplist = UploadUtil.uploadCsv(in, csvStatusBean);
} catch (CsvException ce) {
loggingService.write("19006", userId, SessionStatus.FAILURE, "", this.getClass().getName());
String errorId = "ERROR.MSG.0004";
log.error(errorId, ce);
context.setError(errorId);
context.setForward("failure", view);
return;
} catch (IOException e) {
loggingService.write("19006", userId, SessionStatus.FAILURE, "", this.getClass().getName());
String errorId = "ERROR.MSG.0004";
log.error(errorId, e);
context.setError(errorId);
context.setForward("failure", view);
return;
}
if (uplist.size() == 0) {
context.getRequest().setAttribute("acceptFlg", "0");;
context.setForward("success", view);
return;
}
}
//サービス取得
inServiceBean.setUploadList(uplist);
inServiceBean.setUserId(userId);
inServiceBean.setPgName(this.getClass().getName());
ShopSkipSettingService shopSkipSettingService =
(ShopSkipSettingService) ac.getBean("shopSkipSettingService");
try {
shopSkipSettingService.commitShopSkipSetting(inServiceBean);
// 成功:操作ログ記録
loggingService.write("19006", userId, SessionStatus.SUCCESS, "", this.getClass().getName());
context.setMessage("INFO.M.DATAOUTPUT.0002", ApplicationResources.getProperty("dataoutput.maintenance"));
context.setForward("success");
} catch (ApplicationException e) {
loggingService.write("19006", userId, SessionStatus.FAILURE, "", this.getClass().getName());
log.error(e.getErrorId(), e);
context.setError(e.getErrorId(), e.getPlaceHolders());
context.setForward("failure", view);
}
}
/* (非 Javadoc)
* @see net.chintai.backend.sysadmin.common.BaseActionSupport#isAuthorized(java.lang.String)
*/
@Override
protected boolean isAuthorized(String userId) {
ApplicationContext ac = getWebApplicationContext();
AuthService auth = (AuthService) ac.getBean("authService");
return auth.authenticate(userId, AuthorityId.DATA_OUTPUT);
}
}
| [
"yuki.hirukawa@ctc-g.co.jp"
] | yuki.hirukawa@ctc-g.co.jp |
4f96b52073e4073afde91c15fdff2acdaa71c1fc | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /large-multiproject/project95/src/main/java/org/gradle/test/performance95_3/Production95_270.java | 1de6e3e01f370a392afb1f561d2e1d0158d15fc8 | [] | 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 | 305 | java | package org.gradle.test.performance95_3;
public class Production95_270 extends org.gradle.test.performance17_3.Production17_270 {
private final String property;
public Production95_270() {
this.property = "foo";
}
public String getProperty() {
return property;
}
}
| [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
7a7b3b2cfbf8eecf6f398ce7a6fe6302e3eaa804 | 576c580c3afe1dcc86755defcc9759fca5b586c9 | /ScienceCenter/src/main/java/com/jovo/ScienceCenter/elasticsearch_plugin/serbian_analyzer/SerbianAnalyzerProvider.java | e86dd6ce664d6869f2ef1827d8e42aea54ac9679 | [] | no_license | jovosunjka/ScienceCenter | 8e8163931b23f17917a2b3ef98e32b1bb2e227ef | adfc446a6538f8d77846761647b247e7340ae524 | refs/heads/master | 2023-02-03T08:27:18.533610 | 2020-07-06T18:21:36 | 2020-07-06T18:21:36 | 221,579,482 | 0 | 0 | null | 2023-01-01T15:29:08 | 2019-11-14T00:45:25 | Java | UTF-8 | Java | false | false | 844 | java | package com.jovo.ScienceCenter.elasticsearch_plugin.serbian_analyzer;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.env.Environment;
import org.elasticsearch.index.IndexSettings;
import org.elasticsearch.index.analysis.AbstractIndexAnalyzerProvider;
/**
*
* @author Milan Deket
* @author Marko Martonosi (update to es7.4)
*/
public class SerbianAnalyzerProvider extends AbstractIndexAnalyzerProvider<SerbianAnalyzer> {
private final SerbianAnalyzer analyzer;
public SerbianAnalyzerProvider(IndexSettings indexSettings, Environment environment, String name, Settings settings) {
super(indexSettings, name, settings);
analyzer = new SerbianAnalyzer();
analyzer.setVersion(version);
}
@Override
public SerbianAnalyzer get() {
return this.analyzer;
}
}
| [
"sunjkajovo@gmail.com"
] | sunjkajovo@gmail.com |
612e7ffc7752b341a24859827dab746e356bd0b9 | e495209ff58fdb7b13353a4b63c346f01c11e1f1 | /canal_client/src/main/java/com/liuscoding/canal/CanalApplication.java | e4e632dcf54573f28802aee668b747aad528a92c | [] | no_license | DavidCalls/guli-online-college-project | 113495f6d77c43f2192dea3f71bd4ffc9c490998 | 20ea48d1792ea4848c0ca58ae44bdc9127d6acea | refs/heads/master | 2022-09-04T09:07:23.452684 | 2020-05-20T07:44:32 | 2020-05-20T07:44:32 | 265,493,220 | 1 | 0 | null | 2020-05-20T07:59:15 | 2020-05-20T07:59:15 | null | UTF-8 | Java | false | false | 802 | java | package com.liuscoding.canal;
import com.liuscoding.canal.client.CanalClient;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import javax.annotation.Resource;
/**
* @className: CanalApplication
* @description:
* @author: liusCoding
* @create: 2020-05-19 22:49
*/
@SpringBootApplication
public class CanalApplication implements CommandLineRunner {
@Resource
private CanalClient canalClient;
public static void main(String[] args) {
SpringApplication.run(CanalApplication.class,args);
}
@Override
public void run(String... args) throws Exception {
//项目启动,执行canal客户端监听
canalClient.run();
}
}
| [
"14786469221@163.com"
] | 14786469221@163.com |
14f5efdfcf2c276b160e330591a9c4bdd4ca4f7f | c885ef92397be9d54b87741f01557f61d3f794f3 | /results/JacksonCore-24/com.fasterxml.jackson.core.base.ParserMinimalBase/BBC-F0-opt-60/tests/18/com/fasterxml/jackson/core/base/ParserMinimalBase_ESTest_scaffolding.java | c5de7a14858287f42a46247307dd2a80c421e4fe | [
"CC-BY-4.0",
"MIT"
] | permissive | pderakhshanfar/EMSE-BBC-experiment | f60ac5f7664dd9a85f755a00a57ec12c7551e8c6 | fea1a92c2e7ba7080b8529e2052259c9b697bbda | refs/heads/main | 2022-11-25T00:39:58.983828 | 2022-04-12T16:04:26 | 2022-04-12T16:04:26 | 309,335,889 | 0 | 1 | null | 2021-11-05T11:18:43 | 2020-11-02T10:30:38 | null | UTF-8 | Java | false | false | 8,124 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Thu Oct 21 05:04:18 GMT 2021
*/
package com.fasterxml.jackson.core.base;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
import org.evosuite.runtime.sandbox.Sandbox;
import org.evosuite.runtime.sandbox.Sandbox.SandboxMode;
import static org.evosuite.shaded.org.mockito.Mockito.*;
@EvoSuiteClassExclude
public class ParserMinimalBase_ESTest_scaffolding {
@org.junit.Rule
public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
@BeforeClass
public static void initEvoSuiteFramework() {
org.evosuite.runtime.RuntimeSettings.className = "com.fasterxml.jackson.core.base.ParserMinimalBase";
org.evosuite.runtime.GuiSupport.initialize();
org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100;
org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000;
org.evosuite.runtime.RuntimeSettings.mockSystemIn = true;
org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED;
org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT();
org.evosuite.runtime.classhandling.JDKClassResetter.init();
setSystemProperties();
initializeClasses();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
try { initMocksToAvoidTimeoutsInTheTests(); } catch(ClassNotFoundException e) {}
}
@Before
public void initTestCase(){
threadStopper.storeCurrentThreads();
threadStopper.startRecordingTime();
org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler();
org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode();
org.evosuite.runtime.GuiSupport.setHeadless();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
org.evosuite.runtime.agent.InstrumentingAgent.activate();
}
@After
public void doneWithTestCase(){
threadStopper.killAndJoinClientThreads();
org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks();
org.evosuite.runtime.classhandling.JDKClassResetter.reset();
resetClasses();
org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode();
org.evosuite.runtime.agent.InstrumentingAgent.deactivate();
org.evosuite.runtime.GuiSupport.restoreHeadlessMode();
}
public static void setSystemProperties() {
/*No java.lang.System property to set*/
}
private static void initializeClasses() {
org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(ParserMinimalBase_ESTest_scaffolding.class.getClassLoader() ,
"com.fasterxml.jackson.core.io.JsonEOFException",
"com.fasterxml.jackson.core.JsonParser$NumberType",
"com.fasterxml.jackson.core.json.ReaderBasedJsonParser",
"com.fasterxml.jackson.core.JsonLocation",
"com.fasterxml.jackson.core.sym.ByteQuadsCanonicalizer",
"com.fasterxml.jackson.core.io.CharTypes",
"com.fasterxml.jackson.core.sym.CharsToNameCanonicalizer",
"com.fasterxml.jackson.core.JsonGenerator",
"com.fasterxml.jackson.core.SerializableString",
"com.fasterxml.jackson.core.Versioned",
"com.fasterxml.jackson.core.ObjectCodec",
"com.fasterxml.jackson.core.json.JsonReadContext",
"com.fasterxml.jackson.core.type.ResolvedType",
"com.fasterxml.jackson.core.exc.InputCoercionException",
"com.fasterxml.jackson.core.JsonParser$Feature",
"com.fasterxml.jackson.core.JsonPointer",
"com.fasterxml.jackson.core.JsonEncoding",
"com.fasterxml.jackson.core.util.RequestPayload",
"com.fasterxml.jackson.core.sym.ByteQuadsCanonicalizer$TableInfo",
"com.fasterxml.jackson.core.json.DupDetector",
"com.fasterxml.jackson.core.JsonToken",
"com.fasterxml.jackson.core.type.TypeReference",
"com.fasterxml.jackson.core.JsonParseException",
"com.fasterxml.jackson.core.util.BufferRecycler",
"com.fasterxml.jackson.core.TreeNode",
"com.fasterxml.jackson.core.TreeCodec",
"com.fasterxml.jackson.core.JsonParser",
"com.fasterxml.jackson.core.Version",
"com.fasterxml.jackson.core.JsonProcessingException",
"com.fasterxml.jackson.core.exc.StreamReadException",
"com.fasterxml.jackson.core.JsonStreamContext",
"com.fasterxml.jackson.core.util.TextBuffer",
"com.fasterxml.jackson.core.sym.CharsToNameCanonicalizer$Bucket",
"com.fasterxml.jackson.core.Base64Variant",
"com.fasterxml.jackson.core.JsonFactory",
"com.fasterxml.jackson.core.base.ParserMinimalBase",
"com.fasterxml.jackson.core.io.NumberInput",
"com.fasterxml.jackson.core.util.ByteArrayBuilder",
"com.fasterxml.jackson.core.json.UTF8StreamJsonParser",
"com.fasterxml.jackson.core.io.IOContext",
"com.fasterxml.jackson.core.FormatSchema",
"com.fasterxml.jackson.core.sym.CharsToNameCanonicalizer$TableInfo",
"com.fasterxml.jackson.core.base.ParserBase",
"com.fasterxml.jackson.core.async.NonBlockingInputFeeder",
"com.fasterxml.jackson.core.TokenStreamFactory",
"com.fasterxml.jackson.core.json.UTF8DataInputJsonParser"
);
}
private static void initMocksToAvoidTimeoutsInTheTests() throws ClassNotFoundException {
mock(Class.forName("com.fasterxml.jackson.core.ObjectCodec", false, ParserMinimalBase_ESTest_scaffolding.class.getClassLoader()));
}
private static void resetClasses() {
org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(ParserMinimalBase_ESTest_scaffolding.class.getClassLoader());
org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
"com.fasterxml.jackson.core.JsonParser",
"com.fasterxml.jackson.core.base.ParserMinimalBase",
"com.fasterxml.jackson.core.JsonToken",
"com.fasterxml.jackson.core.util.BufferRecycler",
"com.fasterxml.jackson.core.io.IOContext",
"com.fasterxml.jackson.core.TreeCodec",
"com.fasterxml.jackson.core.ObjectCodec",
"com.fasterxml.jackson.core.sym.CharsToNameCanonicalizer",
"com.fasterxml.jackson.core.sym.CharsToNameCanonicalizer$TableInfo",
"com.fasterxml.jackson.core.JsonFactory$Feature",
"com.fasterxml.jackson.core.base.ParserBase",
"com.fasterxml.jackson.core.io.CharTypes",
"com.fasterxml.jackson.core.json.ReaderBasedJsonParser",
"com.fasterxml.jackson.core.util.TextBuffer",
"com.fasterxml.jackson.core.JsonStreamContext",
"com.fasterxml.jackson.core.json.JsonReadContext",
"com.fasterxml.jackson.core.sym.ByteQuadsCanonicalizer",
"com.fasterxml.jackson.core.sym.ByteQuadsCanonicalizer$TableInfo",
"com.fasterxml.jackson.core.json.UTF8StreamJsonParser",
"com.fasterxml.jackson.core.json.UTF8DataInputJsonParser",
"com.fasterxml.jackson.core.JsonProcessingException",
"com.fasterxml.jackson.core.exc.StreamReadException",
"com.fasterxml.jackson.core.JsonParseException",
"com.fasterxml.jackson.core.JsonLocation",
"com.fasterxml.jackson.core.json.DupDetector",
"com.fasterxml.jackson.core.Base64Variant",
"com.fasterxml.jackson.core.util.InternCache",
"com.fasterxml.jackson.core.type.TypeReference",
"com.fasterxml.jackson.core.io.SerializedString",
"com.fasterxml.jackson.core.util.RequestPayload",
"com.fasterxml.jackson.core.Base64Variants",
"com.fasterxml.jackson.core.util.ByteArrayBuilder",
"com.fasterxml.jackson.core.io.JsonEOFException",
"com.fasterxml.jackson.core.util.BufferRecyclers",
"com.fasterxml.jackson.core.io.JsonStringEncoder",
"com.fasterxml.jackson.core.io.NumberInput",
"com.fasterxml.jackson.core.JsonParser$Feature"
);
}
}
| [
"pderakhshanfar@serg2.ewi.tudelft.nl"
] | pderakhshanfar@serg2.ewi.tudelft.nl |
e7e6a5da4d87b0467eeaf4ea347a6be066c1fbe8 | c426f7b90138151ffeb50a0d2c0d631abeb466b6 | /inception/inception-imls-elg/src/main/java/de/tudarmstadt/ukp/inception/recommendation/imls/elg/model/ElgTextsResponse.java | 2935e27cdcc3b52d1dff85582bb141e783354527 | [
"Apache-2.0"
] | permissive | inception-project/inception | 7a06b8cd1f8e6a7eb44ee69e842590cf2989df5f | ec95327e195ca461dd90c2761237f92a879a1e61 | refs/heads/main | 2023-09-02T07:52:53.578849 | 2023-09-02T07:44:11 | 2023-09-02T07:44:11 | 127,004,420 | 511 | 141 | Apache-2.0 | 2023-09-13T19:09:49 | 2018-03-27T15:04:00 | Java | UTF-8 | Java | false | false | 1,142 | java | /*
* Licensed to the Technische Universität Darmstadt under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The Technische Universität Darmstadt
* 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.
*
* 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 de.tudarmstadt.ukp.inception.recommendation.imls.elg.model;
import java.util.List;
public class ElgTextsResponse
extends ElgServiceResponse
{
private List<ElgText> texts;
public List<ElgText> getTexts()
{
return texts;
}
public void setTexts(List<ElgText> aTexts)
{
texts = aTexts;
}
}
| [
"richard.eckart@gmail.com"
] | richard.eckart@gmail.com |
a96a4cb3b4c493c50e142001c9b17a63924072ed | fec4c1754adce762b5c4b1cba85ad057e0e4744a | /jf-base/src/main/java/com/jf/entity/MemberLottery.java | 01b5927ac006c082a890327fabb52dc7285a7731 | [] | no_license | sengeiou/workspace_xg | 140b923bd301ff72ca4ae41bc83820123b2a822e | 540a44d550bb33da9980d491d5c3fd0a26e3107d | refs/heads/master | 2022-11-30T05:28:35.447286 | 2020-08-19T02:30:25 | 2020-08-19T02:30:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,185 | java | package com.jf.entity;
import java.math.BigDecimal;
import java.util.Date;
public class MemberLottery {
private Integer id;
private Integer memberId;
private Integer consumeIntegral;
private String type;
private Integer relevantId;
private Integer integral;
private Integer couponId;
private BigDecimal couponAmount;
private String brand;
private Integer productId;
private String productName;
private String productArtNo;
private String productPic;
private String productCode;
private Integer createBy;
private Date createDate;
private Integer updateBy;
private Date updateDate;
private String remarks;
private String delFlag;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getMemberId() {
return memberId;
}
public void setMemberId(Integer memberId) {
this.memberId = memberId;
}
public Integer getConsumeIntegral() {
return consumeIntegral;
}
public void setConsumeIntegral(Integer consumeIntegral) {
this.consumeIntegral = consumeIntegral;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type == null ? null : type.trim();
}
public Integer getRelevantId() {
return relevantId;
}
public void setRelevantId(Integer relevantId) {
this.relevantId = relevantId;
}
public Integer getIntegral() {
return integral;
}
public void setIntegral(Integer integral) {
this.integral = integral;
}
public Integer getCouponId() {
return couponId;
}
public void setCouponId(Integer couponId) {
this.couponId = couponId;
}
public BigDecimal getCouponAmount() {
return couponAmount;
}
public void setCouponAmount(BigDecimal couponAmount) {
this.couponAmount = couponAmount;
}
public String getBrand() {
return brand;
}
public void setBrand(String brand) {
this.brand = brand == null ? null : brand.trim();
}
public Integer getProductId() {
return productId;
}
public void setProductId(Integer productId) {
this.productId = productId;
}
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName == null ? null : productName.trim();
}
public String getProductArtNo() {
return productArtNo;
}
public void setProductArtNo(String productArtNo) {
this.productArtNo = productArtNo == null ? null : productArtNo.trim();
}
public String getProductPic() {
return productPic;
}
public void setProductPic(String productPic) {
this.productPic = productPic == null ? null : productPic.trim();
}
public String getProductCode() {
return productCode;
}
public void setProductCode(String productCode) {
this.productCode = productCode == null ? null : productCode.trim();
}
public Integer getCreateBy() {
return createBy;
}
public void setCreateBy(Integer createBy) {
this.createBy = createBy;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public Integer getUpdateBy() {
return updateBy;
}
public void setUpdateBy(Integer updateBy) {
this.updateBy = updateBy;
}
public Date getUpdateDate() {
return updateDate;
}
public void setUpdateDate(Date updateDate) {
this.updateDate = updateDate;
}
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks == null ? null : remarks.trim();
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag == null ? null : delFlag.trim();
}
} | [
"397716215@qq.com"
] | 397716215@qq.com |
4b3e15c6b6093a28855e5059deb93ecc379e5609 | 5499bc00d9365b0b7b60dddc35d93b9908f43668 | /src/test/java/com/isoft/gateway/security/oauth2/CookieCollectionTest.java | 9989744ecb3f69466c786258a2edd03e40c9b439 | [] | no_license | Ibrahim5560/gateway | b6ded6c58dcb1e273368bf038ad9c4604670dcb6 | 06538f16faaff1aed9d34f20dab030ab89d80c44 | refs/heads/master | 2022-12-20T22:29:47.288787 | 2020-03-05T12:20:01 | 2020-03-05T12:20:01 | 245,155,588 | 0 | 0 | null | 2022-12-16T05:13:26 | 2020-03-05T12:19:45 | Java | UTF-8 | Java | false | false | 7,135 | java | package com.isoft.gateway.security.oauth2;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import javax.servlet.http.Cookie;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Test the {@link CookieCollection}.
*/
public class CookieCollectionTest {
public static final String COOKIE_NAME = "chocolate";
public static final String COOKIE_VALUE = "yummy";
public static final String BROWNIE_NAME = "brownie";
private Cookie cookie;
private Cookie cupsCookie;
private Cookie brownieCookie;
@BeforeEach
public void setUp() {
cookie = new Cookie(COOKIE_NAME, COOKIE_VALUE);
cupsCookie = new Cookie("cups", "delicious");
brownieCookie = new Cookie(BROWNIE_NAME, "mmh");
}
@Test
public void size() {
CookieCollection cookies = new CookieCollection();
assertThat(cookies).hasSize(0);
cookies.add(cookie);
assertThat(cookies).hasSize(1);
}
@Test
public void isEmpty() {
CookieCollection cookies = new CookieCollection();
assertThat(cookies).isEmpty();
cookies.add(cookie);
assertThat(cookies).isNotEmpty();
}
@Test
public void contains() {
CookieCollection cookies = new CookieCollection(cookie);
assertThat(cookies.contains(cookie)).isTrue();
assertThat(cookies.contains(COOKIE_NAME)).isTrue();
assertThat(cookies.contains("yuck")).isFalse();
}
@Test
public void iterator() {
CookieCollection cookies = new CookieCollection(cookie);
Iterator<Cookie> it = cookies.iterator();
assertThat(it.hasNext()).isTrue();
assertThat(it.next()).isEqualTo(cookie);
assertThat(it.hasNext()).isFalse();
}
@Test
public void toArray() {
CookieCollection cookies = new CookieCollection(cookie);
Cookie[] array = cookies.toArray();
assertThat(array).hasSameSizeAs(cookies);
assertThat(array[0]).isEqualTo(cookie);
}
@Test
public void toArray1() {
CookieCollection cookies = new CookieCollection(cookie);
Cookie[] array = new Cookie[cookies.size()];
cookies.toArray(array);
assertThat(array).hasSameSizeAs(cookies);
assertThat(array[0]).isEqualTo(cookie);
}
@Test
public void add() {
CookieCollection cookies = new CookieCollection(cookie);
Cookie newCookie = new Cookie(BROWNIE_NAME, "mmh");
cookies.add(newCookie);
assertThat(cookies).hasSize(2);
assertThat(cookies.contains(newCookie)).isTrue();
assertThat(cookies.contains(BROWNIE_NAME)).isTrue();
}
@Test
public void addAgain() {
CookieCollection cookies = new CookieCollection(cookie, brownieCookie, cupsCookie);
Cookie white = new Cookie(COOKIE_NAME, "white");
boolean modified = cookies.add(white);
assertThat(modified).isTrue();
assertThat(cookies.get(COOKIE_NAME)).isEqualTo(white);
assertThat(cookies.contains(white)).isTrue();
assertThat(cookies.contains(cookie)).isFalse();
assertThat(cookies.contains(COOKIE_NAME)).isTrue();
}
@Test
public void get() {
CookieCollection cookies = new CookieCollection(cookie, brownieCookie, cupsCookie);
Cookie c = cookies.get(COOKIE_NAME);
assertThat(c).isNotNull();
assertThat(c).isEqualTo(cookie);
}
@Test
public void remove() {
CookieCollection cookies = new CookieCollection(cookie, brownieCookie, cupsCookie);
cookies.remove(cookie);
assertThat(cookies).hasSize(2);
assertThat(cookies.contains(cookie)).isFalse();
assertThat(cookies.contains(COOKIE_NAME)).isFalse();
assertThat(cookies.contains(brownieCookie)).isTrue();
assertThat(cookies.contains(BROWNIE_NAME)).isTrue();
}
@Test
public void containsAll() {
List<Cookie> content = Arrays.asList(cookie, brownieCookie);
CookieCollection cookies = new CookieCollection(content);
assertThat(cookies.containsAll(content)).isTrue();
assertThat(cookies.containsAll(Collections.singletonList(cookie))).isTrue();
assertThat(cookies.containsAll(Arrays.asList(cookie, brownieCookie, cupsCookie))).isFalse();
assertThat(cookies.containsAll(Arrays.asList(COOKIE_NAME, BROWNIE_NAME))).isTrue();
}
@Test
@SuppressWarnings("unchecked")
public void addAll() {
CookieCollection cookies = new CookieCollection();
List<Cookie> content = Arrays.asList(cookie, brownieCookie, cupsCookie);
boolean modified = cookies.addAll(content);
assertThat(modified).isTrue();
assertThat(cookies).hasSize(3);
assertThat(cookies).containsAll(content);
modified = cookies.addAll(Collections.EMPTY_LIST);
assertThat(modified).isFalse();
}
@Test
public void addAllEmpty() {
CookieCollection cookies = new CookieCollection(cookie, brownieCookie, cupsCookie);
boolean modified = cookies.addAll(Collections.EMPTY_LIST);
assertThat(modified).isFalse();
assertThat(cookies).contains(cookie, brownieCookie, cupsCookie);
}
@Test
public void removeAll() {
CookieCollection cookies = new CookieCollection(cookie, brownieCookie, cupsCookie);
boolean modified = cookies.removeAll(Arrays.asList(brownieCookie, cupsCookie));
assertThat(modified).isTrue();
assertThat(cookies).hasSize(1);
assertThat(cookies).doesNotContain(brownieCookie, cupsCookie);
}
@Test
public void removeAllEmpty() {
CookieCollection cookies = new CookieCollection(cookie, brownieCookie, cupsCookie);
boolean modified = cookies.removeAll(Collections.EMPTY_LIST);
assertThat(modified).isFalse();
assertThat(cookies).contains(cookie, brownieCookie, cupsCookie);
}
@Test
public void removeAllByName() {
CookieCollection cookies = new CookieCollection(cookie, brownieCookie, cupsCookie);
boolean modified = cookies.removeAll(Arrays.asList(COOKIE_NAME, BROWNIE_NAME));
assertThat(modified).isTrue();
assertThat(cookies).hasSize(1);
assertThat(cookies).doesNotContain(brownieCookie, cookie);
}
@Test
public void retainAll() {
CookieCollection cookies = new CookieCollection(cookie, brownieCookie, cupsCookie);
List<Cookie> content = Arrays.asList(cookie, brownieCookie);
boolean modified = cookies.retainAll(content);
assertThat(modified).isTrue();
assertThat(cookies).hasSize(2);
assertThat(cookies).containsAll(content);
assertThat(cookies).doesNotContain(cupsCookie);
modified = cookies.retainAll(content);
assertThat(modified).isFalse();
}
@Test
public void clear() {
CookieCollection cookies = new CookieCollection(cookie);
cookies.clear();
assertThat(cookies).isEmpty();
}
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
af1718f560b1bbc986641c8600beea7084eaeb9d | 09b5fe0fbc2a622b2a315aeca0b2ee32521f52c1 | /jOOQ/src/main/java/org/jooq/util/xml/jaxb/ObjectFactory.java | 78c031a6b4c0ced03a3b38b753c40825c02a83bb | [
"Apache-2.0"
] | permissive | ccjmne/jOOQ | 1544409157b8ea0ebff206e39eb7561bd43b1e97 | 099230d160d1e8e7c2310137c21753fd2d451717 | refs/heads/master | 2020-04-01T03:32:22.404267 | 2018-10-13T02:06:39 | 2018-10-13T02:06:39 | 152,825,859 | 0 | 0 | NOASSERTION | 2018-10-13T02:03:20 | 2018-10-13T02:03:20 | null | UTF-8 | Java | false | false | 2,924 | java |
package org.jooq.util.xml.jaxb;
import javax.xml.bind.annotation.XmlRegistry;
/**
* This object contains factory methods for each
* Java content interface and Java element interface
* generated in the org.jooq.util.xml.jaxb package.
* <p>An ObjectFactory allows you to programatically
* construct new instances of the Java representation
* for XML content. The Java representation of XML
* content can consist of schema derived interfaces
* and classes representing the binding of schema
* type definitions, element declarations and model
* groups. Factory methods for each of these are
* provided in this class.
*
*/
@XmlRegistry
public class ObjectFactory {
/**
* Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.jooq.util.xml.jaxb
*
*/
public ObjectFactory() {
}
/**
* Create an instance of {@link InformationSchema }
*
*/
public InformationSchema createInformationSchema() {
return new InformationSchema();
}
/**
* Create an instance of {@link Catalog }
*
*/
public Catalog createCatalog() {
return new Catalog();
}
/**
* Create an instance of {@link Schema }
*
*/
public Schema createSchema() {
return new Schema();
}
/**
* Create an instance of {@link Sequence }
*
*/
public Sequence createSequence() {
return new Sequence();
}
/**
* Create an instance of {@link Table }
*
*/
public Table createTable() {
return new Table();
}
/**
* Create an instance of {@link Column }
*
*/
public Column createColumn() {
return new Column();
}
/**
* Create an instance of {@link TableConstraint }
*
*/
public TableConstraint createTableConstraint() {
return new TableConstraint();
}
/**
* Create an instance of {@link KeyColumnUsage }
*
*/
public KeyColumnUsage createKeyColumnUsage() {
return new KeyColumnUsage();
}
/**
* Create an instance of {@link ReferentialConstraint }
*
*/
public ReferentialConstraint createReferentialConstraint() {
return new ReferentialConstraint();
}
/**
* Create an instance of {@link Index }
*
*/
public Index createIndex() {
return new Index();
}
/**
* Create an instance of {@link IndexColumnUsage }
*
*/
public IndexColumnUsage createIndexColumnUsage() {
return new IndexColumnUsage();
}
/**
* Create an instance of {@link Routine }
*
*/
public Routine createRoutine() {
return new Routine();
}
/**
* Create an instance of {@link Parameter }
*
*/
public Parameter createParameter() {
return new Parameter();
}
}
| [
"lukas.eder@gmail.com"
] | lukas.eder@gmail.com |
92672886685c187780913c706a0b9a1030a37644 | 44fb1e7fe52a1609115170f50cbd5a1385de88c2 | /GL/lombok/Current/src/core/lombok/core/configuration/FileSystemSourceCache.java | c59c397c3919f22947728c84f26b1a227e7bf8df | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | JLLeitschuh/Corpus | 64d69507ac9a49490fca3d2c1b0cc3592a807120 | 7186ac8dab669b6791cf8b5373f3e4fbbe152838 | refs/heads/master | 2021-01-02T15:28:02.789111 | 2017-06-04T05:35:31 | 2017-06-04T05:35:31 | 239,679,322 | 0 | 0 | null | 2020-02-11T04:54:30 | 2020-02-11T04:54:29 | null | UTF-8 | Java | false | false | 7,954 | java | /*
* Copyright (C) 2014 The Project Lombok Authors.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package lombok.core.configuration;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.net.URI;
import java.util.Collections;
import java.util.Iterator;
import java.util.NoSuchElementException;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.TimeUnit;
import lombok.ConfigurationKeys;
import lombok.core.configuration.ConfigurationSource.Result;
import lombok.core.debug.ProblemReporter;
public class FileSystemSourceCache {
private static String LOMBOK_CONFIG_FILENAME = "lombok.config";
private static final long RECHECK_FILESYSTEM = TimeUnit.SECONDS.toMillis(2);
private static final long NEVER_CHECKED = -1;
private static final long MISSING = -88; // Magic value; any lombok.config with this exact epochmillis last modified will never be read, so, let's ensure nobody accidentally has one with that exact last modified stamp.
private final ConcurrentMap<File, Content> cache = new ConcurrentHashMap<File, Content>();
public Iterable<ConfigurationSource> sourcesForJavaFile(URI javaFile, ConfigurationProblemReporter reporter) {
if (javaFile == null) return Collections.emptyList();
URI uri = javaFile.normalize();
if (!uri.isAbsolute()) uri = URI.create("file:" + uri.toString());
File file;
try {
file = new File(uri);
if (!file.exists()) throw new IllegalArgumentException("File does not exist: " + uri);
return sourcesForDirectory(file.getParentFile(), reporter);
} catch (IllegalArgumentException e) {
// This means that the file as passed is not actually a file at all, and some exotic path system is involved.
// examples: sourcecontrol://jazz stuff, or an actual relative path (uri.isAbsolute() is completely different, that checks presence of schema!),
// or it's eclipse trying to parse a snippet, which has "/Foo.java" as uri.
// At some point it might be worth investigating abstracting away the notion of "I can read lombok.config if present in
// current context, and I can give you may parent context", using ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(javaFile) as basis.
// For now, we just carry on as if there is no lombok.config. (intentional fallthrough)
} catch (Exception e) {
// Especially for eclipse's sake, exceptions here make eclipse borderline unusable, so let's play nice.
ProblemReporter.error("Can't find absolute path of file being compiled: " + javaFile, e);
}
return Collections.emptyList();
}
public Iterable<ConfigurationSource> sourcesForDirectory(URI directory, ConfigurationProblemReporter reporter) {
if (directory == null) return Collections.emptyList();
return sourcesForDirectory(new File(directory.normalize()), reporter);
}
private Iterable<ConfigurationSource> sourcesForDirectory(final File directory, final ConfigurationProblemReporter reporter) {
return new Iterable<ConfigurationSource>() {
@Override
public Iterator<ConfigurationSource> iterator() {
return new Iterator<ConfigurationSource>() {
File currentDirectory = directory;
ConfigurationSource next;
boolean stopBubbling = false;
@Override
public boolean hasNext() {
if (next != null) return true;
if (stopBubbling) return false;
next = findNext();
return next != null;
}
@Override
public ConfigurationSource next() {
if (!hasNext()) throw new NoSuchElementException();
ConfigurationSource result = next;
next = null;
return result;
}
private ConfigurationSource findNext() {
while (currentDirectory != null && next == null) {
next = getSourceForDirectory(currentDirectory, reporter);
currentDirectory = currentDirectory.getParentFile();
}
if (next != null) {
Result stop = next.resolve(ConfigurationKeys.STOP_BUBBLING);
stopBubbling = (stop != null && Boolean.TRUE.equals(stop.getValue()));
}
return next;
}
@Override
public void remove() {
throw new UnsupportedOperationException();
}
};
}
};
}
ConfigurationSource getSourceForDirectory(File directory, ConfigurationProblemReporter reporter) {
if (!directory.exists() || !directory.isDirectory()) throw new IllegalArgumentException("Not a directory: " + directory);
long now = System.currentTimeMillis();
File configFile = new File(directory, LOMBOK_CONFIG_FILENAME);
Content content = ensureContent(directory);
synchronized (content) {
if (content.lastChecked != NEVER_CHECKED && now - content.lastChecked < RECHECK_FILESYSTEM && getLastModifiedOrMissing(configFile) == content.lastModified) {
return content.source;
}
content.lastChecked = now;
long previouslyModified = content.lastModified;
content.lastModified = getLastModifiedOrMissing(configFile);
if (content.lastModified != previouslyModified) content.source = content.lastModified == MISSING ? null : parse(configFile, reporter);
return content.source;
}
}
private Content ensureContent(File directory) {
Content content = cache.get(directory);
if (content != null) {
return content;
}
cache.putIfAbsent(directory, Content.empty());
return cache.get(directory);
}
private ConfigurationSource parse(File configFile, ConfigurationProblemReporter reporter) {
String contentDescription = configFile.getAbsolutePath();
try {
return StringConfigurationSource.forString(fileToString(configFile), reporter, contentDescription);
} catch (Exception e) {
reporter.report(contentDescription, "Exception while reading file: " + e.getMessage(), 0, null);
return null;
}
}
private static final ThreadLocal<byte[]> buffers = new ThreadLocal<byte[]>() {
protected byte[] initialValue() {
return new byte[65536];
}
};
static String fileToString(File configFile) throws Exception {
byte[] b = buffers.get();
FileInputStream fis = new FileInputStream(configFile);
try {
ByteArrayOutputStream out = new ByteArrayOutputStream();
while (true) {
int r = fis.read(b);
if (r == -1) break;
out.write(b, 0, r);
}
return new String(out.toByteArray(), "UTF-8");
} finally {
fis.close();
}
}
private static final long getLastModifiedOrMissing(File file) {
if (!file.exists() || !file.isFile()) return MISSING;
return file.lastModified();
}
private static class Content {
ConfigurationSource source;
long lastModified;
long lastChecked;
private Content(ConfigurationSource source, long lastModified, long lastChecked) {
this.source = source;
this.lastModified = lastModified;
this.lastChecked = lastChecked;
}
static Content empty() {
return new Content(null, MISSING, NEVER_CHECKED);
}
}
} | [
"dor.d.ma@gmail.com"
] | dor.d.ma@gmail.com |
63a1e25d187741c1dc0e8aff9e445614ca31152a | 308cf11178f8034c1e64e9692d633dbf94d9edda | /core/src/main/java/com/netflix/msl/entityauth/UnauthenticatedAuthenticationFactory.java | 03766f4ed7d6a800e6b8885cf14fa93c18ebfdaf | [
"Apache-2.0"
] | permissive | firmangel8/msl | 9abd151c5b31254fba9ce4ea5a61939c7d262da7 | 78dfd67165533d97051ea6d828063eacc92de77a | refs/heads/master | 2020-12-20T06:34:56.344898 | 2019-10-28T20:00:19 | 2019-10-28T20:00:19 | 235,989,131 | 1 | 0 | Apache-2.0 | 2020-01-24T11:18:03 | 2020-01-24T11:18:03 | null | UTF-8 | Java | false | false | 3,449 | java | /**
* Copyright (c) 2012-2017 Netflix, Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.netflix.msl.entityauth;
import com.netflix.msl.MslEncodingException;
import com.netflix.msl.MslEntityAuthException;
import com.netflix.msl.MslError;
import com.netflix.msl.MslInternalException;
import com.netflix.msl.crypto.ICryptoContext;
import com.netflix.msl.crypto.NullCryptoContext;
import com.netflix.msl.io.MslObject;
import com.netflix.msl.util.AuthenticationUtils;
import com.netflix.msl.util.MslContext;
/**
* <p>Unauthenticated entity authentication factory.</p>
*
* @author Wesley Miaw <wmiaw@netflix.com>
*/
public class UnauthenticatedAuthenticationFactory extends EntityAuthenticationFactory {
/**
* Construct a new unauthenticated authentication factory instance.
*
* @param authutils authentication utilities.
*/
public UnauthenticatedAuthenticationFactory(final AuthenticationUtils authutils) {
super(EntityAuthenticationScheme.NONE);
this.authutils = authutils;
}
/* (non-Javadoc)
* @see com.netflix.msl.entityauth.EntityAuthenticationFactory#createData(com.netflix.msl.util.MslContext, com.netflix.msl.io.MslObject)
*/
@Override
public EntityAuthenticationData createData(final MslContext ctx, final MslObject entityAuthMo) throws MslEncodingException {
return new UnauthenticatedAuthenticationData(entityAuthMo);
}
/* (non-Javadoc)
* @see com.netflix.msl.entityauth.EntityAuthenticationFactory#getCryptoContext(com.netflix.msl.util.MslContext, com.netflix.msl.entityauth.EntityAuthenticationData)
*/
@Override
public ICryptoContext getCryptoContext(final MslContext ctx, final EntityAuthenticationData authdata) throws MslEntityAuthException {
// Make sure we have the right kind of entity authentication data.
if (!(authdata instanceof UnauthenticatedAuthenticationData))
throw new MslInternalException("Incorrect authentication data type " + authdata.getClass().getName() + ".");
final UnauthenticatedAuthenticationData uad = (UnauthenticatedAuthenticationData)authdata;
// Check for revocation.
final String identity = uad.getIdentity();
if (authutils.isEntityRevoked(identity))
throw new MslEntityAuthException(MslError.ENTITY_REVOKED, "none " + identity).setEntityAuthenticationData(uad);
// Verify the scheme is permitted.
if (!authutils.isSchemePermitted(identity, getScheme()))
throw new MslEntityAuthException(MslError.INCORRECT_ENTITYAUTH_DATA, "Authentication Scheme for Device Type Not Supported " + identity + ":" + getScheme()).setEntityAuthenticationData(uad);
// Return the crypto context.
return new NullCryptoContext();
}
/** Authentication utilities. */
final AuthenticationUtils authutils;
}
| [
"wmiaw@netflix.com"
] | wmiaw@netflix.com |
91541866bfbbcbe0101996d3072e16f7d62f3e88 | 99f362592f56352cbdd27c809e84132faa09cece | /jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ICUNotifier.java | 8348b79788e10c44114128b4029270fa6d782ea7 | [
"BSD-3-Clause",
"Apache-2.0"
] | permissive | FD-/j2objc | 77456f613169416880239e26a43fd3d16914e977 | 316bb5a9e9986fa05106fd267da93b8ae60ca212 | refs/heads/master | 2020-04-10T06:07:34.306149 | 2018-12-07T21:15:09 | 2018-12-07T21:15:09 | 160,846,398 | 1 | 0 | Apache-2.0 | 2018-12-07T16:09:43 | 2018-12-07T16:09:43 | null | UTF-8 | Java | false | false | 5,992 | java | /* GENERATED SOURCE. DO NOT MODIFY. */
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html#License
/**
*******************************************************************************
* Copyright (C) 2001-2009, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
package android.icu.impl;
import com.google.j2objc.annotations.Weak;
import java.util.ArrayList;
import java.util.EventListener;
import java.util.Iterator;
import java.util.List;
/**
* <p>Abstract implementation of a notification facility. Clients add
* EventListeners with addListener and remove them with removeListener.
* Notifiers call notifyChanged when they wish to notify listeners.
* This queues the listener list on the notification thread, which
* eventually dequeues the list and calls notifyListener on each
* listener in the list.</p>
*
* <p>Subclasses override acceptsListener and notifyListener
* to add type-safe notification. AcceptsListener should return
* true if the listener is of the appropriate type; ICUNotifier
* itself will ensure the listener is non-null and that the
* identical listener is not already registered with the Notifier.
* NotifyListener should cast the listener to the appropriate
* type and call the appropriate method on the listener.
* @hide Only a subset of ICU is exposed in Android
*/
public abstract class ICUNotifier {
private final Object notifyLock = new Object();
private NotifyThread notifyThread;
private List<EventListener> listeners;
/**
* Add a listener to be notified when notifyChanged is called.
* The listener must not be null. AcceptsListener must return
* true for the listener. Attempts to concurrently
* register the identical listener more than once will be
* silently ignored.
*/
public void addListener(EventListener l) {
if (l == null) {
throw new NullPointerException();
}
if (acceptsListener(l)) {
synchronized (notifyLock) {
if (listeners == null) {
listeners = new ArrayList<EventListener>();
} else {
// identity equality check
for (EventListener ll : listeners) {
if (ll == l) {
return;
}
}
}
listeners.add(l);
}
} else {
throw new IllegalStateException("Listener invalid for this notifier.");
}
}
/**
* Stop notifying this listener. The listener must
* not be null. Attemps to remove a listener that is
* not registered will be silently ignored.
*/
public void removeListener(EventListener l) {
if (l == null) {
throw new NullPointerException();
}
synchronized (notifyLock) {
if (listeners != null) {
// identity equality check
Iterator<EventListener> iter = listeners.iterator();
while (iter.hasNext()) {
if (iter.next() == l) {
iter.remove();
if (listeners.size() == 0) {
listeners = null;
}
return;
}
}
}
}
}
/**
* Queue a notification on the notification thread for the current
* listeners. When the thread unqueues the notification, notifyListener
* is called on each listener from the notification thread.
*/
public void notifyChanged() {
if (listeners != null) {
synchronized (notifyLock) {
if (listeners != null) {
if (notifyThread == null) {
notifyThread = new NotifyThread(this);
notifyThread.setDaemon(true);
notifyThread.start();
}
notifyThread.queue(listeners.toArray(new EventListener[listeners.size()]));
}
}
}
}
/**
* The notification thread.
*/
private static class NotifyThread extends Thread {
@Weak private final ICUNotifier notifier;
private final List<EventListener[]> queue = new ArrayList<EventListener[]>();
NotifyThread(ICUNotifier notifier) {
this.notifier = notifier;
}
/**
* Queue the notification on the thread.
*/
public void queue(EventListener[] list) {
synchronized (this) {
queue.add(list);
notify();
}
}
/**
* Wait for a notification to be queued, then notify all
* listeners listed in the notification.
*/
@Override
public void run() {
EventListener[] list;
while (true) {
try {
synchronized (this) {
while (queue.isEmpty()) {
wait();
}
list = queue.remove(0);
}
for (int i = 0; i < list.length; ++i) {
notifier.notifyListener(list[i]);
}
}
catch (InterruptedException e) {
}
}
}
}
/**
* Subclasses implement this to return true if the listener is
* of the appropriate type.
*/
protected abstract boolean acceptsListener(EventListener l);
/**
* Subclasses implement this to notify the listener.
*/
protected abstract void notifyListener(EventListener l);
}
| [
"antoniocortes@google.com"
] | antoniocortes@google.com |
681af04cd8638517fb596433d481a2c7ede8055d | 8a84640cdfbddef3d0f2feee60b31a9ffd6c7423 | /src/main/java/storm/kafka/bolt/KafkaBolt.java | 89969d9a926901b19cc4af94f84f3f6d2f8650a0 | [
"Apache-2.0"
] | permissive | IMJIU/storm0.9 | 2720a1482f7ff0fdc42cc7dee052aac2098cbac3 | 39108a1301d934e410f3008307202e060dba6cb5 | refs/heads/master | 2021-01-20T17:50:40.681879 | 2020-09-10T01:11:15 | 2020-09-10T01:11:15 | 62,540,782 | 0 | 0 | Apache-2.0 | 2020-10-12T18:49:20 | 2016-07-04T07:28:36 | Java | UTF-8 | Java | false | false | 2,273 | java | package storm.kafka.bolt;
import backtype.storm.task.OutputCollector;
import backtype.storm.task.TopologyContext;
import backtype.storm.topology.OutputFieldsDeclarer;
import backtype.storm.topology.base.BaseRichBolt;
import backtype.storm.tuple.Tuple;
import kafka.javaapi.producer.Producer;
import kafka.producer.KeyedMessage;
import kafka.producer.ProducerConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Map;
import java.util.Properties;
/**
* Bolt implementation that can send Tuple data to Kafka
* <p/>
* It expects the producer configuration and topic in storm config under
* <p/>
* 'kafka.broker.properties' and 'topic'
* <p/>
* respectively.
*/
public class KafkaBolt<K, V> extends BaseRichBolt {
private static final Logger LOG = LoggerFactory.getLogger(KafkaBolt.class);
public static final String TOPIC = "topic";
public static final String KAFKA_BROKER_PROPERTIES = "kafka.broker.properties";
public static final String BOLT_KEY = "key";
public static final String BOLT_MESSAGE = "message";
private Producer<K, V> producer;
private OutputCollector collector;
private String topic;
@Override
public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) {
Map configMap = (Map) stormConf.get(KAFKA_BROKER_PROPERTIES);
Properties properties = new Properties();
properties.putAll(configMap);
ProducerConfig config = new ProducerConfig(properties);
producer = new Producer<K, V>(config);
this.topic = (String) stormConf.get(TOPIC);
this.collector = collector;
}
@Override
public void execute(Tuple input) {
K key = null;
if (input.contains(BOLT_KEY)) {
key = (K) input.getValueByField(BOLT_KEY);
}
V message = (V) input.getValueByField(BOLT_MESSAGE);
try {
producer.send(new KeyedMessage<K, V>(topic, key, message));
} catch (Exception ex) {
LOG.error("Could not send message with key '" + key + "' and value '" + message + "'", ex);
} finally {
collector.ack(input);
}
}
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
}
}
| [
"zlfkyo@sina.com"
] | zlfkyo@sina.com |
14474b26b657e49f6b339173293f364fa9ff040a | d264254817ae1d7adcec51133d6acc3c74e26912 | /src/main/java/com/bolyartech/forge/server/handler/WebPagePlus.java | 5b325dcf2aced07ca417c354262f70cd578b5f57 | [
"Apache-2.0"
] | permissive | ogrebgr/forge-server | e659ae78ae2a258df56316eb298974d90d615872 | b6eb3194939ffbe2bce92b53c8baf9fe8c224b35 | refs/heads/master | 2022-09-19T14:53:01.886447 | 2022-08-31T18:20:03 | 2022-08-31T18:20:03 | 47,914,913 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,067 | java | package com.bolyartech.forge.server.handler;
import com.bolyartech.forge.server.misc.TemplateEngine;
import com.bolyartech.forge.server.misc.TemplateEngineFactory;
import com.bolyartech.forge.server.response.*;
import com.bolyartech.forge.server.route.RequestContext;
import jakarta.servlet.http.Cookie;
import javax.annotation.Nonnull;
import java.util.List;
/**
* Handler which provides normal web page functionality.
* Use {@link #createHtmlResponse(String)} to create HTML response.
* Use {@link #createHtmlResponse(String)} to create redirect response.
*/
abstract public class WebPagePlus implements RouteHandler {
private final TemplateEngineFactory templateEngineFactory;
private final boolean enableGzipSupport;
/**
* Creates new WebPagePlus
*
* @param templateEngineFactory Template engine factory
*/
public WebPagePlus(@Nonnull TemplateEngineFactory templateEngineFactory) {
this.templateEngineFactory = templateEngineFactory;
enableGzipSupport = false;
}
/**
* Creates new WebPagePlus
*
* @param templateEngineFactory Template engine factory
* @param enableGzipSupport if true Gzip compression will be used (if supported by the client)
*/
public WebPagePlus(@Nonnull TemplateEngineFactory templateEngineFactory, boolean enableGzipSupport) {
this.templateEngineFactory = templateEngineFactory;
this.enableGzipSupport = enableGzipSupport;
}
/**
* Handles a HTTP request wrapped as {@link RequestContext} and produces Response
*
* @param ctx Request context
* @param tple Template engine
* @return Response
* @throws ResponseException if there is a problem handling the request
*/
abstract public Response handlePage(RequestContext ctx, TemplateEngine tple) throws ResponseException;
@Override
public Response handle(@Nonnull RequestContext ctx) {
return handlePage(ctx, templateEngineFactory.createNew());
}
/**
* Returns the template engine factory
*
* @return template engine factory
*/
public TemplateEngineFactory getTemplateEngineFactory() {
return templateEngineFactory;
}
/**
* Convenience method for creating HtmlResponse
*
* @param content
* @return
*/
public HtmlResponse createHtmlResponse(String content) {
return new HtmlResponse(content, enableGzipSupport);
}
/**
* Convenience method for creating HtmlResponse
*
* @param content
* @param cookiesToSet
* @return
*/
public HtmlResponse createHtmlResponse(String content, List<Cookie> cookiesToSet) {
return new HtmlResponse(cookiesToSet, content, enableGzipSupport);
}
/**
* Convenience method for creating redirect response (302 Moved permanently/Found)
*
* @param location
* @return
*/
public RedirectResponse createRedirectResponse(String location) {
return new RedirectResponseMovedTemporarily(location);
}
}
| [
"ogibankov@gmail.com"
] | ogibankov@gmail.com |
9bfdcf9e9db86db50a46948e2df85ebadb2c07b3 | dd82f64eaee01c3091000a2593e2581cf3ce4e53 | /custom-boot-examples/custom-boot-starter-i18n-example/src/main/java/com/igitras/boot/controller/TestController.java | 0ce237c74e4a29bbad655abaa73c072e2e41ba5b | [] | no_license | masonmei/boot-custom | a6afd864966165357b680ee0dc4b8c0fa16627ef | e52b04dfe5a7e2afb440fe52cd52488f04ce161a | refs/heads/master | 2021-01-10T07:21:39.281055 | 2015-11-19T12:45:02 | 2015-11-19T12:45:02 | 45,187,878 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 530 | java | package com.igitras.boot.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* Created by mason on 11/17/15.
*/
@RestController
public class TestController {
@Autowired
@RequestMapping("test")
public String test() {
return "test" + LocaleContextHolder.getLocale().getDisplayName();
}
}
| [
"dongxu.m@gmail.com"
] | dongxu.m@gmail.com |
eb1701331ed80e819f7409763f9fb99900ea83be | 647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4 | /com.tencent.mm/classes.jar/com/tencent/mm/plugin/game/h$b.java | 77573872fd56c7168e8550a8d28d7cadffebc98f | [] | no_license | tsuzcx/qq_apk | 0d5e792c3c7351ab781957bac465c55c505caf61 | afe46ef5640d0ba6850cdefd3c11badbd725a3f6 | refs/heads/main | 2022-07-02T10:32:11.651957 | 2022-02-01T12:41:38 | 2022-02-01T12:41:38 | 453,860,108 | 36 | 9 | null | 2022-01-31T09:46:26 | 2022-01-31T02:43:22 | Java | UTF-8 | Java | false | false | 1,444 | java | package com.tencent.mm.plugin.game;
public final class h$b
{
public static final int BW_0_Alpha_0_3 = 2131099668;
public static final int HSH = 2131100707;
public static final int HSI = 2131100710;
public static final int HSJ = 2131100713;
public static final int HSK = 2131100723;
public static final int HSL = 2131100727;
public static final int HSM = 2131100728;
public static final int HSN = 2131100729;
public static final int HSO = 2131100731;
public static final int HSP = 2131100734;
public static final int HSQ = 2131100735;
public static final int HSR = 2131100738;
public static final int HSS = 2131100742;
public static final int HST = 2131100754;
public static final int HSU = 2131100755;
public static final int UN_BW_0_Alpha_0_5 = 2131099922;
public static final int desc_text_color = 2131100368;
public static final int green_text_color = 2131100766;
public static final int half_alpha_black = 2131100785;
public static final int hint_text_color = 2131100796;
public static final int image_gallery_mask = 2131100847;
public static final int normal_text_color = 2131101153;
public static final int wechat_green = 2131101688;
public static final int white = 2131101698;
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes5.jar
* Qualified Name: com.tencent.mm.plugin.game.h.b
* JD-Core Version: 0.7.0.1
*/ | [
"98632993+tsuzcx@users.noreply.github.com"
] | 98632993+tsuzcx@users.noreply.github.com |
86474a8f22bd2ab346ef583ae0b8f04766dbd90a | 5fecf8548d562ffacc7abdae192e0f46a0da584a | /Advanced/SheetReport/src/main/java/hr/ngs/templater/example/SheetReportExample.java | 38fdcc9b7ea2898b7053fca76191645eb3408e92 | [
"Unlicense"
] | permissive | ngs-doo/TemplaterExamples | 2b1471f2fd1d8716f466738194b1c686d3cd6c5c | 8175ea3f3fc18512ff8e4c3cb532d48182097412 | refs/heads/master | 2023-08-08T07:22:26.444612 | 2023-07-31T07:18:59 | 2023-07-31T07:18:59 | 2,289,782 | 41 | 25 | Unlicense | 2023-07-09T10:04:34 | 2011-08-29T16:52:36 | C# | UTF-8 | Java | false | false | 6,006 | java | package hr.ngs.templater.example;
import hr.ngs.templater.Configuration;
import hr.ngs.templater.TemplateDocument;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import java.awt.Desktop;
import java.io.*;
import java.util.*;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
public class SheetReportExample {
public static void main(final String[] args) throws Exception {
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
InputStream templateStream = SheetReportExample.class.getResourceAsStream("/Report.xlsx");
File tmp = File.createTempFile("table", ".xlsx");
InputData data = loadXml(dbFactory);
try (FileOutputStream fos = new FileOutputStream(tmp);
TemplateDocument tpl = Configuration.factory().open(templateStream, "xlsx", fos)) {
tpl.process(data);
}
Desktop.getDesktop().open(tmp);
}
private static String getValue(NodeList xml, String attribute) {
for (int i = 0; i < xml.getLength(); i++) {
Element item = (Element) xml.item(i);
String value = item.getAttribute("name");
if (attribute.equals(value)) return item.getTextContent();
}
return "";
}
private static InputData loadXml(DocumentBuilderFactory dbf) throws Exception {
InputData result = new InputData(6);
InputStream input = SheetReportExample.class.getResourceAsStream("/UNdata_Export.zip");
ZipInputStream zip = new ZipInputStream(input);
ZipEntry entry = zip.getNextEntry();
int size = (int) entry.getSize();
byte[] buffer = new byte[size];
int len;
int position = 0;
while ((len = zip.read(buffer, position, size - position)) > 0) {
position += len;
}
zip.close();
input.close();
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(new ByteArrayInputStream(buffer));
Element root = doc.getDocumentElement();
Element data = (Element)root.getElementsByTagName("data").item(0);
NodeList records = data.getElementsByTagName("record");
String lastCountry = "";
CountryInfo country = new CountryInfo();
Map<String, RawData> cities = new HashMap<String, RawData>();
for (int i = 0; i < records.getLength(); i++) {
NodeList fields = ((Element)records.item(i)).getElementsByTagName("field");
RawData stats = new RawData();
stats.country = getValue(fields, "Country or Area");
stats.year = Integer.parseInt(getValue(fields, "Year"));
stats.city = getValue(fields, "City");
stats.population = (long)Double.parseDouble(getValue(fields, "Value"));
result.data.add(stats);
if (!lastCountry.equals(stats.country)) {
boolean isFirst = lastCountry.length() == 0;
country.name = lastCountry;
lastCountry = stats.country;
if (isFirst) continue;
for(RawData rd : cities.values()) {
CityData cd = new CityData();
cd.name = rd.city;
cd.population = rd.population;
country.city.add(cd);
}
result.country.add(country);
cities.clear();
country = new CountryInfo();
country.name = stats.country;
}
RawData last = cities.get(stats.city);
if (last == null || last.year < stats.year) {
cities.put(stats.city, stats);
}
}
for(RawData rd : cities.values()) {
CityData cd = new CityData();
cd.name = rd.city;
cd.population = rd.population;
country.city.add(cd);
}
result.country.add(country);
return result;
}
public static class InputData {
public List<RawData> data = new ArrayList<>();
public List<CountryInfo> country = new ArrayList<>();
public String[][] cities;
public InputData(int size) {
cities = new String[1][];
cities[0] = new String[size];
for (int i = 0; i < size; i++) {
cities[0][i] = ORDER[i] + " city";
}
}
public Object[][] analysis() {
int size = cities[0].length;
Object[][] result = new Object[country.size()][size + 1];
for (int i = 0; i < country.size(); i++) {
CountryInfo c = country.get(i);
CityData[] sorted = c.city.stream().sorted(Comparator.comparingLong(it -> -it.population)).toArray(CityData[]::new);
result[i][0] = c.name;
for (int j = 1; j <= size && j <= sorted.length; j++) {
result[i][j] = sorted[j - 1].population;
}
}
return result;
}
}
private static String[] ORDER = {
"Largest",
"Second",
"Third",
"Fourth",
"Fifth",
"Sixth",
"Seventh",
};
public static class RawData {
public String country;
public String city;
public int year;
public long population;
}
public static class CityData {
public String name;
public long population;
}
public static class CountryInfo {
public String name;
//In this case, Templater doesn't cope with same tag twice, so let's put tag for the sheet into a separate tag
//also, sheet name can't be longer than 31 characters
public String sheetName() { return name.substring(0, Math.min(30, name.length())); }
public List<CityData> city = new ArrayList<>();
}
}
| [
"rikard@ngs.hr"
] | rikard@ngs.hr |
861c3a59b5fc2f7a56a5c53006e8899e46e8d460 | 310059f7a578936a2c1428cb744697422fbd3207 | /cache2k-jcache/src/main/java/org/cache2k/jcache/provider/JCacheJmxSupport.java | a540ae844eec65d3c987bfff679babb8acb04a90 | [
"Apache-2.0"
] | permissive | alfonsomunozpomer/cache2k | 74cf34012f6afdacdeeed550b190bc8aba2d9ad3 | b54a9d2df7d4b072663fe4dc561355c8a4f7f326 | refs/heads/master | 2022-11-26T20:13:16.915023 | 2020-08-08T22:36:31 | 2020-08-08T22:36:31 | 286,234,358 | 1 | 0 | Apache-2.0 | 2020-08-09T12:38:28 | 2020-08-09T12:38:27 | null | UTF-8 | Java | false | false | 3,584 | java | package org.cache2k.jcache.provider;
/*
* #%L
* cache2k JCache provider
* %%
* Copyright (C) 2000 - 2020 headissue GmbH, Munich
* %%
* 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 org.cache2k.Cache;
import org.cache2k.configuration.Cache2kConfiguration;
import org.cache2k.core.spi.CacheLifeCycleListener;
import javax.management.InstanceNotFoundException;
import javax.management.MBeanServer;
import javax.management.ObjectName;
import java.lang.management.ManagementFactory;
/**
* @author Jens Wilke; created: 2015-04-29
*/
@SuppressWarnings("WeakerAccess")
public class JCacheJmxSupport implements CacheLifeCycleListener {
private final MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
@Override
public void cacheCreated(Cache c, final Cache2kConfiguration cfg) {
}
@Override
public void cacheDestroyed(Cache c) {
disableStatistics(c);
disableJmx(c);
}
public void enableStatistics(JCacheAdapter c) {
MBeanServer mbs = mBeanServer;
String _name = createStatisticsObjectName(c.cache);
try {
mbs.registerMBean(
new JCacheJmxStatisticsMXBean(c),
new ObjectName(_name));
} catch (Exception e) {
throw new IllegalStateException("Error registering JMX bean, name='" + _name + "'", e);
}
}
public void disableStatistics(Cache c) {
MBeanServer mbs = mBeanServer;
String _name = createStatisticsObjectName(c);
try {
mbs.unregisterMBean(new ObjectName(_name));
} catch (InstanceNotFoundException ignore) {
} catch (Exception e) {
throw new IllegalStateException("Error unregister JMX bean, name='" + _name + "'", e);
}
}
public void enableJmx(Cache c, javax.cache.Cache ca) {
MBeanServer mbs = mBeanServer;
String _name = createJmxObjectName(c);
try {
mbs.registerMBean(new JCacheJmxCacheMXBean(ca), new ObjectName(_name));
} catch (Exception e) {
throw new IllegalStateException("Error register JMX bean, name='" + _name + "'", e);
}
}
public void disableJmx(Cache c) {
MBeanServer mbs = mBeanServer;
String _name = createJmxObjectName(c);
try {
mbs.unregisterMBean(new ObjectName(_name));
} catch (InstanceNotFoundException ignore) {
} catch (Exception e) {
throw new IllegalStateException("Error unregister JMX bean, name='" + _name + "'", e);
}
}
public String createStatisticsObjectName(Cache cache) {
return "javax.cache:type=CacheStatistics," +
"CacheManager=" + sanitizeName(cache.getCacheManager().getName()) +
",Cache=" + sanitizeName(cache.getName());
}
public String createJmxObjectName(Cache cache) {
return "javax.cache:type=CacheConfiguration," +
"CacheManager=" + sanitizeName(cache.getCacheManager().getName()) +
",Cache=" + sanitizeName(cache.getName());
}
/**
* Filter illegal chars, same rule as in TCK or RI?
*/
public static String sanitizeName(String string) {
return string == null ? "" : string.replaceAll(":|=|\n|,", ".");
}
}
| [
"jw_github@headissue.com"
] | jw_github@headissue.com |
9ced8e04bf55169d0bb43234138853a102b0f6a4 | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/XWIKI-14302-17-21-NSGA_II-WeightedSum:TestLen:CallDiversity/com/xpn/xwiki/store/XWikiHibernateBaseStore_ESTest.java | a984bae638bb3c0634f233ba39b3f1106ece59f5 | [] | 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 | 572 | java | /*
* This file was automatically generated by EvoSuite
* Fri Apr 03 05:55:44 UTC 2020
*/
package com.xpn.xwiki.store;
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 XWikiHibernateBaseStore_ESTest extends XWikiHibernateBaseStore_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
9788ced9e9d678b7b9b6380b65c4ce60049b3b2d | 6625bc80db3ef210672f050b2b9e90f7f4b02c63 | /library/src/main/java/com/ycbjie/library/db/cache/CacheNotePad.java | 4b324b94f9a405de18eebe8cd9981d33ffd59e57 | [
"Apache-2.0"
] | permissive | tuke0919/LifeHelper | 8038509d7f8edd1efd2ae57115f3ae364bfa1d01 | b29a339f9baa0073d248556e93f84a793eb5cd8e | refs/heads/master | 2020-04-20T00:26:42.284378 | 2019-01-31T08:18:49 | 2019-01-31T08:18:49 | 168,521,667 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,422 | java | package com.ycbjie.library.db.cache;
import io.realm.RealmObject;
/**
* Created by PC on 2017/10/26.
* 作者:PC
*/
public class CacheNotePad extends RealmObject {
private int id; //笔记ID
private String title; //笔记标题
private String content; //笔记内容
private int groupId; //分类ID
private String groupName; //分类名称
private int type; //笔记类型,1纯文本,2Html,3Markdown
private String bgColor; //背景颜色,存储颜色代码
private int isEncrypt ; //是否加密,0未加密,1加密
private String createTime; //创建时间
private String updateTime; //修改时间
private boolean hasAlarm; //是否定时闹钟
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public int getGroupId() {
return groupId;
}
public void setGroupId(int groupId) {
this.groupId = groupId;
}
public String getGroupName() {
return groupName;
}
public void setGroupName(String groupName) {
this.groupName = groupName;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public String getBgColor() {
return bgColor;
}
public void setBgColor(String bgColor) {
this.bgColor = bgColor;
}
public int getIsEncrypt() {
return isEncrypt;
}
public void setIsEncrypt(int isEncrypt) {
this.isEncrypt = isEncrypt;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public String getUpdateTime() {
return updateTime;
}
public void setUpdateTime(String updateTime) {
this.updateTime = updateTime;
}
public boolean isHasAlarm() {
return hasAlarm;
}
public void setHasAlarm(boolean hasAlarm) {
this.hasAlarm = hasAlarm;
}
}
| [
"yangchong211@163.com"
] | yangchong211@163.com |
aa71789f02a2b7733f1f0113c893838adf742ea1 | 732a6fa36e14baf7f828ef19a62b515312f9a109 | /playbook/old/src/main/java/com/mindalliance/channels/playbook/pages/forms/tabs/organization/OrganizationAssetsTab.java | d2bb1189564078c8e26f37a2bbbbf1e110d57320 | [] | no_license | gauravbvt/test | 4e991ad3e7dd5ea670ab88f3a74fe8a42418ec20 | 04e48c87ff5c2209fc4bc703795be3f954909c3a | refs/heads/master | 2020-11-24T02:43:32.565109 | 2014-10-07T23:47:39 | 2014-10-07T23:47:39 | 100,468,202 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,151 | java | package com.mindalliance.channels.playbook.pages.forms.tabs.organization;
import com.mindalliance.channels.playbook.pages.forms.tabs.AbstractFormTab;
import com.mindalliance.channels.playbook.pages.forms.AbstractElementForm;
import com.mindalliance.channels.playbook.pages.forms.panels.RefListPanel;
import com.mindalliance.channels.playbook.support.models.RefPropertyModel;
/**
* Copyright (C) 2008 Mind-Alliance Systems. All Rights Reserved.
* Proprietary and Confidential.
* User: jf
* Date: Aug 27, 2008
* Time: 3:53:10 PM
*/
public class OrganizationAssetsTab extends AbstractFormTab {
private RefListPanel positionsPanel;
private RefListPanel systemsPanel;
public OrganizationAssetsTab(String id, AbstractElementForm elementForm) {
super(id, elementForm);
}
protected void load() {
super.load();
positionsPanel = new RefListPanel("positions", this, new RefPropertyModel(getElement(), "positions"));
addReplaceable(positionsPanel);
systemsPanel = new RefListPanel("systems", this, new RefPropertyModel(getElement(), "systems"));
addReplaceable(systemsPanel);
}
}
| [
"jf@baad322d-9929-0410-88f0-f92e8ff3e1bd"
] | jf@baad322d-9929-0410-88f0-f92e8ff3e1bd |
37ca1a98db66e44d32fc6d05f300f627d356dae7 | 9238e44218c4eab8da22fbdbfdabe4cfb634c86c | /Java OOP Basics June/09. POLYMORPHISM/ex/src/p01_Vehicles/Truck.java | 5b99dabf1bfddc5ca2b88239192dd6ba14378976 | [] | no_license | zgirtsova/Java-Advanced---052018 | ec2b53c52e1c471d60a641ced34d37f74b29132c | 780fdf88e0b94e4b22af7854ecf24b00c4e45eae | refs/heads/master | 2021-08-16T09:34:56.752452 | 2018-10-26T19:16:58 | 2018-10-26T19:16:58 | 133,714,514 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 562 | java | package p01_Vehicles;
public class Truck extends Vehicle {
public Truck(double fuel, double consumption) {
super(fuel, consumption + 1.6);
}
@Override
public void drive(double distance) {
if(super.getFuel() < distance * super.getConsumption()){
throw new IllegalArgumentException("Truck needs refueling");
}
super.setFuel(super.getFuel() - distance * super.getConsumption());
}
@Override
public void refuel(double fuel) {
super.setFuel(super.getFuel() + (fuel * 0.95));
}
}
| [
"zgirtsova@gmail.com"
] | zgirtsova@gmail.com |
c4f150bc30d74b1de771007d4895b19fc13a53f1 | 3ffdafd8cfd427a1ea1148d2e44a497b5539142e | /hypersistence-utils-hibernate-55/src/test/java/io/hypersistence/utils/hibernate/type/json/generic/GenericMySQLJsonTypeTest.java | 6b1ec037d34c5ff0b92a531facb6f2e042221c56 | [
"Apache-2.0"
] | permissive | ErwanLeroux/hibernate-types | bf4010e78866405978f2b3998f3a80c4f4d219bc | 3833140adad34daf720469e1bd1aa50cfacf69ca | refs/heads/master | 2023-03-03T08:12:05.592792 | 2023-02-16T15:10:58 | 2023-02-16T15:10:58 | 250,496,285 | 0 | 0 | Apache-2.0 | 2020-03-27T09:47:01 | 2020-03-27T09:47:00 | null | UTF-8 | Java | false | false | 5,350 | java | package io.hypersistence.utils.hibernate.type.json.generic;
import io.hypersistence.utils.hibernate.type.json.JsonType;
import io.hypersistence.utils.hibernate.type.model.BaseEntity;
import io.hypersistence.utils.hibernate.type.model.Location;
import io.hypersistence.utils.hibernate.type.model.Ticket;
import io.hypersistence.utils.hibernate.util.AbstractMySQLIntegrationTest;
import io.hypersistence.utils.jdbc.validator.SQLStatementCountValidator;
import org.hibernate.annotations.Type;
import org.hibernate.query.NativeQuery;
import org.junit.Test;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import java.util.List;
import static org.junit.Assert.assertEquals;
/**
* @author Vlad Mihalcea
*/
public class GenericMySQLJsonTypeTest extends AbstractMySQLIntegrationTest {
@Override
protected Class<?>[] entities() {
return new Class<?>[]{
Event.class,
Participant.class
};
}
@Override
protected String[] packages() {
return new String[]{
Location.class.getPackage().getName()
};
}
private Event _event;
private Participant _participant;
@Override
protected void afterInit() {
doInJPA(entityManager -> {
Event nullEvent = new Event();
nullEvent.setId(0L);
entityManager.persist(nullEvent);
Location location = new Location();
location.setCountry("Romania");
location.setCity("Cluj-Napoca");
Event event = new Event();
event.setId(1L);
event.setLocation(location);
entityManager.persist(event);
Ticket ticket = new Ticket();
ticket.setPrice(12.34d);
ticket.setRegistrationCode("ABC123");
Participant participant = new Participant();
participant.setId(1L);
participant.setTicket(ticket);
participant.setEvent(event);
entityManager.persist(participant);
_event = event;
_participant = participant;
});
}
@Test
public void testLoad() {
SQLStatementCountValidator.reset();
doInJPA(entityManager -> {
Event event = entityManager.find(Event.class, _event.getId());
assertEquals("Romania", event.getLocation().getCountry());
assertEquals("Cluj-Napoca", event.getLocation().getCity());
});
SQLStatementCountValidator.assertTotalCount(1);
SQLStatementCountValidator.assertSelectCount(1);
SQLStatementCountValidator.assertUpdateCount(0);
}
@Test
public void test() {
doInJPA(entityManager -> {
Event event = entityManager.find(Event.class, _event.getId());
assertEquals("Cluj-Napoca", event.getLocation().getCity());
Participant participant = entityManager.find(Participant.class, _participant.getId());
assertEquals("ABC123", participant.getTicket().getRegistrationCode());
List<String> participants = entityManager.createNativeQuery(
"select p.ticket -> \"$.registrationCode\" " +
"from participant p " +
"where JSON_EXTRACT(p.ticket, \"$.price\") > 1 ")
.getResultList();
event.getLocation().setCity("Constanța");
entityManager.flush();
assertEquals(1, participants.size());
});
}
@Test
public void testBulkUpdate() {
doInJPA(entityManager -> {
Location location = new Location();
location.setCountry("Romania");
location.setCity("Sibiu");
entityManager.createNativeQuery(
"update Event " +
"set location = :location " +
"where id = :id")
.setParameter("id", _event.getId())
.unwrap(NativeQuery.class)
.setParameter("location", location, new JsonType(Location.class))
.executeUpdate();
Event event = entityManager.find(Event.class, _event.getId());
assertEquals("Sibiu", event.getLocation().getCity());
});
}
@Entity(name = "Event")
@Table(name = "event")
public static class Event extends BaseEntity {
@Type(type = "io.hypersistence.utils.hibernate.type.json.JsonType")
@Column(columnDefinition = "json")
private Location location;
public Location getLocation() {
return location;
}
public void setLocation(Location location) {
this.location = location;
}
}
@Entity(name = "Participant")
@Table(name = "participant")
public static class Participant extends BaseEntity {
@Type(type = "json")
@Column(columnDefinition = "json")
private Ticket ticket;
@ManyToOne
private Event event;
public Ticket getTicket() {
return ticket;
}
public void setTicket(Ticket ticket) {
this.ticket = ticket;
}
public Event getEvent() {
return event;
}
public void setEvent(Event event) {
this.event = event;
}
}
}
| [
"mihalcea.vlad@gmail.com"
] | mihalcea.vlad@gmail.com |
78c39fa58f985e86b71bdd357de25d44fef70c77 | 56b546bec7a226098e60e9d22f7475c7eccc3821 | /src/com/ccpg4/anno/MyAspect.java | 3490baf1e45f137ed5084a6bad56c819ee17424d | [] | no_license | chenanddom/Project02_Spring | b12dfb582350d4b5fac6f060bf018c1d26d1b2c1 | 3418dce61debe5a44cfbc4d7f363e56927747be1 | refs/heads/master | 2021-01-01T15:43:31.015328 | 2017-07-19T07:27:34 | 2017-07-19T07:27:34 | 97,685,990 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,517 | java | package com.ccpg4.anno;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;
/**
* Created by lenovo on 2017/7/19.
*/
@Component
@Aspect
public class MyAspect {
//@Before("execution(* com.ccpg4.anno.UserServiceImpl.*(..))")
public void myBefore(JoinPoint joinPoint){
System.out.println("前置通知...."+joinPoint.getSignature().getName());
}
//声明一个公共的切入点
@Pointcut("execution(* com.ccpg4.anno.UserServiceImpl.*(..))")
public void myPointCut(){
}
// @AfterReturning(value = "myPointCut()",returning = "ret")
public void myAfterReturning(JoinPoint joinPoint,Object ret){
System.out.println("后置通知..."+joinPoint.getSignature().getName()+"---ret---"+ret);
}
//@Around(value = "myPointCut()")
public Object myAround(ProceedingJoinPoint proceedingJoinPoint)throws Throwable{
System.out.println("前......");
Object object = proceedingJoinPoint.proceed();
System.out.println("后......");
return object;
}
//@AfterThrowing(value = "myPointCut()",throwing = "e")
public void myAfterThrowing(JoinPoint joinPoin,Throwable e){
System.out.println("抛出异常通知 : " + e.getMessage());
}
@After(value = "myPointCut()")
public void myAfter(JoinPoint joinPoint){
System.out.println("最终通知..."+joinPoint.getSignature().getName());
}
}
| [
"772571631@qq.com"
] | 772571631@qq.com |
140813208d97e8ed3291c685b635dd67cc845966 | 208ba847cec642cdf7b77cff26bdc4f30a97e795 | /fg/fe/src/main/java/org.wp.fe/models/CategoryNode.java | c218732b538f28bcb617b1762dbef07e16a18100 | [] | no_license | kageiit/perf-android-large | ec7c291de9cde2f813ed6573f706a8593be7ac88 | 2cbd6e74837a14ae87c1c4d1d62ac3c35df9e6f8 | refs/heads/master | 2021-01-12T14:00:19.468063 | 2016-09-27T13:10:42 | 2016-09-27T13:10:42 | 69,685,305 | 0 | 0 | null | 2016-09-30T16:59:49 | 2016-09-30T16:59:48 | null | UTF-8 | Java | false | false | 3,419 | java | package org.wp.fe.models;
import android.util.SparseArray;
import org.wp.fe.WordPress;
import java.util.*;
public class CategoryNode {
private int categoryId;
private String name;
private int parentId;
private int level;
SortedMap<String, CategoryNode> children = new TreeMap<String, CategoryNode>(new Comparator<String>() {
@Override
public int compare(String s, String s2) {
return s.compareToIgnoreCase(s2);
}
});
public SortedMap<String, CategoryNode> getChildren() {
return children;
}
public void setChildren(SortedMap<String, CategoryNode> children) {
this.children = children;
}
public CategoryNode(int categoryId, int parentId, String name) {
this.categoryId = categoryId;
this.parentId = parentId;
this.name = name;
}
public int getCategoryId() {
return categoryId;
}
public void setCategoryId(int categoryId) {
this.categoryId = categoryId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getParentId() {
return parentId;
}
public void setParentId(int parentId) {
this.parentId = parentId;
}
public int getLevel() {
return level;
}
public static CategoryNode createCategoryTreeFromDB(int blogId) {
CategoryNode rootCategory = new CategoryNode(-1, -1, "");
if (WordPress.wpDB == null) {
return rootCategory;
}
List<String> stringCategories = WordPress.wpDB.loadCategories(blogId);
// First pass instantiate CategoryNode objects
SparseArray<CategoryNode> categoryMap = new SparseArray<CategoryNode>();
CategoryNode currentRootNode;
for (String name : stringCategories) {
int categoryId = WordPress.wpDB.getCategoryId(blogId, name);
int parentId = WordPress.wpDB.getCategoryParentId(blogId, name);
CategoryNode node = new CategoryNode(categoryId, parentId, name);
categoryMap.put(categoryId, node);
}
// Second pass associate nodes to form a tree
for(int i = 0; i < categoryMap.size(); i++){
CategoryNode category = categoryMap.valueAt(i);
if (category.getParentId() == 0) { // root node
currentRootNode = rootCategory;
} else {
currentRootNode = categoryMap.get(category.getParentId(), rootCategory);
}
currentRootNode.children.put(category.getName(), categoryMap.get(category.getCategoryId()));
}
return rootCategory;
}
private static void preOrderTreeTraversal(CategoryNode node, int level, ArrayList<CategoryNode> returnValue) {
if (node == null) {
return ;
}
if (node.parentId != -1) {
node.level = level;
returnValue.add(node);
}
for (CategoryNode child : node.getChildren().values()) {
preOrderTreeTraversal(child, level + 1, returnValue);
}
}
public static ArrayList<CategoryNode> getSortedListOfCategoriesFromRoot(CategoryNode node) {
ArrayList<CategoryNode> sortedCategories = new ArrayList<CategoryNode>();
preOrderTreeTraversal(node, 0, sortedCategories);
return sortedCategories;
}
} | [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
806cd1abf02a9d965d58f4af9dfa4f22694d2456 | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/thinkaurelius--titan/a649b7a3d40eae5fb7cbbe6b37988a002b6a1ed2/before/InternalAstyanaxMultiWriteKeyColumnValueTest.java | e2feb366bb498a5bc135e57a94b121458b984ef2 | [] | no_license | fracz/refactor-extractor | 3ae45c97cc63f26d5cb8b92003b12f74cc9973a9 | dd5e82bfcc376e74a99e18c2bf54c95676914272 | refs/heads/master | 2021-01-19T06:50:08.211003 | 2018-11-30T13:00:57 | 2018-11-30T13:00:57 | 87,353,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,209 | java | package com.thinkaurelius.titan.diskstorage.cassandra.astyanax;
import org.apache.commons.configuration.Configuration;
import org.junit.BeforeClass;
import org.junit.experimental.categories.Category;
import com.thinkaurelius.titan.CassandraStorageSetup;
import com.thinkaurelius.titan.diskstorage.MultiWriteKeyColumnValueStoreTest;
import com.thinkaurelius.titan.diskstorage.StorageException;
import com.thinkaurelius.titan.diskstorage.cassandra.CassandraProcessStarter;
import com.thinkaurelius.titan.diskstorage.keycolumnvalue.KeyColumnValueStoreManager;
import com.thinkaurelius.titan.testcategory.RandomPartitionerTests;
@Category({RandomPartitionerTests.class})
public class InternalAstyanaxMultiWriteKeyColumnValueTest extends MultiWriteKeyColumnValueStoreTest {
@BeforeClass
public static void startCassandra() {
CassandraProcessStarter.startCleanEmbedded(CassandraStorageSetup.cassandraYamlPath);
}
@Override
public KeyColumnValueStoreManager openStorageManager() throws StorageException {
Configuration config = CassandraStorageSetup.getGenericCassandraStorageConfiguration(getClass().getSimpleName());
return new AstyanaxStoreManager(config);
}
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
eec09bfc9687e675a54fc5946da02d57ca88cf26 | 13a9f27677a80ae33eb64543aa57eaf5b50d9ffa | /hxkj/src/main/java/com/ystech/weixin/service/WeixinAccountManageImpl.java | babeac6668af2afe5ce2338280f802442b22d540 | [] | no_license | shusanzhan/hxkj | 68b434e48827eca42e123cd609ffa0b115c5c108 | 08fcf33a138a5ffd54cc68cf72e807e6c4e59b75 | refs/heads/master | 2022-12-21T04:33:19.467220 | 2020-05-05T01:33:34 | 2020-05-05T01:33:34 | 253,965,772 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,895 | java | package com.ystech.weixin.service;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;
import com.ystech.core.dao.HibernateEntityDao;
import com.ystech.core.security.SecurityUserHolder;
import com.ystech.sys.model.Enterprise;
import com.ystech.sys.model.SystemInfo;
import com.ystech.sys.service.SystemInfoMangeImpl;
import com.ystech.weixin.core.util.WeixinUtil;
import com.ystech.weixin.model.WeixinAccount;
import net.sf.json.JSONObject;
@Component("weixinAccountManageImpl")
public class WeixinAccountManageImpl extends HibernateEntityDao<WeixinAccount>{
private SystemInfoMangeImpl systemInfoMangeImpl;
@Resource
public void setSystemInfoMangeImpl(SystemInfoMangeImpl systemInfoMangeImpl) {
this.systemInfoMangeImpl = systemInfoMangeImpl;
}
/**
* 功能描述:获取微信账号
* @return
*/
public WeixinAccount findByWeixinAccount(){
List<SystemInfo> systemInfos = systemInfoMangeImpl.getAll();
if(null==systemInfos||systemInfos.isEmpty()){
return null;
}
SystemInfo systemInfo = systemInfos.get(0);
Integer wechatType = systemInfo.getWechatType();
WeixinAccount weixinAccount=null;
if(wechatType==SystemInfo.WECHATTYPE_MODEL_ONCE){
weixinAccount=get(SystemInfo.ROOT);
}
if(wechatType==SystemInfo.WECHATTYPE_MODEL_MORE){
Enterprise enterprise = SecurityUserHolder.getEnterprise();
weixinAccount= findUniqueBy("enterpriseId", enterprise.getDbid());
}
return weixinAccount;
}
public String getAccessToken(String accountId) {
WeixinAccount weixinAccountEntity = findUniqueBy("weixinAccountid", accountId);
String token = weixinAccountEntity.getAccountaccesstoken();
if (token != null && !"".equals(token)) {
// 判断有效时间 是否超过2小时
java.util.Date end = new java.util.Date();
java.util.Date start = new java.util.Date(weixinAccountEntity.getAddtoekntime()
.getTime());
if ((end.getTime() - start.getTime()) / 1000 / 3600 >= 2) {
// 失效 重新获取
String requestUrl = WeixinUtil.access_token_url.replace(
"APPID", weixinAccountEntity.getAccountappid()).replace(
"APPSECRET", weixinAccountEntity.getAccountappsecret());
JSONObject jsonObject = WeixinUtil.httpRequest(requestUrl,
"GET", null);
if (null != jsonObject) {
try {
token = jsonObject.getString("access_token");
// 重置token
weixinAccountEntity.setAccountaccesstoken(token);
// 重置事件
weixinAccountEntity.setAddtoekntime(new Date());
save(weixinAccountEntity);
} catch (Exception e) {
token = null;
// 获取token失败
String wrongMessage = "获取token失败 errcode:{} errmsg:{}"
+ jsonObject.getInt("errcode")
+ jsonObject.getString("errmsg");
System.out.println(""+wrongMessage);
}
}
} else {
return weixinAccountEntity.getAccountaccesstoken();
}
} else {
String requestUrl = WeixinUtil.access_token_url.replace("APPID",
weixinAccountEntity.getAccountappid()).replace("APPSECRET",
weixinAccountEntity.getAccountappsecret());
JSONObject jsonObject = WeixinUtil.httpRequest(requestUrl, "GET",
null);
if (null != jsonObject) {
try {
token = jsonObject.getString("access_token");
// 重置token
weixinAccountEntity.setAccountaccesstoken(token);
// 重置事件
weixinAccountEntity.setAddtoekntime(new Date());
save(weixinAccountEntity);
} catch (Exception e) {
token = null;
// 获取token失败
String wrongMessage = "获取token失败 errcode:{} errmsg:{}"
+ jsonObject.getInt("errcode")
+ jsonObject.getString("errmsg");
System.out.println(""+wrongMessage);
}
}
}
return token;
}
}
| [
"shusanzhan@163.com"
] | shusanzhan@163.com |
94e00061367ae6af3e02d372355dd31d770123b6 | 508da7012b304f5d698adcaa21ef1ea444417851 | /connectors/camel-mllp-kafka-connector/src/main/java/org/apache/camel/kafkaconnector/mllp/CamelMllpSourceTask.java | 98653eed4f57b4ac20daca2aaa53304e48447c41 | [
"Apache-2.0"
] | permissive | jboss-fuse/camel-kafka-connector | 02fd86c99ee4d2ac88ac5cf8b4cf56bd0bbcc007 | 8411f2f772a00d1d4a53ca8f24e13128306f5c02 | refs/heads/master | 2021-07-02T19:43:30.085652 | 2020-10-19T13:17:53 | 2020-10-19T13:18:04 | 181,911,766 | 16 | 7 | Apache-2.0 | 2019-12-04T08:44:47 | 2019-04-17T14:45:05 | Java | UTF-8 | Java | false | false | 1,677 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.camel.kafkaconnector.mllp;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Generated;
import org.apache.camel.kafkaconnector.CamelSourceConnectorConfig;
import org.apache.camel.kafkaconnector.CamelSourceTask;
@Generated("This class has been generated by camel-kafka-connector-generator-maven-plugin, remove this annotation to prevent it from being generated.")
public class CamelMllpSourceTask extends CamelSourceTask {
@Override
protected CamelSourceConnectorConfig getCamelSourceConnectorConfig(
Map<String, String> props) {
return new CamelMllpSourceConnectorConfig(props);
}
@Override
protected Map<String, String> getDefaultConfig() {
return new HashMap<String, String>() {{
put(CamelSourceConnectorConfig.CAMEL_SOURCE_COMPONENT_CONF, "mllp");
}};
}
} | [
"andrea.tarocchi@gmail.com"
] | andrea.tarocchi@gmail.com |
66e952d75028786d8310583aaa0dab488ea0af7c | 6f753d093310a5e0c0081dceb6ba73f1f8ede1b4 | /org.eclipse.emf.refactor.comrel/src/comrel/FilterHelper.java | b2fced05ea665098a63295b3fda5f866ee976775 | [] | no_license | ambrusthomas/MeDeR.refactor.refactoring | fc69a9ba3000833f9bc781c6b321cebe325a7e0e | 6cdace0efe8453050437b0e2b61a2409d163fe00 | refs/heads/master | 2021-01-22T19:09:40.966554 | 2017-03-29T16:21:41 | 2017-03-29T16:21:41 | 85,172,883 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,469 | java | /**
* <copyright>
* </copyright>
*
* $Id$
*/
package comrel;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Filter Helper</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* <ul>
* <li>{@link comrel.FilterHelper#getInputPort <em>Input Port</em>}</li>
* </ul>
* </p>
*
* @see comrel.ComrelPackage#getFilterHelper()
* @model abstract="true"
* @generated
*/
public interface FilterHelper extends Helper {
/**
* Returns the value of the '<em><b>Input Port</b></em>' containment reference.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Input Port</em>' containment reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Input Port</em>' containment reference.
* @see #setInputPort(MultiInputPort)
* @see comrel.ComrelPackage#getFilterHelper_InputPort()
* @model containment="true" required="true"
* @generated
*/
MultiInputPort getInputPort();
/**
* Sets the value of the '{@link comrel.FilterHelper#getInputPort <em>Input Port</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Input Port</em>' containment reference.
* @see #getInputPort()
* @generated
*/
void setInputPort(MultiInputPort value);
} // FilterHelper
| [
"tarendt"
] | tarendt |
1e237533ead9d57bdae853aac01d3caac1bc4377 | edbd417df42bf2f61e1794a06f893bf86b65f0b8 | /inner-classes/src/main/java/org/denispozo/tutorial/thj/innerclasses/controller/GreenhouseControls.java | 78198d5201179015d14bf54db8a706cd368e1818 | [] | no_license | denis-pozo/thinking-in-java | 1c25717b0ddb55f5dcf10eacece61953c54ee3b7 | 2f03d159cf16fbcc92f37381e02aa073d4de01bd | refs/heads/master | 2022-12-29T11:08:18.597445 | 2020-10-14T09:32:40 | 2020-10-14T09:32:40 | 263,020,791 | 0 | 0 | null | 2020-10-14T09:32:41 | 2020-05-11T11:18:05 | Java | UTF-8 | Java | false | false | 3,627 | java | package org.denispozo.tutorial.thj.innerclasses.controller;
/*
* Chapter - Inner Classes
* Section - Inner Classes and Control Frameworks
* Exercise 24
*/
public class GreenhouseControls extends Controller {
@SuppressWarnings("unused")
private boolean light = false;
public class LightOn extends Event {
public LightOn(long delayTime) {
super(delayTime);
}
public void action() {
// Put hardware control code here to
// physically turn on the light
light = true;
}
public String toString() {
return "Light is on";
}
}
public class LightOff extends Event {
public LightOff(long delayTime){
super(delayTime);
}
public void action() {
// Put hardware control code here to
// physically turn off the light
light = false;
}
public String toString() {
return "Light is off";
}
}
@SuppressWarnings("unused")
private boolean water = false;
public class WaterOn extends Event {
public WaterOn(long delayTime) {
super(delayTime);
}
public void action() {
// Put hardware control code here
water = true;
}
public String toString() {
return "Greenhouse Water is on";
}
}
public class WaterOff extends Event {
public WaterOff(long delayTime){
super(delayTime);
}
public void action() {
// Put hardware control code here
water = false;
}
public String toString() {
return "Greenhouse Water is off";
}
}
@SuppressWarnings("unused")
private boolean fan = false;
public class FanOn extends Event {
public FanOn(long delayTime) {
super(delayTime);
}
public void action() {
// Put hardware control code here
fan = true;
}
public String toString() {
return "Fan is on";
}
}
public class FanOff extends Event {
public FanOff(long delayTime){
super(delayTime);
}
public void action() {
// Put hardware control code here
fan = false;
}
public String toString() {
return "Fan is off";
}
}
@SuppressWarnings("unused")
private String thermostat = "Day";
public class ThermostatNight extends Event {
public ThermostatNight(long delayTime) {
super(delayTime);
}
public void action() {
// Put hardware control code here
thermostat = "Night";
}
public String toString() {
return "Thermostat on night setting";
}
}
public class ThermostatDay extends Event {
public ThermostatDay(long delayTime){
super(delayTime);
}
public void action() {
// Put hardware control code here
thermostat = "Day";
}
public String toString() {
return "Thermostat on day setting";
}
}
// An exmample of an action() that inserts a new
// one of itself into the event list:
public class Bell extends Event {
public Bell(long delayTime) {
super(delayTime);
}
public void action() {
addEvent(new Bell(delayTime));
}
public String toString() {
return "Bing!";
}
}
public class Restart extends Event {
private Event[] eventList;
public Restart(long delayTime, Event [] eventList){
super(delayTime);
this.eventList = eventList;
for(Event e : eventList){
addEvent(e);
}
}
public void action() {
for(Event e : eventList){
e.start();
addEvent(e);
}
start();
addEvent(this);
}
public String toString() {
return "Restarting system";
}
}
public static class Terminate extends Event {
public Terminate(long delayTime){
super(delayTime);
}
public void action() {
System.exit(0);
}
public String toString() {
return "Terminating" ;
}
}
}
| [
"denis.pozo@dai-labor.de"
] | denis.pozo@dai-labor.de |
4209231f0fc65f5c8025d35eeb3e617ea64d3673 | db6e498dd76a6ce78d83e1e7801674783230a90d | /thirdlib/base-protocol/protocol/src/main/java/pb4server/AlliancePublishTopicAskRtOrBuilder.java | b6c1a1926066bd61faf06b68cd6fb630785e54a0 | [] | no_license | daxingyou/game-4 | 3d78fb460c4b18f711be0bb9b9520d3e8baf8349 | 2baef6cebf5eb0991b1f5c632c500b522c41ab20 | refs/heads/master | 2023-03-19T15:57:56.834881 | 2018-10-10T06:35:57 | 2018-10-10T06:35:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | true | 900 | java | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: internal2public.proto
package pb4server;
public interface AlliancePublishTopicAskRtOrBuilder extends
// @@protoc_insertion_point(interface_extends:pb4server.AlliancePublishTopicAskRt)
com.google.protobuf.MessageOrBuilder {
/**
* <code>int32 rt = 1;</code>
*/
int getRt();
/**
* <pre>
*联盟邮件的主题及回复
* </pre>
*
* <code>.pb4server.AllianceTopicInfoVo topic = 2;</code>
*/
boolean hasTopic();
/**
* <pre>
*联盟邮件的主题及回复
* </pre>
*
* <code>.pb4server.AllianceTopicInfoVo topic = 2;</code>
*/
pb4server.AllianceTopicInfoVo getTopic();
/**
* <pre>
*联盟邮件的主题及回复
* </pre>
*
* <code>.pb4server.AllianceTopicInfoVo topic = 2;</code>
*/
pb4server.AllianceTopicInfoVoOrBuilder getTopicOrBuilder();
}
| [
"weiwei.witch@gmail.com"
] | weiwei.witch@gmail.com |
55354f3d61bc7d1783384f39631b7a997b32fa8c | 7ef841751c77207651aebf81273fcc972396c836 | /bstream/src/main/java/com/loki/bstream/stubs/SampleClass3019.java | 77ae2cbde27ab8b3b3101d6254de6b8b813463ef | [] | no_license | SergiiGrechukha/ModuleApp | e28e4dd39505924f0d36b4a0c3acd76a67ed4118 | 00e22d51c8f7100e171217bcc61f440f94ab9c52 | refs/heads/master | 2022-05-07T13:27:37.704233 | 2019-11-22T07:11:19 | 2019-11-22T07:11:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 274 | java | package com.loki.bstream.stubs;
public class SampleClass3019 {
private SampleClass3020 sampleClass;
public SampleClass3019(){
sampleClass = new SampleClass3020();
}
public String getClassName() {
return sampleClass.getClassName();
}
} | [
"sergey.grechukha@gmail.com"
] | sergey.grechukha@gmail.com |
b2b124d6b0de156d26db6c0e38578e89175411dd | 836aeeb5310276ff2fd9bc4dbd27fb46acd66377 | /hotcomm-community-common/src/main/java/com/hotcomm/community/common/bean/ui/device/postureSynthesize/SelectFullStatisticsUM.java | 352491920d294ac5a41e44c306dc632c938ac58d | [] | no_license | jiajiales/hotcomm-communitys | d345488ad5a7459110bc63952ec759e3e66ba55d | abda57b2bb1ed5a2eece156e622b7aec2195a8ba | refs/heads/master | 2020-04-22T17:14:05.153135 | 2019-02-13T15:44:54 | 2019-02-13T15:44:54 | 170,533,655 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 488 | java | package com.hotcomm.community.common.bean.ui.device.postureSynthesize;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
@Data
@EqualsAndHashCode(callSuper = false)
@NoArgsConstructor
public class SelectFullStatisticsUM implements Serializable {
/**
*
*/
private static final long serialVersionUID = 904998166632969635L;
private Integer num;
private Integer offLine;
private Integer alarm;
}
| [
"562910919@qq.com"
] | 562910919@qq.com |
da1e60ed3ad7cb24201c2b4315a501f80d9033c5 | 365267d7941f76c97fac8af31a788d8c0fb2d384 | /src/main/java/net/minecraft/client/multiplayer/ChunkProviderClient.java | a9d8ccb88b02957f030d5da68ea8b98377565d48 | [
"MIT"
] | permissive | potomy/client | 26d8c31657485f216639efd13b2fdda67570d9b5 | c01d23eb05ed83abb4fee00f9bf603b6bc3e2e27 | refs/heads/master | 2021-06-21T16:02:26.920860 | 2017-08-02T02:03:49 | 2017-08-02T02:03:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,343 | java | package net.minecraft.client.multiplayer;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.util.IProgressUpdate;
import net.minecraft.util.LongHashMap;
import net.minecraft.world.ChunkCoordIntPair;
import net.minecraft.world.ChunkPosition;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.EmptyChunk;
import net.minecraft.world.chunk.IChunkProvider;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class ChunkProviderClient implements IChunkProvider
{
private static final Logger logger = LogManager.getLogger();
/**
* The completely empty chunk used by ChunkProviderClient when chunkMapping doesn't contain the requested
* coordinates.
*/
private Chunk blankChunk;
/**
* The mapping between ChunkCoordinates and Chunks that ChunkProviderClient maintains.
*/
private LongHashMap chunkMapping = new LongHashMap();
/**
* This may have been intended to be an iterable version of all currently loaded chunks (MultiplayerChunkCache),
* with identical contents to chunkMapping's values. However it is never actually added to.
*/
private List chunkListing = new ArrayList();
/** Reference to the World object. */
private World worldObj;
public ChunkProviderClient(World p_i1184_1_)
{
this.blankChunk = new EmptyChunk(p_i1184_1_, 0, 0);
this.worldObj = p_i1184_1_;
}
/**
* Checks to see if a chunk exists at x, y
*/
public boolean chunkExists(int p_73149_1_, int p_73149_2_)
{
return true;
}
/**
* Unload chunk from ChunkProviderClient's hashmap. Called in response to a Packet50PreChunk with its mode field set
* to false
*/
public void unloadChunk(int p_73234_1_, int p_73234_2_)
{
Chunk var3 = this.provideChunk(p_73234_1_, p_73234_2_);
if (!var3.isEmpty())
{
var3.onChunkUnload();
}
this.chunkMapping.remove(ChunkCoordIntPair.chunkXZ2Int(p_73234_1_, p_73234_2_));
this.chunkListing.remove(var3);
}
/**
* loads or generates the chunk at the chunk location specified
*/
public Chunk loadChunk(int p_73158_1_, int p_73158_2_)
{
Chunk var3 = new Chunk(this.worldObj, p_73158_1_, p_73158_2_);
this.chunkMapping.add(ChunkCoordIntPair.chunkXZ2Int(p_73158_1_, p_73158_2_), var3);
this.chunkListing.add(var3);
var3.isChunkLoaded = true;
return var3;
}
/**
* Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the
* specified chunk from the map seed and chunk seed
*/
public Chunk provideChunk(int p_73154_1_, int p_73154_2_)
{
Chunk var3 = (Chunk)this.chunkMapping.getValueByKey(ChunkCoordIntPair.chunkXZ2Int(p_73154_1_, p_73154_2_));
return var3 == null ? this.blankChunk : var3;
}
/**
* Two modes of operation: if passed true, save all Chunks in one go. If passed false, save up to two chunks.
* Return true if all chunks have been saved.
*/
public boolean saveChunks(boolean p_73151_1_, IProgressUpdate p_73151_2_)
{
return true;
}
/**
* Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently
* unimplemented.
*/
public void saveExtraData() {}
/**
* Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk.
*/
public boolean unloadQueuedChunks()
{
long var1 = System.currentTimeMillis();
Iterator var3 = this.chunkListing.iterator();
while (var3.hasNext())
{
Chunk var4 = (Chunk)var3.next();
var4.func_150804_b(System.currentTimeMillis() - var1 > 5L);
}
if (System.currentTimeMillis() - var1 > 100L)
{
logger.info("Warning: Clientside chunk ticking took {} ms", new Object[] {Long.valueOf(System.currentTimeMillis() - var1)});
}
return false;
}
/**
* Returns if the IChunkProvider supports saving.
*/
public boolean canSave()
{
return false;
}
/**
* Populates chunk with ores etc etc
*/
public void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_) {}
/**
* Converts the instance data to a readable string.
*/
public String makeString()
{
return "MultiplayerChunkCache: " + this.chunkMapping.getNumHashElements() + ", " + this.chunkListing.size();
}
/**
* Returns a list of creatures of the specified type that can spawn at the given location.
*/
public List getPossibleCreatures(EnumCreatureType p_73155_1_, int p_73155_2_, int p_73155_3_, int p_73155_4_)
{
return null;
}
public ChunkPosition func_147416_a(World p_147416_1_, String p_147416_2_, int p_147416_3_, int p_147416_4_, int p_147416_5_)
{
return null;
}
public int getLoadedChunkCount()
{
return this.chunkListing.size();
}
public void recreateStructures(int p_82695_1_, int p_82695_2_) {}
}
| [
"dav.nico@orange.fr"
] | dav.nico@orange.fr |
25be8878a518396317e8c5f627ff875aec2ea31e | 995f73d30450a6dce6bc7145d89344b4ad6e0622 | /DVC-AN20_EMUI10.1.1/src/main/java/com/huawei/g11n/tmr/datetime/data/LocaleParamGet_id.java | 0cbcdf7247ff413ec8e2be78b96c69f9f1a2c93e | [] | no_license | morningblu/HWFramework | 0ceb02cbe42585d0169d9b6c4964a41b436039f5 | 672bb34094b8780806a10ba9b1d21036fd808b8e | refs/heads/master | 2023-07-29T05:26:14.603817 | 2021-09-03T05:23:34 | 2021-09-03T05:23:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,170 | java | package com.huawei.g11n.tmr.datetime.data;
import java.util.HashMap;
public class LocaleParamGet_id {
public HashMap<String, String> date = new HashMap<String, String>() {
/* class com.huawei.g11n.tmr.datetime.data.LocaleParamGet_id.AnonymousClass1 */
{
put("param_tmark", "[:.]");
put("param_am", "AM");
put("param_pm", "PM");
put("param_MMM", "Jan|Feb|Mar|Apr|Mei|Jun|Jul|Agt|Sep|Okt|Nov|Des");
put("param_MMMM", "Januari|Februari|Maret|April|Mei|Juni|Juli|Agustus|September|Oktober|November|Desember");
put("param_E", "Min|Sen|Sel|Rab|Kam|Jum|Sab");
put("param_E2", "Min|Sen|Sel|Rab|Kam|Jum|Sab");
put("param_EEEE", "Minggu|Senin|Selasa|Rabu|Kamis|Jumat|Sabtu");
put("param_days", "hari\\s+ini|besok|lusa");
put("param_thisweek", "Minggu\\s+ini|Senin\\s+ini|Selasa\\s+ini|Rabu\\s+ini|Kamis\\s+ini|Jumat\\s+ini|Sabtu\\s+ini");
put("param_nextweek", "Minggu\\s+berikutnya|Senin\\s+berikutnya|Selasa\\s+berikutnya|Rabu\\s+berikutnya|Kamis\\s+berikutnya|Jumat\\s+berikutnya|Sabtu\\s+berikutnya");
}
};
}
| [
"dstmath@163.com"
] | dstmath@163.com |
fd0cb68e4a3fe59fac7a621cd6cefe6551eed38b | 9049eabb2562cd3e854781dea6bd0a5e395812d3 | /sources/com/google/android/gms/ads/internal/common/C0356b.java | cf813dfacaa8a1b5fa04d6fb9ba47d19ff40a507 | [] | no_license | Romern/gms_decompiled | 4c75449feab97321da23ecbaac054c2303150076 | a9c245404f65b8af456b7b3440f48d49313600ba | refs/heads/master | 2022-07-17T23:22:00.441901 | 2020-05-17T18:26:16 | 2020-05-17T18:26:16 | 264,227,100 | 2 | 5 | null | null | null | null | UTF-8 | Java | false | false | 725 | java | package com.google.android.gms.ads.internal.common;
import android.content.Context;
import android.content.Intent;
/* renamed from: com.google.android.gms.ads.internal.common.b */
/* compiled from: :com.google.android.gms@201515033@20.15.15 (120300-306758586) */
public final class C0356b {
/* renamed from: a */
public final Context f8165a;
public C0356b(Context context) {
sdo.checkIfNull(context, "Context can not be null");
this.f8165a = context;
}
/* renamed from: a */
public final boolean mo6597a(Intent intent) {
sdo.checkIfNull(intent, "Intent can not be null");
return !this.f8165a.getPackageManager().queryIntentActivities(intent, 0).isEmpty();
}
}
| [
"roman.karwacik@rwth-aachen.de"
] | roman.karwacik@rwth-aachen.de |
31179148ab8cee5d774f8740c700dacc86a41cfd | bdc628ff8fa566518adc0c77f0e99d024c16b70a | /JavaMulti-threadProgramming/src/main/java/com/zkzong/ch4_lock/reentrantlock/MyThread.java | ad5845921ffd1cb64b6e04b4f6ed7ce5284b2e1e | [] | no_license | zkzong/book-java | 7073223097a252264504574464927fb805f51518 | 616e5f1b6ebfc6d64a5c56d7fdbe61eafe04dc93 | refs/heads/master | 2021-06-21T19:29:00.270655 | 2017-08-19T14:29:53 | 2017-08-19T14:29:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 327 | java | package com.zkzong.ch4_lock.reentrantlock;
/**
* Created by zong on 17-4-16.
*/
public class MyThread extends Thread {
private MyService service;
public MyThread(MyService service) {
super();
this.service = service;
}
@Override
public void run() {
service.testMethod();
}
}
| [
"zongzhankui@hotmail.com"
] | zongzhankui@hotmail.com |
8df11897b8b4fb28fc55584d4f44d9386cf73658 | 27511a2f9b0abe76e3fcef6d70e66647dd15da96 | /src/com/instagram/actionbar/n.java | a2b46afd3cbad74b846a3efb5ca136e9f6a75501 | [] | no_license | biaolv/com.instagram.android | 7edde43d5a909ae2563cf104acfc6891f2a39ebe | 3fcd3db2c3823a6d29a31ec0f6abcf5ceca995de | refs/heads/master | 2022-05-09T15:05:05.412227 | 2016-07-21T03:48:36 | 2016-07-21T03:48:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 204 | java | package com.instagram.actionbar;
public abstract interface n
extends j
{}
/* Location:
* Qualified Name: com.instagram.actionbar.n
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"reverseengineeringer@hackeradmin.com"
] | reverseengineeringer@hackeradmin.com |
842747216505210f7a0ae72170a34e829436d424 | 13d6878c54b657bc7dd0ad1665718035c5d529b7 | /src/main/java/com/armadillo/api/authservice/security/AccountCredentials.java | 2581a306a61613357f585fc926cc51af8be33bbf | [] | no_license | nicktank2214/api-auth-service | 1925cc34b35f23c148f7d2dee9e25fb4c30c7eb1 | f3815faf4588d0b84bac39ca8bd46283346dd443 | refs/heads/master | 2020-04-20T07:19:31.153161 | 2019-02-01T14:43:43 | 2019-02-01T14:43:43 | 168,707,198 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 661 | java | package com.armadillo.api.authservice.security;
/*
* Notes
* -----
*
* We need just one extra class: the AccountCredentials class.
* This will be used to map request data when a POST call is made to /login path.
* The request data should contain the username and password as part of the body
*
*/
public class AccountCredentials {
private String username;
private String password;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
} | [
"nicktankard@gmail.com"
] | nicktankard@gmail.com |
00d4bfe7d2e45ff825324612bd684610e9005e4c | 86505462601eae6007bef6c9f0f4eeb9fcdd1e7b | /bin/platform/bootstrap/gensrc/de/hybris/platform/core/model/AbstractDynamicContentModel.java | f9e9c5c167dd086d4e057f47a0f454cb08ad3f90 | [] | no_license | jp-developer0/hybrisTrail | 82165c5b91352332a3d471b3414faee47bdb6cee | a0208ffee7fee5b7f83dd982e372276492ae83d4 | refs/heads/master | 2020-12-03T19:53:58.652431 | 2020-01-02T18:02:34 | 2020-01-02T18:02:34 | 231,430,332 | 0 | 4 | null | 2020-08-05T22:46:23 | 2020-01-02T17:39:15 | null | UTF-8 | Java | false | false | 7,422 | java | /*
* ----------------------------------------------------------------
* --- WARNING: THIS FILE IS GENERATED AND WILL BE OVERWRITTEN! ---
* --- Generated at 2 ene. 2020 14:28:39 ---
* ----------------------------------------------------------------
*
* [y] hybris Platform
* Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved.
* This software is the confidential and proprietary information of SAP
* ("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.
*/
package de.hybris.platform.core.model;
import de.hybris.bootstrap.annotations.Accessor;
import de.hybris.platform.core.model.ItemModel;
import de.hybris.platform.servicelayer.model.ItemModelContext;
/**
* Generated model class for type AbstractDynamicContent first defined at extension core.
*/
@SuppressWarnings("all")
public class AbstractDynamicContentModel extends ItemModel
{
/**<i>Generated model type code constant.</i>*/
public static final String _TYPECODE = "AbstractDynamicContent";
/** <i>Generated constant</i> - Attribute key of <code>AbstractDynamicContent.code</code> attribute defined at extension <code>core</code>. */
public static final String CODE = "code";
/** <i>Generated constant</i> - Attribute key of <code>AbstractDynamicContent.active</code> attribute defined at extension <code>core</code>. */
public static final String ACTIVE = "active";
/** <i>Generated constant</i> - Attribute key of <code>AbstractDynamicContent.checksum</code> attribute defined at extension <code>core</code>. */
public static final String CHECKSUM = "checksum";
/** <i>Generated constant</i> - Attribute key of <code>AbstractDynamicContent.content</code> attribute defined at extension <code>core</code>. */
public static final String CONTENT = "content";
/** <i>Generated constant</i> - Attribute key of <code>AbstractDynamicContent.version</code> attribute defined at extension <code>core</code>. */
public static final String VERSION = "version";
/**
* <i>Generated constructor</i> - Default constructor for generic creation.
*/
public AbstractDynamicContentModel()
{
super();
}
/**
* <i>Generated constructor</i> - Default constructor for creation with existing context
* @param ctx the model context to be injected, must not be null
*/
public AbstractDynamicContentModel(final ItemModelContext ctx)
{
super(ctx);
}
/**
* <i>Generated constructor</i> - Constructor with all mandatory attributes.
* @deprecated since 4.1.1 Please use the default constructor without parameters
* @param _code initial attribute declared by type <code>AbstractDynamicContent</code> at extension <code>core</code>
* @param _content initial attribute declared by type <code>AbstractDynamicContent</code> at extension <code>core</code>
*/
@Deprecated(since = "4.1.1", forRemoval = true)
public AbstractDynamicContentModel(final String _code, final String _content)
{
super();
setCode(_code);
setContent(_content);
}
/**
* <i>Generated constructor</i> - for all mandatory and initial attributes.
* @deprecated since 4.1.1 Please use the default constructor without parameters
* @param _code initial attribute declared by type <code>AbstractDynamicContent</code> at extension <code>core</code>
* @param _content initial attribute declared by type <code>AbstractDynamicContent</code> at extension <code>core</code>
* @param _owner initial attribute declared by type <code>Item</code> at extension <code>core</code>
*/
@Deprecated(since = "4.1.1", forRemoval = true)
public AbstractDynamicContentModel(final String _code, final String _content, final ItemModel _owner)
{
super();
setCode(_code);
setContent(_content);
setOwner(_owner);
}
/**
* <i>Generated method</i> - Getter of the <code>AbstractDynamicContent.active</code> attribute defined at extension <code>core</code>.
* @return the active
*/
@Accessor(qualifier = "active", type = Accessor.Type.GETTER)
public Boolean getActive()
{
return getPersistenceContext().getPropertyValue(ACTIVE);
}
/**
* <i>Generated method</i> - Getter of the <code>AbstractDynamicContent.checksum</code> attribute defined at extension <code>core</code>.
* @return the checksum
*/
@Accessor(qualifier = "checksum", type = Accessor.Type.GETTER)
public String getChecksum()
{
return getPersistenceContext().getPropertyValue(CHECKSUM);
}
/**
* <i>Generated method</i> - Getter of the <code>AbstractDynamicContent.code</code> attribute defined at extension <code>core</code>.
* @return the code
*/
@Accessor(qualifier = "code", type = Accessor.Type.GETTER)
public String getCode()
{
return getPersistenceContext().getPropertyValue(CODE);
}
/**
* <i>Generated method</i> - Getter of the <code>AbstractDynamicContent.content</code> attribute defined at extension <code>core</code>.
* @return the content
*/
@Accessor(qualifier = "content", type = Accessor.Type.GETTER)
public String getContent()
{
return getPersistenceContext().getPropertyValue(CONTENT);
}
/**
* <i>Generated method</i> - Getter of the <code>AbstractDynamicContent.version</code> attribute defined at extension <code>core</code>.
* @return the version
*/
@Accessor(qualifier = "version", type = Accessor.Type.GETTER)
public Long getVersion()
{
return getPersistenceContext().getPropertyValue(VERSION);
}
/**
* <i>Generated method</i> - Initial setter of <code>AbstractDynamicContent.active</code> attribute defined at extension <code>core</code>. Can only be used at creation of model - before first save.
*
* @param value the active
*/
@Accessor(qualifier = "active", type = Accessor.Type.SETTER)
public void setActive(final Boolean value)
{
getPersistenceContext().setPropertyValue(ACTIVE, value);
}
/**
* <i>Generated method</i> - Setter of <code>AbstractDynamicContent.checksum</code> attribute defined at extension <code>core</code>.
*
* @param value the checksum
*/
@Accessor(qualifier = "checksum", type = Accessor.Type.SETTER)
public void setChecksum(final String value)
{
getPersistenceContext().setPropertyValue(CHECKSUM, value);
}
/**
* <i>Generated method</i> - Initial setter of <code>AbstractDynamicContent.code</code> attribute defined at extension <code>core</code>. Can only be used at creation of model - before first save.
*
* @param value the code
*/
@Accessor(qualifier = "code", type = Accessor.Type.SETTER)
public void setCode(final String value)
{
getPersistenceContext().setPropertyValue(CODE, value);
}
/**
* <i>Generated method</i> - Setter of <code>AbstractDynamicContent.content</code> attribute defined at extension <code>core</code>.
*
* @param value the content
*/
@Accessor(qualifier = "content", type = Accessor.Type.SETTER)
public void setContent(final String value)
{
getPersistenceContext().setPropertyValue(CONTENT, value);
}
/**
* <i>Generated method</i> - Setter of <code>AbstractDynamicContent.version</code> attribute defined at extension <code>core</code>.
*
* @param value the version
*/
@Accessor(qualifier = "version", type = Accessor.Type.SETTER)
public void setVersion(final Long value)
{
getPersistenceContext().setPropertyValue(VERSION, value);
}
}
| [
"juan.gonzalez.working@gmail.com"
] | juan.gonzalez.working@gmail.com |
b4e8acb8339cf6691c2c575fcd09dd87980ade91 | 245f4c11504dc9ab1fba7fb4711f3ce7d56bfe1d | /java/src/main/java/chouc/java/nio/TraditionalServer.java | bed9eb1da17d45c7e4d8c3f16186dd389a78c88b | [] | no_license | choucmei/learning | 58c00690f8b687e1d0370815f7a1a3c98b3bb4fe | 131f925bcefd5a2f247276e95f47de6391b1b5b6 | refs/heads/master | 2023-04-29T14:04:01.226143 | 2023-02-09T05:57:19 | 2023-02-09T05:57:19 | 200,195,543 | 3 | 1 | null | 2023-04-21T20:48:40 | 2019-08-02T08:19:53 | Java | UTF-8 | Java | false | false | 1,004 | java | package chouc.java.nio;
import java.io.DataInputStream;
import java.net.ServerSocket;
import java.net.Socket;
public class TraditionalServer {
@SuppressWarnings("resource")
public static void main(String args[]) throws Exception {
// 监听端口
ServerSocket server_socket = new ServerSocket(2000);
System.out.println("等待,端口为:" + server_socket.getLocalPort());
while (true) {
// 阻塞接受消息
Socket socket = server_socket.accept();
// 打印链接信息
System.out.println("新连接: " + socket.getInetAddress() + ":"
+ socket.getPort());
// 从socket中获取流
DataInputStream input = new DataInputStream(socket.getInputStream());
// 接收数据
byte[] byteArray = new byte[4096];
while (true) {
int nread = input.read(byteArray, 0, 4096);
System.out.println(new String(byteArray, "UTF-8"));
if (-1 == nread) {
break;
}
}
socket.close();
System.out.println("Connection closed by client");
}
}
}
| [
"chouc.mei@gmail.com"
] | chouc.mei@gmail.com |
c298cbeadbd17190dfe54f399f49211e068e53f6 | 13934ea3feb478b42257abcb7b5e969dbf965c34 | /app/src/main/java/net/zhongbenshuo/attendance/city/bean/CityInfoBean.java | fe432cf91ee8bbc16876b407baed34cc57beb3ee | [] | no_license | tkkhy/ZBSKaoQin | a730a5729942004946a1e0ee21c76ae9267f8d2d | 76c915eab9f8ffb897acd4eb5d0be162fcda85e6 | refs/heads/master | 2020-06-18T18:35:59.811842 | 2019-07-11T11:45:18 | 2019-07-11T11:45:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,303 | java | package net.zhongbenshuo.attendance.city.bean;
import android.os.Parcel;
import android.os.Parcelable;
import java.util.ArrayList;
import java.util.List;
/**
* 城市实体类
* Created at 2019/6/10 15:04
*
* @author LiYuliang
* @version 1.0
*/
public class CityInfoBean implements Parcelable {
private String id; /*110101*/
private String name; /*东城区*/
private ArrayList<CityInfoBean> cityList;
public ArrayList<CityInfoBean> getCityList() {
return cityList;
}
public void setCityList(ArrayList<CityInfoBean> cityList) {
this.cityList = cityList;
}
public CityInfoBean() {
}
public static CityInfoBean findCity(List<CityInfoBean> list, String cityName) {
try {
for (int i = 0; i < list.size(); i++) {
CityInfoBean city = list.get(i);
if (cityName.equals(city.getName()) /*|| cityName.contains(city.getName())
|| city.getName().contains(cityName)*/) {
return city;
}
}
}
catch (Exception e) {
return null;
}
return null;
}
public String getId() {
return id == null ? "" : id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name == null ? "" : name;
}
public void setName(String name) {
this.name = name;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(this.id);
dest.writeString(this.name);
dest.writeTypedList(this.cityList);
}
protected CityInfoBean(Parcel in) {
this.id = in.readString();
this.name = in.readString();
this.cityList = in.createTypedArrayList(CityInfoBean.CREATOR);
}
public static final Creator<CityInfoBean> CREATOR = new Creator<CityInfoBean>() {
@Override
public CityInfoBean createFromParcel(Parcel source) {
return new CityInfoBean(source);
}
@Override
public CityInfoBean[] newArray(int size) {
return new CityInfoBean[size];
}
};
}
| [
"liyuliang008@outlook.com"
] | liyuliang008@outlook.com |
7e6d3968384670dd07bd3db16170a4aa55a8a239 | 36bf98918aebe18c97381705bbd0998dd67e356f | /projects/aspectj-1.6.9/aspectjtools1.6.9/org/aspectj/ajde/ui/javaoptions/JavaDebugOptionsPanel.java | 92ee8878dac9500b790f841acd26ce4989f95bde | [] | no_license | ESSeRE-Lab/qualitas.class-corpus | cb9513f115f7d9a72410b3f5a72636d14e4853ea | 940f5f2cf0b3dc4bd159cbfd49d5c1ee4d06d213 | refs/heads/master | 2020-12-24T21:22:32.381385 | 2016-05-17T14:03:21 | 2016-05-17T14:03:21 | 59,008,169 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,099 | java | /********************************************************************
* Copyright (c) 2007 Contributors. All rights reserved.
* This program and the accompanying materials are made available
* under the terms of the Eclipse Public License v1.0
* which accompanies this distribution and is available at
* http://eclipse.org/legal/epl-v10.html
*
* Contributors: IBM Corporation - initial API and implementation
* Helen Hawkins - initial version (bug 148190)
*******************************************************************/
package org.aspectj.ajde.ui.javaoptions;
import java.awt.BorderLayout;
import java.awt.Color;
import java.io.IOException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.Map.Entry;
import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.Border;
import javax.swing.border.TitledBorder;
import org.aspectj.ajde.core.JavaOptions;
import org.aspectj.ajde.ui.swing.OptionsPanel;
/**
* An options panel which displays the java compiler debug options.
* Users should add this to the Ajde.getOptionsFrame()
*/
public class JavaDebugOptionsPanel extends OptionsPanel {
private final String[] debugOptions = new String[] {JavaOptions.GENERATE,JavaOptions.DO_NOT_GENERATE};
private final String[] preserveOptions = new String[] {JavaOptions.PRESERVE,JavaOptions.OPTIMIZE};
private static final long serialVersionUID = 4491319302490183151L;
private JPanel parentPanel;
private Border debugEtchedBorder;
private TitledBorder debugTitleBorder;
private Border debugCompoundBorder;
private JPanel debugPanel;
private Box debugBox = Box.createVerticalBox();
private JavaBuildOptions javaBuildOptions;
private Map/*String --> JComboBox*/ debugComboBoxes = new HashMap();
public JavaDebugOptionsPanel(JavaBuildOptions javaBuildOptions) {
this.javaBuildOptions = javaBuildOptions;
try {
jbInit();
this.setName("Java Debug Options");
} catch (Exception e) {
e.printStackTrace();
}
}
public void loadOptions() throws IOException {
createDebugContents();
}
public void saveOptions() throws IOException {
Set s = debugComboBoxes.entrySet();
for (Iterator iterator = s.iterator(); iterator.hasNext();) {
Map.Entry entry = (Entry) iterator.next();
String javaOption = (String) entry.getKey();
JComboBox combo = (JComboBox)entry.getValue();
String value = (String) combo.getSelectedItem();
javaBuildOptions.setOption(javaOption, value);
}
}
private void jbInit() throws Exception {
this.setLayout(new BorderLayout());
createBorders();
addBordersToPanel();
this.add(parentPanel,BorderLayout.NORTH);
}
private void createDebugContents() {
createDebugEntry("Add line number attributes to generated class files",JavaOptions.DEBUG_LINES);
createDebugEntry("Add source file name to generated class file",JavaOptions.DEBUG_SOURCE);
createDebugEntry("Add variable attributes to generated class files",JavaOptions.DEBUG_VARS);
createDebugEntry("Preserve unused (never read) local variables",JavaOptions.PRESERVE_ALL_LOCALS);
debugPanel.add(debugBox);
}
private void createDebugEntry(String labelText, String javaOptionToSet) {
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
JLabel label = new JLabel();
label.setFont(new java.awt.Font("Dialog", 0, 11));
label.setText(labelText);
panel.add(label,BorderLayout.WEST);
JComboBox debug = null;
if (javaOptionToSet.equals(JavaOptions.PRESERVE_ALL_LOCALS)) {
debug = new JComboBox(preserveOptions);
String value = (String) javaBuildOptions.getJavaBuildOptionsMap().get(javaOptionToSet);
if (value.equals(JavaOptions.PRESERVE)) {
debug.setSelectedIndex(0);
} else {
debug.setSelectedIndex(1);
}
} else {
debug = new JComboBox(debugOptions);
String value = (String) javaBuildOptions.getJavaBuildOptionsMap().get(javaOptionToSet);
if (value.equals(JavaOptions.GENERATE)) {
debug.setSelectedIndex(0);
} else {
debug.setSelectedIndex(1);
}
}
panel.add(debug,BorderLayout.EAST);
debugBox.add(panel,null);
debugComboBoxes.put(javaOptionToSet,debug);
}
private void createBorders() {
debugEtchedBorder = BorderFactory.createEtchedBorder(Color.white, new Color(156, 156, 158));
debugTitleBorder = new TitledBorder(debugEtchedBorder, "Debug Options");
debugCompoundBorder = BorderFactory.createCompoundBorder(debugTitleBorder,
BorderFactory.createEmptyBorder(5, 5, 5, 5));
debugTitleBorder.setTitleFont(new java.awt.Font("Dialog", 0, 11));
}
private void addBordersToPanel() {
parentPanel = new JPanel();
parentPanel.setLayout(new BorderLayout());
debugPanel = new JPanel();
debugPanel.setBorder(debugCompoundBorder);
parentPanel.add(debugPanel,BorderLayout.CENTER);
}
}
| [
"marco.zanoni@disco.unimib.it"
] | marco.zanoni@disco.unimib.it |
7682b3cd3956c78838c209d8d769ffda779e71e1 | 9a52fe3bcdd090a396e59c68c63130f32c54a7a8 | /sources/com/google/android/gms/internal/ads/zzctg.java | 8c629744011afab9ee109ca38e88e067eec14a52 | [] | no_license | mzkh/LudoKing | 19d7c76a298ee5bd1454736063bc392e103a8203 | ee0d0e75ed9fa8894ed9877576d8e5589813b1ba | refs/heads/master | 2022-04-25T06:08:41.916017 | 2020-04-14T17:00:45 | 2020-04-14T17:00:45 | 255,670,636 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 654 | java | package com.google.android.gms.internal.ads;
import android.text.TextUtils;
import java.util.List;
import org.json.JSONException;
import org.json.JSONObject;
/* compiled from: com.google.android.gms:play-services-ads@@18.2.0 */
public final class zzctg implements zzcrr<JSONObject> {
private List<String> zzdjf;
public zzctg(List<String> list) {
this.zzdjf = list;
}
public final /* synthetic */ void zzr(Object obj) {
try {
((JSONObject) obj).put("eid", TextUtils.join(",", this.zzdjf));
} catch (JSONException unused) {
zzaug.zzdy("Failed putting experiment ids.");
}
}
}
| [
"mdkhnmm@amazon.com"
] | mdkhnmm@amazon.com |
abbde3365207d8cec6e85642088f2e1fcb4b0145 | 45736204805554b2d13f1805e47eb369a8e16ec3 | /net/minecraft/world/gen/layer/GenLayerEdge.java | c4657492854b380bdbd4dad88fd5919a57cf4cf8 | [] | no_license | KrOySi/ArchWare-Source | 9afc6bfcb1d642d2da97604ddfed8048667e81fd | 46cdf10af07341b26bfa704886299d80296320c2 | refs/heads/main | 2022-07-30T02:54:33.192997 | 2021-08-08T23:36:39 | 2021-08-08T23:36:39 | 394,089,144 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,245 | java | /*
* Decompiled with CFR 0.150.
*/
package net.minecraft.world.gen.layer;
import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.IntCache;
public class GenLayerEdge
extends GenLayer {
private final Mode mode;
public GenLayerEdge(long p_i45474_1_, GenLayer p_i45474_3_, Mode p_i45474_4_) {
super(p_i45474_1_);
this.parent = p_i45474_3_;
this.mode = p_i45474_4_;
}
@Override
public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) {
switch (this.mode) {
default: {
return this.getIntsCoolWarm(areaX, areaY, areaWidth, areaHeight);
}
case HEAT_ICE: {
return this.getIntsHeatIce(areaX, areaY, areaWidth, areaHeight);
}
case SPECIAL:
}
return this.getIntsSpecial(areaX, areaY, areaWidth, areaHeight);
}
private int[] getIntsCoolWarm(int p_151626_1_, int p_151626_2_, int p_151626_3_, int p_151626_4_) {
int i = p_151626_1_ - 1;
int j = p_151626_2_ - 1;
int k = 1 + p_151626_3_ + 1;
int l = 1 + p_151626_4_ + 1;
int[] aint = this.parent.getInts(i, j, k, l);
int[] aint1 = IntCache.getIntCache(p_151626_3_ * p_151626_4_);
for (int i1 = 0; i1 < p_151626_4_; ++i1) {
for (int j1 = 0; j1 < p_151626_3_; ++j1) {
this.initChunkSeed(j1 + p_151626_1_, i1 + p_151626_2_);
int k1 = aint[j1 + 1 + (i1 + 1) * k];
if (k1 == 1) {
boolean flag1;
int l1 = aint[j1 + 1 + (i1 + 1 - 1) * k];
int i2 = aint[j1 + 1 + 1 + (i1 + 1) * k];
int j2 = aint[j1 + 1 - 1 + (i1 + 1) * k];
int k2 = aint[j1 + 1 + (i1 + 1 + 1) * k];
boolean flag = l1 == 3 || i2 == 3 || j2 == 3 || k2 == 3;
boolean bl = flag1 = l1 == 4 || i2 == 4 || j2 == 4 || k2 == 4;
if (flag || flag1) {
k1 = 2;
}
}
aint1[j1 + i1 * p_151626_3_] = k1;
}
}
return aint1;
}
private int[] getIntsHeatIce(int p_151624_1_, int p_151624_2_, int p_151624_3_, int p_151624_4_) {
int i = p_151624_1_ - 1;
int j = p_151624_2_ - 1;
int k = 1 + p_151624_3_ + 1;
int l = 1 + p_151624_4_ + 1;
int[] aint = this.parent.getInts(i, j, k, l);
int[] aint1 = IntCache.getIntCache(p_151624_3_ * p_151624_4_);
for (int i1 = 0; i1 < p_151624_4_; ++i1) {
for (int j1 = 0; j1 < p_151624_3_; ++j1) {
int k1 = aint[j1 + 1 + (i1 + 1) * k];
if (k1 == 4) {
boolean flag1;
int l1 = aint[j1 + 1 + (i1 + 1 - 1) * k];
int i2 = aint[j1 + 1 + 1 + (i1 + 1) * k];
int j2 = aint[j1 + 1 - 1 + (i1 + 1) * k];
int k2 = aint[j1 + 1 + (i1 + 1 + 1) * k];
boolean flag = l1 == 2 || i2 == 2 || j2 == 2 || k2 == 2;
boolean bl = flag1 = l1 == 1 || i2 == 1 || j2 == 1 || k2 == 1;
if (flag1 || flag) {
k1 = 3;
}
}
aint1[j1 + i1 * p_151624_3_] = k1;
}
}
return aint1;
}
private int[] getIntsSpecial(int p_151625_1_, int p_151625_2_, int p_151625_3_, int p_151625_4_) {
int[] aint = this.parent.getInts(p_151625_1_, p_151625_2_, p_151625_3_, p_151625_4_);
int[] aint1 = IntCache.getIntCache(p_151625_3_ * p_151625_4_);
for (int i = 0; i < p_151625_4_; ++i) {
for (int j = 0; j < p_151625_3_; ++j) {
this.initChunkSeed(j + p_151625_1_, i + p_151625_2_);
int k = aint[j + i * p_151625_3_];
if (k != 0 && this.nextInt(13) == 0) {
k |= 1 + this.nextInt(15) << 8 & 0xF00;
}
aint1[j + i * p_151625_3_] = k;
}
}
return aint1;
}
public static enum Mode {
COOL_WARM,
HEAT_ICE,
SPECIAL;
}
}
| [
"67242784+KrOySi@users.noreply.github.com"
] | 67242784+KrOySi@users.noreply.github.com |
ee74b4eed4c370973af6936abffce4f1cb655c8b | c0071d8e003177fac32f5ba6b85eb31c7096bbda | /dvdrental/src/main/java/com/fastcode/dvdrental/domain/extended/customer/ICustomerRepositoryExtended.java | 2a78bead633ac1aead14f9b07ccc52f9d5f2712a | [] | no_license | fastcoderepos/dbolshov-sampleApplication1 | a5b34a88830b1b536362dd93cc7568e5b0c9d12f | 6fb494e6febaeb42e3defb26c9cd8d7e5d4643d9 | refs/heads/master | 2023-03-06T01:43:19.991927 | 2021-02-22T14:30:52 | 2021-02-22T14:30:52 | 341,228,269 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 422 | java | package com.fastcode.dvdrental.domain.extended.customer;
import com.fastcode.dvdrental.domain.core.customer.ICustomerRepository;
import org.javers.spring.annotation.JaversSpringDataAuditable;
import org.springframework.stereotype.Repository;
@JaversSpringDataAuditable
@Repository("customerRepositoryExtended")
public interface ICustomerRepositoryExtended extends ICustomerRepository {
//Add your custom code here
}
| [
"info@nfinityllc.com"
] | info@nfinityllc.com |
60967a7e06532765e98dfc271464937b6019b9b3 | a5c2a9365ff9075b35bf720647ffe025d30262f5 | /xor/vecmat/vec/b/BVec3.java | 6a6ea9956315d98d49e2653def593b1538ee959a | [] | no_license | XOR19/VecMat | df08f28ac4f0a1dca38589350de5b2979097d212 | d38f57697d9ac4ced877d75aa6310e45db7bd043 | refs/heads/master | 2020-06-03T05:51:05.321589 | 2015-05-14T08:46:10 | 2015-05-14T08:46:10 | 35,500,034 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,172 | java | package xor.vecmat.vec.b;
import xor.vecmat.COMP_OPS.Func1_B;
import xor.vecmat.COMP_OPS.Func2_B;
import xor.vecmat.COMP_OPS.Func3_B;
public abstract class BVec3 extends BVec<BVec3> {
public abstract boolean x();
public abstract boolean y();
public abstract boolean z();
public abstract void x(boolean x);
public abstract void y(boolean y);
public abstract void z(boolean y);
@Override
public int dim() {
return 3;
}
@Override
public boolean get(int i) {
switch (i) {
case 0:
return x();
case 1:
return y();
case 2:
return z();
}
throw new IndexOutOfBoundsException();
}
@Override
public void set(int i, boolean v) {
switch (i) {
case 0:
x(v);
break;
case 1:
y(v);
break;
case 2:
z(v);
break;
default:
throw new IndexOutOfBoundsException();
}
}
@Override
public boolean get(char c) {
switch (c) {
case 'x':
case 'r':
case 's':
return x();
case 'y':
case 'g':
case 't':
return y();
case 'z':
case 'b':
case 'p':
return z();
}
throw new IndexOutOfBoundsException();
}
@Override
public void set(char c, boolean v) {
switch (c) {
case 'x':
case 'r':
case 's':
x(v);
break;
case 'y':
case 'g':
case 't':
y(v);
break;
case 'z':
case 'b':
case 'p':
z(v);
break;
default:
throw new IndexOutOfBoundsException();
}
}
@Override
public void setTo(BVec3 v) {
x(v.x());
y(v.y());
z(v.z());
}
public void setTo(boolean x, boolean y, boolean z) {
x(x);
y(y);
z(z);
}
@Override
public BVec3 or(boolean n) {
return new BRVec3(x() && n, y() && n, z() && n);
}
@Override
public BVec3 or(BVec3 v) {
return new BRVec3(x() && v.x(), y() && v.y(), z() && v.z());
}
public BVec3 or(boolean x, boolean y, boolean z) {
return new BRVec3(x() && x, y() && y, z() && z);
}
@Override
public BVec3 and(boolean n) {
return new BRVec3(x() || n, y() || n, z() || n);
}
@Override
public BVec3 and(BVec3 v) {
return new BRVec3(x() || v.x(), y() || v.y(), z() || v.z());
}
public BVec3 and(boolean x, boolean y, boolean z) {
return new BRVec3(x() || x, y() || y, z() || z);
}
@Override
public BVec3 xor(boolean n) {
return new BRVec3(x() != n, y() != n, z() != n);
}
@Override
public BVec3 xor(BVec3 v) {
return new BRVec3(x() != v.x(), y() != v.y(), z() != v.z());
}
public BVec3 xor(boolean x, boolean y, boolean z) {
return new BRVec3(x() != x, y() != y, z() != z);
}
@Override
public BVec3 clone() {
return new BRVec3(x(), y(), z());
}
@Override
protected BVec3 _new() {
return new BRVec3(false, false, false);
}
@Override
public String toString() {
return "[" + x() + ", " + y() + ", " + z() + "]";
}
@Override
public BVec3 equals(BVec3 other) {
return BVec3(x() == other.x(), y() == other.y(), z() == other.z());
}
@Override
public BVec3 notEqual(BVec3 other) {
return BVec3(x() != other.x(), y() != other.y(), z() != other.z());
}
@Override
protected BVec3 forEach(Func1_B f) {
boolean x = f.calc(x());
boolean y = f.calc(y());
boolean z = f.calc(z());
return new BRVec3(x, y, z);
}
@Override
protected BVec3 forEach(BVec3 v, Func2_B f) {
boolean x = f.calc(x(), v.x());
boolean y = f.calc(y(), v.y());
boolean z = f.calc(z(), v.z());
return new BRVec3(x, y, z);
}
@Override
protected BVec3 forEach(boolean n, Func2_B f) {
boolean x = f.calc(x(), n);
boolean y = f.calc(y(), n);
boolean z = f.calc(z(), n);
return new BRVec3(x, y, z);
}
@Override
protected BVec3 forEach(BVec3 v2, BVec3 v3, Func3_B f) {
boolean x = f.calc(x(), v2.x(), v3.x());
boolean y = f.calc(y(), v2.y(), v3.y());
boolean z = f.calc(z(), v2.z(), v3.z());
return new BRVec3(x, y, z);
}
@Override
protected BVec3 forEach(BVec3 v, boolean n, Func3_B f) {
boolean x = f.calc(x(), v.x(), n);
boolean y = f.calc(y(), v.y(), n);
boolean z = f.calc(z(), v.z(), n);
return new BRVec3(x, y, z);
}
@Override
protected BVec3 forEach(boolean n1, boolean n2, Func3_B f) {
boolean x = f.calc(x(), n1, n2);
boolean y = f.calc(y(), n1, n2);
boolean z = f.calc(z(), n1, n2);
return new BRVec3(x, y, z);
}
}
| [
"nils.h.emmerich@gmail.com"
] | nils.h.emmerich@gmail.com |
6ae637d37ab1c5a461abeae6355bbae526609d1b | f77d04f1e0f64a6a5e720ce24b65b1ccb3c546d2 | /zyj-hec-master/zyj-hec/src/main/java/com/hand/hec/bpm/service/IJsEngineService.java | b1caeee521651a8ba9efdf2cec9ea81e809294f0 | [] | no_license | floodboad/zyj-hssp | 3139a4e73ec599730a67360cd04aa34bc9eaf611 | dc0ef445935fa48b7a6e86522ec64da0042dc0f3 | refs/heads/master | 2023-05-27T21:28:01.290266 | 2020-01-03T06:21:59 | 2020-01-03T06:29:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,957 | java | package com.hand.hec.bpm.service;
import com.hand.hap.core.IRequest;
import com.hand.hec.bpm.dto.*;
import uncertain.composite.CompositeMap;
import java.util.List;
public interface IJsEngineService {
List<PageButton> queryPageButton(IRequest request, Long pageId);
List<PageLayoutBasic> queryPageLayoutBasic(IRequest request, Long pageId);
List<PageLayoutForm> queryPageLayoutForm(IRequest request, Long layoutId);
List<PageLayoutGrid> queryPageLayoutGrid(IRequest request, Long layoutId);
List<PageLayoutTab> queryPageLayoutTab(IRequest request, Long layoutId);
List<PageLayoutEvent> queryPageLayoutEvent(IRequest request, Long layoutId);
List<PageLayoutButton> queryPageLayoutButton(IRequest request, Long layoutId);
List<PageTagBasic> queryPageTagBasic(IRequest request, Long layoutId);
List<PageTagCheckbox> queryPageTagCheckbox(IRequest request, Long tagId);
List<PageTagCombobox> queryPageTagCombobox(IRequest request, Long tagId);
List<PageTagComboboxMap> queryPageTagComboboxMap(IRequest request, Long tagId);
List<PageTagDatepicker> queryPageTagDatepicker(IRequest request, Long tagId);
List<PageTagDatetimepicker> queryPageTagDatetimepicker(IRequest request, Long tagId);
List<PageTagLabel> queryPageTagLabel(IRequest request, Long tagId);
List<PageTagLov> queryPageTagLov(IRequest request, Long tagId);
List<PageTagLovMap> queryPageTagLovMap(IRequest request, Long tagId);
List<PageTagNumberfield> queryPageTagNumberfield(IRequest request, Long tagId);
List<PageTagRadio> queryPageTagRadio(IRequest request, Long tagId);
List<PageTagTextfield> queryPageTagTextfield(IRequest request, Long tagId);
List<PageTagEvent> queryPageTagEvent(IRequest request, Long tagId);
String getLovDefaultvalue(IRequest request, CompositeMap context, String lovStr);
String getJavaDefaultvalue(IRequest request, CompositeMap context, String javaStr);
}
| [
"1961187382@qq.com"
] | 1961187382@qq.com |
73059cc0d59367d21eaa46bb010d88cdb15e91c2 | 2d6ec0b3027893d2eeed6cf3055ee467a024b534 | /src/main/groovy/com/scarlatti/rxswing/ReactComponentTraits.java | dd28f5527915d6f6c02be4781dbf30a034f16002 | [] | no_license | alessandroscarlatti/react-swing | c6338787b1b6af9ede08f9650a9211af42cce19d | 421ce1887cf91c732ae3ddf3c41d0ed37bce6177 | refs/heads/master | 2021-04-12T10:15:38.977551 | 2018-03-24T05:28:44 | 2018-03-24T05:28:44 | 126,542,503 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 983 | java | package com.scarlatti.rxswing;
import java.util.ArrayList;
import java.util.List;
/**
* ______ __ __ ____ __ __ __ _
* ___/ _ | / /__ ___ ___ ___ ____ ___/ /______ / __/______ _____/ /__ _/ /_/ /_(_)
* __/ __ |/ / -_|_-<(_-</ _ `/ _ \/ _ / __/ _ \ _\ \/ __/ _ `/ __/ / _ `/ __/ __/ /
* /_/ |_/_/\__/___/___/\_,_/_//_/\_,_/_/ \___/ /___/\__/\_,_/_/ /_/\_,_/\__/\__/_/
* Friday, 3/23/2018
*/
public class ReactComponentTraits {
protected List<AbstractReactComponent> rxComponentChildren = new ArrayList<>();
/**
* reactId is a string key that identifies this logical component
* instance to React from one render to another.
*
* The id is essentially a "fully-qualified" path name, where each
* piece of the path is a class name and an index.
*
* For example "/com.scarlatti.rxswing.RxJPanel(0)/com.scarlatti.rxswing.RxJButton(0)"
*/
protected String reactId;
}
| [
"violanotesnoextras@gmail.com"
] | violanotesnoextras@gmail.com |
ef6fbb0f7cbf6a043e67029c17c6fed118105c9e | e6fa3964d7f41ae579cb1c93546e4a76c30cd914 | /taobao-sdk-java-auto_1479188381469-20210114-source/DingTalk/com/dingtalk/api/request/OapiRhinoMosExecTrackEntityconditionListRequest.java | 61e1cc77fd73ace7c1eb7e49a07efead8501f92a | [] | no_license | devops-utils/dingtalk-sdk-java | 14c4eb565dc605e6a7469ea0a00416567278846d | 6381d0a22fdc948cba20fa0fc88c5818742177b7 | refs/heads/master | 2023-02-17T04:46:14.429121 | 2021-01-14T03:41:39 | 2021-01-14T03:41:39 | 329,497,955 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,699 | java | package com.dingtalk.api.request;
import java.util.List;
import com.taobao.api.internal.mapping.ApiField;
import com.taobao.api.internal.mapping.ApiListField;
import com.taobao.api.TaobaoObject;
import java.util.Map;
import java.util.List;
import com.taobao.api.ApiRuleException;
import com.taobao.api.BaseTaobaoRequest;
import com.dingtalk.api.DingTalkConstants;
import com.taobao.api.Constants;
import com.taobao.api.internal.util.TaobaoHashMap;
import com.taobao.api.internal.util.TaobaoUtils;
import com.taobao.api.internal.util.json.JSONWriter;
import com.dingtalk.api.response.OapiRhinoMosExecTrackEntityconditionListResponse;
/**
* TOP DingTalk-API: dingtalk.oapi.rhino.mos.exec.track.entitycondition.list request
*
* @author top auto create
* @since 1.0, 2020.04.20
*/
public class OapiRhinoMosExecTrackEntityconditionListRequest extends BaseTaobaoRequest<OapiRhinoMosExecTrackEntityconditionListResponse> {
/**
* 入参
*/
private String req;
public void setReq(String req) {
this.req = req;
}
public void setReq(ListTrackRecordWithTrackIdsReq req) {
this.req = new JSONWriter(false,false,true).write(req);
}
public String getReq() {
return this.req;
}
public String getApiMethodName() {
return "dingtalk.oapi.rhino.mos.exec.track.entitycondition.list";
}
private String topResponseType = Constants.RESPONSE_TYPE_DINGTALK_OAPI;
public String getTopResponseType() {
return this.topResponseType;
}
public void setTopResponseType(String topResponseType) {
this.topResponseType = topResponseType;
}
public String getTopApiCallType() {
return DingTalkConstants.CALL_TYPE_OAPI;
}
private String topHttpMethod = DingTalkConstants.HTTP_METHOD_POST;
public String getTopHttpMethod() {
return this.topHttpMethod;
}
public void setTopHttpMethod(String topHttpMethod) {
this.topHttpMethod = topHttpMethod;
}
public void setHttpMethod(String httpMethod) {
this.setTopHttpMethod(httpMethod);
}
public Map<String, String> getTextParams() {
TaobaoHashMap txtParams = new TaobaoHashMap();
txtParams.put("req", this.req);
if(this.udfParams != null) {
txtParams.putAll(this.udfParams);
}
return txtParams;
}
public Class<OapiRhinoMosExecTrackEntityconditionListResponse> getResponseClass() {
return OapiRhinoMosExecTrackEntityconditionListResponse.class;
}
public void check() throws ApiRuleException {
}
/**
* 分页
*
* @author top auto create
* @since 1.0, null
*/
public static class Page extends TaobaoObject {
private static final long serialVersionUID = 6641994594449976773L;
/**
* 每页大小
*/
@ApiField("page_size")
private Long pageSize;
/**
* 起始位置
*/
@ApiField("start")
private Long start;
public Long getPageSize() {
return this.pageSize;
}
public void setPageSize(Long pageSize) {
this.pageSize = pageSize;
}
public Long getStart() {
return this.start;
}
public void setStart(Long start) {
this.start = start;
}
}
/**
* 入参
*
* @author top auto create
* @since 1.0, null
*/
public static class ListTrackRecordWithTrackIdsReq extends TaobaoObject {
private static final long serialVersionUID = 4651988477627212437L;
/**
* 实体ID列表
*/
@ApiListField("entity_ids")
@ApiField("number")
private List<Long> entityIds;
/**
* 实体类型
*/
@ApiField("entity_type")
private String entityType;
/**
* 分页
*/
@ApiField("page")
private Page page;
/**
* 租户ID
*/
@ApiField("tenant_id")
private String tenantId;
/**
* 追踪类型
*/
@ApiListField("track_types")
@ApiField("string")
private List<String> trackTypes;
/**
* 预留参数
*/
@ApiField("userid")
private String userid;
public List<Long> getEntityIds() {
return this.entityIds;
}
public void setEntityIds(List<Long> entityIds) {
this.entityIds = entityIds;
}
public String getEntityType() {
return this.entityType;
}
public void setEntityType(String entityType) {
this.entityType = entityType;
}
public Page getPage() {
return this.page;
}
public void setPage(Page page) {
this.page = page;
}
public String getTenantId() {
return this.tenantId;
}
public void setTenantId(String tenantId) {
this.tenantId = tenantId;
}
public List<String> getTrackTypes() {
return this.trackTypes;
}
public void setTrackTypes(List<String> trackTypes) {
this.trackTypes = trackTypes;
}
public String getUserid() {
return this.userid;
}
public void setUserid(String userid) {
this.userid = userid;
}
}
} | [
"zhangchunsheng423@gmail.com"
] | zhangchunsheng423@gmail.com |
f8af5f205193a13b26b0cfa274118cc3746f6f1b | ae2b751d92f068b434af6a26b781b64fa23da681 | /codeplay-design-pattern/src/main/java/com/tazine/design/decorator/lol/Skill_A.java | 85f9c3e7fce21e7505ad97da0984a76d0225f97c | [
"MIT"
] | permissive | BookFrank/CodePlay | 427453903eeb97c4e9878aacc9bbf3ce9a620e93 | d2379d9b585003d09c74a526fde22d30521e16ab | refs/heads/master | 2022-12-21T14:31:27.039552 | 2020-03-08T15:20:38 | 2020-03-08T15:20:38 | 106,928,881 | 1 | 1 | MIT | 2022-12-16T12:07:22 | 2017-10-14T13:12:47 | Java | UTF-8 | Java | false | false | 437 | java | package com.tazine.design.decorator.lol;
/**
* ConcreteDecorator: SkillA
*
* @author frank
* @since 1.0.0
*/
public class Skill_A extends Skills {
public Skill_A(Hero hero) {
super(hero);
}
@Override
public void learnSkill() {
skillA();
super.learnSkill();
}
private void skillA() {
System.out.println("技能升至2级,学会" + Skill_A.class.getSimpleName());
}
}
| [
"bookfrank@foxmail.com"
] | bookfrank@foxmail.com |
6f275cc79de5f4d7467c31e9d9f6a9912c45db06 | 1926622517fc5b5846d3da5e68b78db9aeb2a628 | /src/leagueutils/Constants.java | d7bc451b4ad094e14955e057e567354962d03133 | [] | no_license | gnmmarechal/LeagueUtils | 1be7d9dacc014dfc8fa207d226b4c5d779661bd2 | ae7da867e9cf0f5dc2e7f5dae7555ee3cc2faa74 | refs/heads/master | 2020-07-03T18:52:18.514327 | 2019-08-30T14:42:18 | 2019-08-30T14:42:18 | 202,011,103 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 992 | java | package leagueutils;
import java.io.IOException;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import javax.swing.LookAndFeel;
public class Constants {
public final static String apiKey = getApiKey("key.txt");
//public static LookAndFeel uiLookAndFeel = new com.jtattoo.plaf.noire.NoireLookAndFeel();
public static LookAndFeel uiLookAndFeel = getSyntheticaDarkUiLookAndFeel();
public static LookAndFeel getSyntheticaDarkUiLookAndFeel()
{
try
{
return new de.javasoft.synthetica.dark.SyntheticaDarkLookAndFeel();
} catch (Exception e)
{
}
return new javax.swing.plaf.metal.MetalLookAndFeel();
}
public static String getApiKey(String fileName)
{
List<String> strList = null;
try {
strList = Files.readAllLines(Paths.get(fileName));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return strList.get(0);
}
}
| [
"mliberato@gs2012.xyz"
] | mliberato@gs2012.xyz |
623e9dec050050feecb67fe09d6bea87c5ec4016 | 1d676636493e907bc9885aeacc47f674059bdc76 | /gradle-core/src/main/java/com/android/build/gradle/internal/ProductFlavorCombo.java | 6c06942a5e6647656fbff704f35a15d923f26e16 | [
"Apache-2.0"
] | permissive | huafresh/studio-3.0-build-system | f895d05426936f833b3eefe18599c3dc6717915d | 42eb79bb520bf1fa428426ef31575b450eb1255d | refs/heads/master | 2023-04-01T09:13:42.953418 | 2021-04-09T08:49:35 | 2021-04-09T08:49:35 | 356,198,659 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,613 | java | /*
* Copyright (C) 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.build.gradle.internal;
import com.android.annotations.NonNull;
import com.android.annotations.Nullable;
import com.android.builder.model.DimensionAware;
import com.android.builder.model.ProductFlavor;
import com.android.utils.StringHelper;
import com.google.common.base.Predicates;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
import com.google.common.collect.ListMultimap;
import com.google.common.collect.Lists;
import java.util.List;
import java.util.stream.Collectors;
import org.gradle.api.Named;
/**
* A combination of product flavors for a variant, each belonging to a different flavor dimension.
*/
public class ProductFlavorCombo<T extends DimensionAware & Named> {
private String name;
@NonNull
private final List<T> flavorList;
/**
* Create a ProductFlavorCombo.
* @param flavors Lists of ProductFlavor.
*/
public ProductFlavorCombo(@NonNull T... flavors) {
flavorList = ImmutableList.copyOf(flavors);
}
public ProductFlavorCombo(@NonNull Iterable<T> flavors) {
flavorList = ImmutableList.copyOf(flavors);
}
@NonNull
public String getName() {
if (name == null) {
boolean first = true;
StringBuilder sb = new StringBuilder();
for (T flavor : flavorList) {
if (first) {
sb.append(flavor.getName());
first = false;
} else {
sb.append(StringHelper.capitalize(flavor.getName()));
}
}
name = sb.toString();
}
return name;
}
@NonNull
public List<T> getFlavorList() {
return flavorList;
}
/**
* Return the name of the combined list of flavors.
*/
@NonNull
public static String getFlavorComboName(List<? extends Named> flavorList) {
return StringHelper.combineAsCamelCase(
flavorList.stream()
.map(namedObject -> namedObject.getName())
.collect(Collectors.toList()));
}
/**
* Creates a list containing all combinations of ProductFlavors of the given dimensions.
* @param flavorDimensions The dimensions each product flavor can belong to.
* @param productFlavors An iterable of all ProductFlavors in the project..
* @return A list of ProductFlavorCombo representing all combinations of ProductFlavors.
*/
@NonNull
public static <S extends DimensionAware & Named> List<ProductFlavorCombo<S>> createCombinations(
@Nullable List<String> flavorDimensions,
@NonNull Iterable<S> productFlavors) {
List <ProductFlavorCombo<S>> result = Lists.newArrayList();
if (flavorDimensions == null || flavorDimensions.isEmpty()) {
for (S flavor : productFlavors) {
result.add(new ProductFlavorCombo<>(ImmutableList.of(flavor)));
}
} else {
// need to group the flavor per dimension.
// First a map of dimension -> list(ProductFlavor)
ArrayListMultimap<String, S> map = ArrayListMultimap.create();
for (S flavor : productFlavors) {
String flavorDimension = flavor.getDimension();
if (flavorDimension == null) {
throw new RuntimeException(String.format(
"Flavor '%1$s' has no flavor dimension.", flavor.getName()));
}
if (!flavorDimensions.contains(flavorDimension)) {
throw new RuntimeException(String.format(
"Flavor '%1$s' has unknown dimension '%2$s'.",
flavor.getName(), flavor.getDimension()));
}
map.put(flavorDimension, flavor);
}
createProductFlavorCombinations(result,
Lists.<S>newArrayListWithCapacity(flavorDimensions.size()),
0, flavorDimensions, map);
}
return result;
}
/**
* Remove all null reference from an array and create an ImmutableList it.
*/
private static ImmutableList<ProductFlavor> filterNullFromArray(ProductFlavor[] flavors) {
ImmutableList.Builder<ProductFlavor> builder = ImmutableList.builder();
for (ProductFlavor flavor : flavors) {
if (flavor != null) {
builder.add(flavor);
}
}
return builder.build();
}
private static <S extends DimensionAware & Named> void createProductFlavorCombinations(
List<ProductFlavorCombo<S>> flavorGroups,
List<S> group,
int index,
List<String> flavorDimensionList,
ListMultimap<String, S> map) {
if (index == flavorDimensionList.size()) {
flavorGroups.add(new ProductFlavorCombo<>(Iterables.filter(group, Predicates.notNull())));
return;
}
// fill the array at the current index.
// get the dimension name that matches the index we are filling.
String dimension = flavorDimensionList.get(index);
// from our map, get all the possible flavors in that dimension.
List<S> flavorList = map.get(dimension);
// loop on all the flavors to add them to the current index and recursively fill the next
// indices.
if (flavorList.isEmpty()) {
throw new RuntimeException(String.format(
"No flavor is associated with flavor dimension '%1$s'.", dimension));
} else {
for (S flavor : flavorList) {
group.add(flavor);
createProductFlavorCombinations(
flavorGroups, group, index + 1, flavorDimensionList, map);
group.remove(group.size() - 1);
}
}
}
}
| [
"clydeazhang@tencent.com"
] | clydeazhang@tencent.com |
a8939d995308e7f6eb7aff42d115b6f7beefd476 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/19/19_9431a550ea11d481bb74ff8a35214533030029e8/WindowUtil/19_9431a550ea11d481bb74ff8a35214533030029e8_WindowUtil_s.java | e27fb79c1f23d5ee1356edf0e69559d94da8148e | [] | 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 | 5,302 | java | /******************************************************************************
* Copyright (c) 2002, 2003 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
****************************************************************************/
package org.eclipse.gmf.runtime.common.ui.util;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.gmf.runtime.common.core.util.Log;
import org.eclipse.gmf.runtime.common.core.util.Trace;
import org.eclipse.gmf.runtime.common.ui.internal.CommonUIDebugOptions;
import org.eclipse.gmf.runtime.common.ui.internal.CommonUIPlugin;
import org.eclipse.gmf.runtime.common.ui.internal.CommonUIStatusCodes;
/**
* Utilities for windows.
* There is one utility method here to center the dialog relative to its parent.
*
* There are also several utility methods that can be used on controls in a
* window.
*
* @author wdiu, Wayne Diu
*/
public class WindowUtil {
/**
* Center the dialog relative to a parent window.
* @param dialogShell contains the dialog to center
* @param parentShell contains the window to center relative to
*/
public static void centerDialog(Shell dialogShell, Shell parentShell) {
try {
Point dialogSize = dialogShell.getSize();
//don't use Display and then get shell from there, since
//we are trying to find the shell of the whole Eclipse window
Point windowLocation = parentShell.getLocation();
Point windowSize = parentShell.getSize();
//do not take the absolute value.
dialogShell.setLocation(
((windowSize.x - dialogSize.x) / 2) + windowLocation.x,
((windowSize.y - dialogSize.y) / 2) + windowLocation.y);
} catch (Exception e) {
//any exception when centering a dialog may be ignored
Trace.catching(CommonUIPlugin.getDefault(), CommonUIDebugOptions.EXCEPTIONS_CATCHING, WindowUtil.class, "Failed to center dialog", e); //$NON-NLS-1$
Log.error(CommonUIPlugin.getDefault(), CommonUIStatusCodes.GENERAL_UI_FAILURE, "Failed to center dialog", e); //$NON-NLS-1$
}
}
/**
* Dispose a parent's children
*
* @param parent composite containing children to be disposed.
*/
public static void disposeChildren(Composite parent) {
Control[] children = parent.getChildren();
for (int i = 0; i < children.length; i++) {
children[i].dispose();
}
}
/**
* Returns height and width data in a GridData for the button that was
* passed in. You can call button.setLayoutData with the returned
* data.
*
* @param button which has already been made. We'll be making the
* GridData for this button, so be sure that the text has already
* been set.
* @return GridData for this button with the suggested height and width
*/
public static GridData makeButtonData(Button button) {
GC gc = new GC(button);
gc.setFont(button.getFont());
GridData data = new GridData();
data.heightHint =
Dialog.convertVerticalDLUsToPixels(
gc.getFontMetrics(),
IDialogConstants.BUTTON_HEIGHT);
data.widthHint =
Math.max(
Dialog.convertHorizontalDLUsToPixels(
gc.getFontMetrics(),
IDialogConstants.BUTTON_WIDTH),
button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
gc.dispose();
return data;
}
/**
* Makes the GridData for a button to be a fixed size, regardless of
* the contents of the button
* @param button the button control that we'll make the GridData for.
* @return GridData the new GridData for the button control.
*/
public static GridData makeFixedButtonData(Button button) {
GC gc = new GC(button);
gc.setFont(button.getFont());
GridData gridData = new GridData();
gridData.widthHint =
Dialog.convertHorizontalDLUsToPixels(
gc.getFontMetrics(),
IDialogConstants.BUTTON_WIDTH);
gridData.heightHint =
Dialog.convertVerticalDLUsToPixels(
gc.getFontMetrics(),
IDialogConstants.BUTTON_HEIGHT);
gc.dispose();
return gridData;
}
/**
* Display a message box
* @param message the String message for the message box
* @param title the String title for the message box
* @param swtStyle the int style for the message box
* @param shell the Shell for the message box, such as Display.getActive().getShell()
*/
public static void doMessageBox(
String message,
String title,
int swtStyle,
Shell shell) {
MessageBox messageBox = new MessageBox(shell, swtStyle);
//stuff inside
messageBox.setMessage(message);
//title
messageBox.setText(title);
messageBox.open();
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
9c13aea750eaea86717ac2a8af1869428971c6ad | ecd31d3d2416c9421286967a53df30ccc3b10616 | /BoShi/src/com/boshi/action/anothercontent/ShowJuniorCollegeIntroduceSchoolBadgeAction.java | 1b09ddea98ec113604e8275660ea0b02fedaac09 | [] | no_license | squarlhan/ccstssh | 439f26b63628365b05c743f064c329231a1dd4d3 | 94daf2fdf79ee5f9e4560ffbb0fbc3c745bbab2e | refs/heads/master | 2020-05-18T03:27:11.499850 | 2017-05-10T07:14:34 | 2017-05-10T07:14:34 | 34,333,232 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,046 | java | package com.boshi.action.anothercontent;
import com.boshi.db.datamodel.anothercontent.JuniorCollegeIntroduceSchoolBadge;
public class ShowJuniorCollegeIntroduceSchoolBadgeAction extends SuperShowAnotherContentAction {
private static final long serialVersionUID = 1L;
private JuniorCollegeIntroduceSchoolBadge content = new JuniorCollegeIntroduceSchoolBadge();
public String execute() {
Object obj = super.show(JuniorCollegeIntroduceSchoolBadge.class, "JuniorCollegeIntroduceSchoolBadge");
if (obj != null) {
content = (JuniorCollegeIntroduceSchoolBadge) obj;
return SUCCESS;
}
return ERROR;
}
public String toChange() {
if (execute().equals(SUCCESS))
return "toChange";
return ERROR;
}
public String change() {
return super.change(JuniorCollegeIntroduceSchoolBadge.class, content);
}
public JuniorCollegeIntroduceSchoolBadge getContent() {
return content;
}
public void setContent(JuniorCollegeIntroduceSchoolBadge content) {
this.content = content;
}
}
| [
"squarlhan@52547bf6-66a5-11de-b8ef-473237edd27e"
] | squarlhan@52547bf6-66a5-11de-b8ef-473237edd27e |
e2a8c877473f1dae1f9bfa7024a7b6adddb111de | c6653e9228cf9ad2a83b71e7025a20c6cb4ea51e | /src/main/java/com/izdebski/entities/Employee.java | 383b0d8855bde3cd638207ed59c13574a9466b90 | [] | no_license | iizdebski/HibernateSavePersistSaveOrUpdate | 46382d25f4e9f7dc2bb3f31f83785a9c3648e0b8 | a7cc51eeb000d9f11d86bbe442152f5a88fba2f1 | refs/heads/master | 2020-04-22T11:32:37.927335 | 2019-02-12T15:45:12 | 2019-02-12T15:45:12 | 170,344,322 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,300 | java | package com.izdebski.entities;
import javax.persistence.*;
import java.util.Date;
@Entity
@Table(name="employee_table")
public class Employee {
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
@Column(name="employee_id")
private Integer employeeId;
@Column(name="employee_name", length = 100, nullable=false)
private String employeeName;
@Column(name="email", unique = true)
private String email;
@Column(name="date_of_joining")
private Date doj;
@Column(name="salary")
private Double salary;
public Integer getEmployeeId() {
return employeeId;
}
public void setEmployeeId(Integer employeeId) {
this.employeeId = employeeId;
}
public String getEmployeeName() {
return employeeName;
}
public void setEmployeeName(String employeeName) {
this.employeeName = employeeName;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public Date getDoj() {
return doj;
}
public void setDoj(Date doj) {
this.doj = doj;
}
public Double getSalary() {
return salary;
}
public void setSalary(Double salary) {
this.salary = salary;
}
} | [
"iizdepskyy112@gmail.com"
] | iizdepskyy112@gmail.com |
098cbada11d8c99e73b7c83e62061bfbf5ea3d8e | b718686e4feb0fb7579af268f2037c737a1ceb9a | /src/main/java/com/mossle/api/audit/AuditClient.java | 0b8c3411a3a39c7234bcba99ba019574a2fe0b31 | [
"Apache-2.0"
] | permissive | SuiteLHY/lemon | cc0ff01df0c16c3ffaebdf64ae4a7bf736e47dea | b2bfe0487adbc8cdd5042dab7e2a992c4bb36e53 | refs/heads/master | 2020-05-26T19:51:03.913796 | 2019-05-07T11:20:46 | 2019-05-07T11:20:46 | 188,353,423 | 1 | 0 | Apache-2.0 | 2019-05-24T04:42:42 | 2019-05-24T04:42:42 | null | UTF-8 | Java | false | false | 1,674 | java | package com.mossle.api.audit;
import java.net.InetAddress;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class AuditClient {
private ExecutorService executorService;
private String serverIp;
private String app = "vpn";
public void init() {
try {
serverIp = InetAddress.getLocalHost().getHostAddress();
} catch (Exception ex) {
ex.printStackTrace();
}
executorService = Executors.newFixedThreadPool(10);
}
public void close() {
executorService.shutdown();
}
public void log(String result, String username, String clientIp,
String description) {
AuditWorker auditWorker = new AuditWorker();
auditWorker.setApp(app);
auditWorker.setUsername(username);
auditWorker.setClientIp(clientIp);
auditWorker.setServerIp(serverIp);
auditWorker.setResult(result);
auditWorker.setDescription(description);
executorService.execute(auditWorker);
}
public void log(String result) {
try {
AuditDTO auditDto = AuditHolder.getAuditDto();
AuditWorker auditWorker = new AuditWorker();
auditWorker.setApp(app);
auditWorker.setUsername(auditDto.getUserId());
auditWorker.setClientIp(auditDto.getClient());
auditWorker.setServerIp(serverIp);
auditWorker.setResult(result);
auditWorker.setDescription(auditDto.getDescription());
executorService.execute(auditWorker);
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
| [
"xyz20003@gmail.com"
] | xyz20003@gmail.com |
449487c133ee2da0f1cd988bc095fa3fc167eccc | ee19c5b7a48f34b965040ce895dc1337bab1559a | /gwtcx/samples/sample-mgwt-basic-project/src/main/java/com/kiahu/sample/client/view/tablet/ui/SliderView.java | 12489630a0dbd75a7adf1bf9e8094f1746b99e7d | [] | no_license | hejunion/gwt-cx | 7895a9737ec22571a8e58685883a6563f9a25f00 | 2729985042b7c7d7ff41da4f2795b1ad291dbbce | refs/heads/master | 2020-04-22T18:26:38.854865 | 2015-05-22T16:07:44 | 2015-05-22T16:07:44 | 36,079,778 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,237 | java | /**
* (C) Copyright 2012 Kiahu
*
* Licensed under the terms of the GNU General Public License version 3
* as published by the Free Software Foundation. You may obtain a copy of the
* License at: http://www.gnu.org/copyleft/gpl.html
*
* 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.kiahu.sample.client.view.tablet.ui;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HTML;
import com.google.inject.Inject;
import com.googlecode.mgwt.ui.client.widget.MSlider;
import com.kiahu.sample.client.NameTokens;
import com.kiahu.sample.client.presenter.tablet.ui.SliderPresenter;
public class SliderView extends AbstractUiView implements SliderPresenter.MyView {
public MSlider mSlider;
public HTML valueField;
@Inject
public SliderView() {
super();
Log.debug("SliderView()");
}
@Override
protected void createAndBindUi() {
super.createAndBindUi();
Log.debug("createAndBindUi()");
FlowPanel content = new FlowPanel();
mSlider = new MSlider();
content.add(mSlider);
mSlider.setMax(10);
mSlider.getElement().getStyle().setMargin(20, Unit.PX);
valueField = new HTML("0");
valueField.getElement().setAttribute("style", "text-align: center; width: 280px;");
content.add(valueField);
scrollPanel.setWidget(content);
scrollPanel.setScrollingEnabledX(false);
scrollPanel.setScrollingEnabledY(false);
headerPanel.setCenter(NameTokens.slider);
}
@Override
protected void bindCustomUiHandlers() {
Log.debug("bindCustomUiHandlers()");
mSlider.addValueChangeHandler(new ValueChangeHandler<Integer>() {
@Override
public void onValueChange(ValueChangeEvent<Integer> event) {
valueField.setText("" + event.getValue());
}
});
}
} | [
"rob.ferguson@uptick.com.au@47729709-52d1-c6db-8006-95f89ab1258a"
] | rob.ferguson@uptick.com.au@47729709-52d1-c6db-8006-95f89ab1258a |
1f68d7cd441b574eb4fe1cd56a2fa92bbf5a5f1f | 7f298c2bf9ff5a61eeb87e3929e072c9a04c8832 | /spring-core/src/main/java/org/springframework/core/env/PropertySourcesPropertyResolver.java | 1f88036fccba9fcc3a3fbed72c66662da96a1be3 | [
"Apache-2.0"
] | permissive | stwen/my-spring5 | 1ca1e85786ba1b5fdb90a583444a9c030fe429dd | d44be68874b8152d32403fe87c39ae2a8bebac18 | refs/heads/master | 2023-02-17T19:51:32.686701 | 2021-01-15T05:39:14 | 2021-01-15T05:39:14 | 322,756,105 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,814 | java | /*
* Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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.springframework.core.env;
import org.springframework.lang.Nullable;
/**
* {@link PropertyResolver} implementation that resolves property values against
* an underlying set of {@link PropertySources}.
*
* @author Chris Beams
* @author Juergen Hoeller
* @see PropertySource
* @see PropertySources
* @see AbstractEnvironment
* @since 3.1
*/
public class PropertySourcesPropertyResolver extends AbstractPropertyResolver {
@Nullable
private final PropertySources propertySources;
/**
* Create a new resolver against the given property sources.
*
* @param propertySources the set of {@link PropertySource} objects to use
*/
public PropertySourcesPropertyResolver(@Nullable PropertySources propertySources) {
this.propertySources = propertySources;
}
@Override
public boolean containsProperty(String key) {
if (this.propertySources != null) {
for (PropertySource<?> propertySource : this.propertySources) {
if (propertySource.containsProperty(key)) {
return true;
}
}
}
return false;
}
@Override
@Nullable
public String getProperty(String key) {
return getProperty(key, String.class, true);
}
@Override
@Nullable
public <T> T getProperty(String key, Class<T> targetValueType) {
return getProperty(key, targetValueType, true);
}
@Override
@Nullable
protected String getPropertyAsRawString(String key) {
return getProperty(key, String.class, false);
}
@Nullable
protected <T> T getProperty(String key, Class<T> targetValueType, boolean resolveNestedPlaceholders) {
if (this.propertySources != null) {
for (PropertySource<?> propertySource : this.propertySources) {
if (logger.isTraceEnabled()) {
logger.trace("Searching for key '" + key + "' in PropertySource '" +
propertySource.getName() + "'");
}
Object value = propertySource.getProperty(key);
if (value != null) {
if (resolveNestedPlaceholders && value instanceof String) {
value = resolveNestedPlaceholders((String) value);
}
logKeyFound(key, propertySource, value);
return convertValueIfNecessary(value, targetValueType);
}
}
}
if (logger.isDebugEnabled()) {
logger.debug("Could not find key '" + key + "' in any property source");
}
return null;
}
/**
* Log the given key as found in the given {@link PropertySource}, resulting in
* the given value.
* <p>The default implementation writes a debug log message with key and source.
* As of 4.3.3, this does not log the value anymore in order to avoid accidental
* logging of sensitive settings. Subclasses may override this method to change
* the log level and/or log message, including the property's value if desired.
*
* @param key the key found
* @param propertySource the {@code PropertySource} that the key has been found in
* @param value the corresponding value
* @since 4.3.1
*/
protected void logKeyFound(String key, PropertySource<?> propertySource, Object value) {
if (logger.isDebugEnabled()) {
logger.debug("Found key '" + key + "' in PropertySource '" + propertySource.getName() +
"' with value of type " + value.getClass().getSimpleName());
}
}
}
| [
"xianhao_gan@qq.com"
] | xianhao_gan@qq.com |
d77df18ff32424b0796c3337fcf88565464c3963 | 92d43e59ae705d61d30c05752a81bc58ffc042eb | /bug-definitions/src/test/java/org/bugby/pattern/example/findbugs/CollectionRemoveAllCheck4.java | 0013ea94c17569f9859a484e73e3951c7d800909 | [] | no_license | bugby/bugby | e2f6fc447a5b7d40b5bb8bdbc0fb8d10d0496ff4 | 7a4619a9ff9b4c613c1357dda8e2a1005508f21d | refs/heads/master | 2021-01-23T19:13:25.509958 | 2016-03-24T16:23:26 | 2016-03-24T16:23:26 | 11,278,266 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 388 | java | package org.bugby.pattern.example.findbugs;
public class CollectionRemoveAllCheck4 {
public void removeAll(CollectionRemoveAllCheck4 x) {
}
public void myMethod() {
// t can also be field, variable, parameter etc .... so the initialization itself is not part of the match, only
// the type
CollectionRemoveAllCheck4 m = new CollectionRemoveAllCheck4();
m.removeAll(m);
}
}
| [
"ax.craciun@gmail.com"
] | ax.craciun@gmail.com |
76cbea37cf2ce62f0a57f6f870b39d994299dda6 | b10c789b2a620159ea554e66e0aaa782b3d4f445 | /src/main/java/net/avdw/adventofcode/year2018/Day18.java | 17bfbb9726a66746e6ea1f521e4a252dcae28f21 | [] | no_license | avanderw/advent-of-code | eefc34245f6b31737c52843a8f905c85fa3e4611 | 50cf3216859df54709e2a5c6b5eed1cb754fde21 | refs/heads/master | 2022-12-18T16:56:14.668362 | 2022-12-13T12:01:00 | 2022-12-13T12:01:00 | 160,197,305 | 0 | 0 | null | 2022-11-30T10:45:09 | 2018-12-03T13:43:29 | Java | UTF-8 | Java | false | false | 5,519 | java | package net.avdw.adventofcode.year2018;
import java.io.File;
import java.io.FileNotFoundException;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.*;
public class Day18 {
public static void main(String[] args) throws URISyntaxException, FileNotFoundException {
String test = ".#.#...|#.\n" +
".....#|##|\n" +
".|..|...#.\n" +
"..|#.....#\n" +
"#.#|||#|#|\n" +
"...#.||...\n" +
".|....|...\n" +
"||...#|.#|\n" +
"|.||||..|.\n" +
"...#.|..|.";
URL inputUrl = Day18.class.getResource("day18-input.txt");
Scanner scanner = new Scanner(new File(inputUrl.toURI()));
// Scanner scanner = new Scanner(test);
int height = 50;
int width = 50;
Character[][] map = new Character[height][width];
int y = 0;
while (scanner.hasNextLine()) {
String line = scanner.nextLine();
for (int x = 0; x < width; x++) {
map[y][x] = line.charAt(x);
}
y++;
}
List<Integer> calculations = new ArrayList<>();
int generations = 1_000;
for (int g = 0; g < generations; g++) {
int count1 = 0;
int count2 = 0;
for (y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
if (map[y][x] == '|') {
count1++;
} else if (map[y][x] == '#') {
count2++;
}
}
}
calculations.add(count1 * count2);
Character[][] iteration = new Character[height][width];
for (y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
int trees = 0;
int lumberyard = 0;
if (y - 1 >= 0 && x - 1 >= 0) {
trees += map[y - 1][x - 1] == '|' ? 1 : 0;
lumberyard += map[y - 1][x - 1] == '#' ? 1 : 0;
}
if (y - 1 >= 0 && x - 0 >= 0) {
trees += map[y - 1][x - 0] == '|' ? 1 : 0;
lumberyard += map[y - 1][x - 0] == '#' ? 1 : 0;
}
if (y - 1 >= 0 && x + 1 < width) {
trees += map[y - 1][x + 1] == '|' ? 1 : 0;
lumberyard += map[y - 1][x + 1] == '#' ? 1 : 0;
}
if (x - 1 >= 0) {
trees += map[y - 0][x - 1] == '|' ? 1 : 0;
lumberyard += map[y - 0][x - 1] == '#' ? 1 : 0;
}
if (x + 1 < width) {
trees += map[y - 0][x + 1] == '|' ? 1 : 0;
lumberyard += map[y - 0][x + 1] == '#' ? 1 : 0;
}
if (y + 1 < height && x - 1 >= 0) {
trees += map[y + 1][x - 1] == '|' ? 1 : 0;
lumberyard += map[y + 1][x - 1] == '#' ? 1 : 0;
}
if (y + 1 < height && x - 0 >= 0) {
trees += map[y + 1][x - 0] == '|' ? 1 : 0;
lumberyard += map[y + 1][x - 0] == '#' ? 1 : 0;
}
if (y + 1 < height && x + 1 < width) {
trees += map[y + 1][x + 1] == '|' ? 1 : 0;
lumberyard += map[y + 1][x + 1] == '#' ? 1 : 0;
}
if (map[y][x] == '.') {
iteration[y][x] = (trees >= 3) ? '|' : '.';
} else if (map[y][x] == '|') {
iteration[y][x] = (lumberyard >= 3) ? '#' : '|';
} else if (map[y][x] == '#') {
iteration[y][x] = (trees > 0 && lumberyard > 0) ? '#' : '.';
} else {
throw new UnsupportedOperationException();
}
}
}
map = iteration;
}
print(height, width, map);
Map<Integer, Integer> repeat = new HashMap<>();
for (int i = 0; i < calculations.size(); i++) {
for (int j = i + 1; j < calculations.size(); j++) {
if (calculations.get(i).equals(calculations.get(j))) {
// System.out.println(String.format("%s: next found %s = %s (%s)", i, j - i, calculations.get(i), (i - 465) % 28));
repeat.put((i - 465) % 28, calculations.get(i));
break;
}
}
}
System.out.println(String.format("repetition=28, start=465, 1000000000 is offset by %s = %s", (1000000000 - 465) % 28, repeat.get((1000000000 - 465) % 28)));
}
private static void print(int height, int width, Character[][] map) {
int y;
int count1 = 0;
int count2 = 0;
for (y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
System.out.print(map[y][x]);
if (map[y][x] == '|') {
count1++;
} else if (map[y][x] == '#') {
count2++;
}
}
System.out.println();
}
System.out.println(String.format("%s * %s = %s", count1, count2, count1 * count2));
}
}
| [
"avanderw@gmail.com"
] | avanderw@gmail.com |
aad972f6e2e933ee7afafdd443af19c58a97638c | a9afd78eba88a124828e766bbd01434c188349bc | /wildfly10/src/main/java/org/jboss/migration/wfly10/subsystem/WildFly10LegacySubsystem.java | e6e6c9c838e41963c80b4a3a18565e16e67d5574 | [
"Apache-2.0"
] | permissive | Ladicek/wildfly-server-migration | 28a7cc6224be4ed9b77e70cf2a62d778cc806f17 | c0d9505392c640b12ab72c63702f0f3d92a666d0 | refs/heads/master | 2021-01-17T23:36:39.113437 | 2016-07-19T11:18:12 | 2016-07-19T11:18:12 | 45,919,196 | 0 | 0 | null | 2015-11-10T15:01:04 | 2015-11-10T15:01:02 | null | UTF-8 | Java | false | false | 5,335 | java | /*
* Copyright 2016 Red Hat, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.migration.wfly10.subsystem;
import org.jboss.as.controller.PathAddress;
import org.jboss.as.controller.operations.common.Util;
import org.jboss.dmr.ModelNode;
import org.jboss.migration.core.ServerMigrationTask;
import org.jboss.migration.core.ServerMigrationTaskContext;
import org.jboss.migration.core.ServerMigrationTaskName;
import org.jboss.migration.core.ServerMigrationTaskResult;
import org.jboss.migration.wfly10.standalone.WildFly10StandaloneServer;
import java.util.ArrayList;
import java.util.List;
import static org.jboss.as.controller.PathAddress.pathAddress;
import static org.jboss.as.controller.PathElement.pathElement;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.*;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.RESULT;
/**
* A legacy deprecated subsystem, the server only includes support to load and migrate its configuration to the subsystem which replaces it.
* @author emmartins
*/
public class WildFly10LegacySubsystem extends WildFly10Subsystem {
public WildFly10LegacySubsystem(String name, String namespaceWithoutVersion, WildFly10Extension extension) {
super(name, namespaceWithoutVersion, "migrate-subsystem", null, extension);
}
/**
* Post migration processing.
* @param migrationWarnings the warnings that resulted from doing the migration
* @param server the server
* @param context the task context
* @throws Exception if there was a failure processing the warnings
*/
protected void processWarnings(List<String> migrationWarnings, WildFly10StandaloneServer server, ServerMigrationTaskContext context) throws Exception {
}
@Override
public ServerMigrationTask getServerMigrationTask(final WildFly10StandaloneServer server) {
final String subsystemName = getName();
return new ServerMigrationTask() {
@Override
public ServerMigrationTaskName getName() {
return serverMigrationTaskName;
}
@Override
public ServerMigrationTaskResult run(ServerMigrationTaskContext context) throws Exception {
if (skipExecution(context)) {
return ServerMigrationTaskResult.SKIPPED;
}
final ModelNode subsystemConfig = server.getSubsystem(subsystemName);
if (subsystemConfig == null) {
return ServerMigrationTaskResult.SKIPPED;
}
context.getLogger().debugf("Migrating subsystem %s...", subsystemName);
final PathAddress address = pathAddress(pathElement(SUBSYSTEM, subsystemName));
final ModelNode op = Util.createEmptyOperation("migrate", address);
final ModelNode result = server.getModelControllerClient().execute(op);
context.getLogger().debugf("Op result: %s", result.asString());
final String outcome = result.get(OUTCOME).asString();
if(!SUCCESS.equals(outcome)) {
throw new RuntimeException("Subsystem "+subsystemName+" migration failed: "+result.get("migration-error").asString());
} else {
final ServerMigrationTaskResult.Builder resultBuilder = new ServerMigrationTaskResult.Builder().sucess();
final List<String> migrateWarnings = new ArrayList<>();
if (result.get(RESULT).hasDefined("migration-warnings")) {
for (ModelNode modelNode : result.get(RESULT).get("migration-warnings").asList()) {
migrateWarnings.add(modelNode.asString());
}
}
processWarnings(migrateWarnings, server, context);
if (migrateWarnings.isEmpty()) {
context.getLogger().infof("Subsystem %s migrated.", subsystemName);
} else {
context.getLogger().infof("Subsystem %s migrated with warnings: %s", subsystemName, migrateWarnings);
resultBuilder.addAttribute("migration-warnings", migrateWarnings);
}
// FIXME tmp workaround for legacy subsystems which do not remove itself
if (server.getSubsystems().contains(subsystemName)) {
// remove itself after migration
server.removeSubsystem(subsystemName);
context.getLogger().debugf("Subsystem %s removed after migration.", subsystemName);
}
return resultBuilder.build();
}
}
};
}
}
| [
"emartins@redhat.com"
] | emartins@redhat.com |
0764f884ab988037daec654ce919195f3cdaf3ee | 8c085f12963e120be684f8a049175f07d0b8c4e5 | /castor/tags/tag_0_9_3_1/castor-2002/castor/src/main/org/exolab/castor/mapping/MappingResolver.java | b2386f1a9863583c5e5b0aaf3e81eac8e6865b17 | [] | no_license | alam93mahboob/castor | 9963d4110126b8f4ef81d82adfe62bab8c5f5bce | 974f853be5680427a195a6b8ae3ce63a65a309b6 | refs/heads/master | 2020-05-17T08:03:26.321249 | 2014-01-01T20:48:45 | 2014-01-01T20:48:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,643 | java | /**
* Redistribution and use of this software and associated documentation
* ("Software"), with or without modification, are permitted provided
* that the following conditions are met:
*
* 1. Redistributions of source code must retain copyright
* statements and notices. Redistributions must also contain a
* copy of this document.
*
* 2. Redistributions in binary form must reproduce the
* above copyright notice, this list of conditions and the
* following disclaimer in the documentation and/or other
* materials provided with the distribution.
*
* 3. The name "Exolab" must not be used to endorse or promote
* products derived from this Software without prior written
* permission of Intalio, Inc. For written permission,
* please contact info@exolab.org.
*
* 4. Products derived from this Software may not be called "Exolab"
* nor may "Exolab" appear in their names without prior written
* permission of Intalio, Inc. Exolab is a registered
* trademark of Intalio, Inc.
*
* 5. Due credit should be given to the Exolab Project
* (http://www.exolab.org/).
*
* THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESSED 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
* INTALIO, INC. OR ITS 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.
*
* Copyright 1999 (C) Intalio, Inc. All Rights Reserved.
*
* $Id$
*/
package org.exolab.castor.mapping;
import java.util.Enumeration;
/**
* Provides the mapping descriptor for Java classes. The engines use
* resolvers to obtain the mapping descriptor for a particular Java
* class, or to list all the known descriptors. Although the interface
* is identical, each engine will use a resolver that returns class
* descriptor suitable for that particular engine. Resolvers are
* immutable and engines need not cache the returned descriptors.
*
* @author <a href="arkin@intalio.com">Assaf Arkin</a>
* @version $Revision$ $Date$
*/
public interface MappingResolver
{
/**
* Returns the class descriptor for the specified Java class.
* In no such descriptor exists, returns null.
*
* @param javaClass The Java class
* @return A suitable class descriptor or null
*/
public ClassDescriptor getDescriptor( Class javaClass );
/**
* Returns an enumeration of all the known descriptors. Each
* element is of type {@link ClassDescriptor}.
*/
public Enumeration listDescriptors();
/**
* Returns an enumeration of all the supported Java classes.
* Each element is of type <tt>java.lang.Class</tt>, and for
* each such class a suitable descriptor exists.
*/
public Enumeration listJavaClasses();
/**
*
* Returns the class loader associated with this mapping resolver
* if one was specified. This is the class loader used to load all
* the classes mapped by this mapping resolver. May be null if no
* class loader was specified or in certain JVMs.
*/
public ClassLoader getClassLoader();
}
| [
"nobody@b24b0d9a-6811-0410-802a-946fa971d308"
] | nobody@b24b0d9a-6811-0410-802a-946fa971d308 |
73a4935174cf37e742f0072e060a25123ca680b4 | b7f3edb5b7c62174bed808079c3b21fb9ea51d52 | /chrome/android/java/src/org/chromium/chrome/browser/download/home/DownloadManagerCoordinatorFactoryHelper.java | b8c132251174f70fb5905642ca5fc9063f23a82b | [
"BSD-3-Clause"
] | permissive | otcshare/chromium-src | 26a7372773b53b236784c51677c566dc0ad839e4 | 64bee65c921db7e78e25d08f1e98da2668b57be5 | refs/heads/webml | 2023-03-21T03:20:15.377034 | 2020-11-16T01:40:14 | 2020-11-16T01:40:14 | 209,262,645 | 18 | 21 | BSD-3-Clause | 2023-03-23T06:20:07 | 2019-09-18T08:52:07 | null | UTF-8 | Java | false | false | 2,944 | java | // Copyright 2018 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.download.home;
import android.app.Activity;
import android.content.Context;
import org.chromium.chrome.browser.GlobalDiscardableReferencePool;
import org.chromium.chrome.browser.download.items.OfflineContentAggregatorFactory;
import org.chromium.chrome.browser.download.settings.DownloadSettings;
import org.chromium.chrome.browser.feature_engagement.TrackerFactory;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.settings.SettingsLauncher;
import org.chromium.chrome.browser.settings.SettingsLauncherImpl;
import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager;
import org.chromium.chrome.browser.vr.VrModeProviderImpl;
import org.chromium.components.user_prefs.UserPrefs;
import org.chromium.ui.modaldialog.ModalDialogManager;
/** A helper class to build and return an {@link DownloadManagerCoordinator}. */
public class DownloadManagerCoordinatorFactoryHelper {
/**
* Returns an instance of a {@link DownloadManagerCoordinator} to be used in the UI.
* @param activity The parent {@link Activity}.
* @param config A {@link DownloadManagerUiConfig} to provide configuration params.
* @param snackbarManager The {@link SnackbarManager} that should be used to show snackbars.
* @param modalDialogManager The {@link ModalDialogManager} that should be used to show dialog.
* @return A new {@link DownloadManagerCoordinator} instance.
*/
public static DownloadManagerCoordinator create(Activity activity,
DownloadManagerUiConfig config, SnackbarManager snackbarManager,
ModalDialogManager modalDialogManager) {
Profile profile = config.isOffTheRecord
? Profile.getLastUsedRegularProfile().getOffTheRecordProfile()
: Profile.getLastUsedRegularProfile();
LegacyDownloadProvider legacyProvider =
config.useNewDownloadPath ? null : new LegacyDownloadProviderImpl();
return new DownloadManagerCoordinatorImpl(activity, config, new PrefetchEnabledSupplier(),
DownloadManagerCoordinatorFactoryHelper::settingsLaunchHelper, snackbarManager,
modalDialogManager, UserPrefs.get(profile),
TrackerFactory.getTrackerForProfile(profile), new FaviconProviderImpl(profile),
OfflineContentAggregatorFactory.get(), legacyProvider,
GlobalDiscardableReferencePool.getReferencePool(), new VrModeProviderImpl());
}
private static void settingsLaunchHelper(Context context) {
SettingsLauncher settingsLauncher = new SettingsLauncherImpl();
settingsLauncher.launchSettingsActivity(context, DownloadSettings.class);
}
}
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
ca3dd197d6ed00b6c2f2b26069c5528788459542 | 12eaf974dd5cda4584d69fb6978838f0453c753e | /src/day20/Ders1.java | 8d1e0afe6cc879593596d5a184d6a5af4c1e4fa0 | [] | no_license | hunals/JavaSpringPractice2019 | 58b1232676254086f213a15c4095b82a8da34e1b | 81ace34df5595ace3b899b6be533a9773cff2537 | refs/heads/master | 2020-06-04T20:48:23.286332 | 2019-07-04T13:17:10 | 2019-07-04T13:17:10 | 192,184,248 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,453 | java | package day20;
import java.util.Scanner;
public class Ders1 {
public static void main(String[] args) {
String name = "abc" ;
String pass = "123" ;
Scanner scan = new Scanner(System.in);
do {
System.out.println("Enter username : ");
name = scan.next();
System.out.println("Enter Pasword");
pass = scan.next();
}while( !(name.equals("abc")&& pass.contentEquals("123")));
System.out.println("END");
while( !(name.equals("abc")&& pass.contentEquals("123"))) {
System.out.println("Enter username : ");
name = scan.next();
System.out.println("Enter Pasword");
pass = scan.next();
System.out.println("END");
}
}
}
/*
* while( some condition is true){
* action to be repeated
* }
*
* do{
* action to be repeated
* }while(some condition is true);
*
* */
// String name = "";
// String pass = "";
// Scanner scan = new Scanner(System.in);
//
//
// while( !( name.equals("abc")&& pass.equals("123") ) ) {
//
// System.out.println("Enter username : ");
// name = scan.next();
// System.out.println("Enter Password : ");
// pass = scan.next();
//
// }
// do {
//
// System.out.println("Enter username : ");
// name = scan.next();
// System.out.println("Enter Password : ");
// pass = scan.next();
//
// }while( !( name.equals("abc")&& pass.equals("123") ) ) ;
// System.out.println("END"); | [
"hunals06@hotmail.com"
] | hunals06@hotmail.com |
bb31e5ba109e251f35f1c39135ecddc29d19e2da | 30daa061cdc3081d31cea3f90660e696b9399038 | /NTSCChatServer/src/com/test/testclient/handlers/PresenceMessageHandler.java | 6e74a3fc581475efcde99fa8226e231e74e7d230 | [] | no_license | PhanHuy247/coreGVN | 7ce7c9d4bcd1f9f95f228aed296efa934a45c594 | 383e35019fc884420e6c4398b74e03d8f05a4d0f | refs/heads/master | 2020-03-07T13:37:53.513725 | 2018-03-31T10:03:04 | 2018-03-31T10:03:04 | 127,506,076 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,269 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.test.testclient.handlers;
import com.vn.ntsc.chatclient.listeners.IPresenceListener;
import com.vn.ntsc.chatserver.pojos.message.Message;
import com.vn.ntsc.chatserver.pojos.message.messagetype.MessageTypeValue;
/**
*
* @author tuannxv00804
*/
public class PresenceMessageHandler implements IPresenceListener {
@Override
public void handle( Message msg ) {
// System.out.println( "PresenceHandler.handle() -> MessageStructure: " );
// msg.printStruct();
StringBuilder builder = new StringBuilder();
String olStatus;
if( msg.value.equals( MessageTypeValue.Presence_Online ) ){
olStatus = "Online";
}else if( msg.value.equals( MessageTypeValue.Presence_Offline ) ){
olStatus = "Offline";
}else if( msg.value.equals( MessageTypeValue.Presence_Writing ) ){
olStatus = "Writing";
}else{
olStatus = msg.value;
}
builder.append( msg.from )
.append( " is " )
.append( olStatus );
System.out.println( builder.toString() );
}
}
| [
"phandinhhuy95@gmail.com"
] | phandinhhuy95@gmail.com |
046179dfe6856248aafa80b78e73f6bc7fd9152e | 121e1af1db20ca9dc25776f834bba894f4f21b2b | /Projek 2/app/src/main/java/com/example/ngidolyuk/Model/BestDealModel.java | 82d0d74556b05612397dd056b6422eb90b217e3e | [] | no_license | saohdir/NgidolYuk-Android | 089cda9cf8d19e2f7d3bff360329e1f00fdb2618 | 357ecbeea012403f0c8bc9a5022898c224a6cd43 | refs/heads/master | 2023-02-21T18:48:30.096076 | 2021-01-21T21:19:33 | 2021-01-21T21:19:33 | 331,757,033 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 927 | java | package com.example.ngidolyuk.Model;
public class BestDealModel {
private String menu_id,food_id, name, image;
public BestDealModel() {
}
public BestDealModel(String menu_id, String food_id, String name, String image) {
this.menu_id = menu_id;
this.food_id = food_id;
this.name = name;
this.image = image;
}
public String getMenu_id() {
return menu_id;
}
public void setMenu_id(String menu_id) {
this.menu_id = menu_id;
}
public String getFood_id() {
return food_id;
}
public void setFood_id(String food_id) {
this.food_id = food_id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
}
| [
"you@example.com"
] | you@example.com |
ce18d9c26c3e56c0b356995f358a45032934d29f | 7093582dda67606af2b7c3586f6e6d541d378338 | /ta4j/src/main/java/eu/verdelhan/ta4j/strategies/ResistanceStrategy.java | 701caf1fe215396c5a292a2cfb08a77cb1f123c5 | [
"MIT"
] | permissive | dkcm/ta4j | a25da2f35d3abb9ffe9dff63cfc33400d51080f1 | 3823c41e25ce0501dda39dd07b669c72f5a4c0c3 | refs/heads/master | 2021-01-16T18:18:54.030829 | 2014-09-24T10:51:01 | 2014-09-24T10:51:01 | 23,628,799 | 0 | 0 | MIT | 2020-12-19T10:18:45 | 2014-09-03T16:47:18 | Java | UTF-8 | Java | false | false | 2,534 | java | /**
* The MIT License (MIT)
*
* Copyright (c) 2014 Marc de Verdelhan
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package eu.verdelhan.ta4j.strategies;
import eu.verdelhan.ta4j.Indicator;
import eu.verdelhan.ta4j.Strategy;
/**
* Resistance strategy.
* <p>
* Enter: according to the provided {@link Strategy strategy}<br>
* Exit: when the {@link Indicator indicator} value is greater than or equal to the resistance threshold
*/
public class ResistanceStrategy extends AbstractStrategy {
private final Strategy strategy;
private final Indicator<? extends Number> indicator;
private double resistance;
/**
* Constructor.
* @param indicator the indicator
* @param strategy the strategie
* @param resistance the resistance threshold
*/
public ResistanceStrategy(Indicator<? extends Number> indicator, Strategy strategy, double resistance) {
this.strategy = strategy;
this.resistance = resistance;
this.indicator = indicator;
}
@Override
public boolean shouldEnter(int index) {
return strategy.shouldEnter(index);
}
@Override
public boolean shouldExit(int index) {
if (indicator.getValue(index).doubleValue() >= resistance) {
return true;
}
return strategy.shouldExit(index);
}
@Override
public String toString() {
return String.format("%s resistance: %i strategy: %s", this.getClass().getSimpleName(), resistance, strategy);
}
}
| [
"marc.deverdelhan@yahoo.com"
] | marc.deverdelhan@yahoo.com |
6962843c1060ebcc9711c3c99fbd66d24044aa7c | d98cfb10587b2e01a3cc641c935dcd6006e2a932 | /seal/src/main/java/cn/rongcloud/im/utils/googleApi/HttpGet.java | d16320dd6b98c481a58a40e1fc54b279a4b34667 | [
"MIT"
] | permissive | yibulaxi/sealtalk-android-master | 1ea48ba2958b13bd755229007784a32427ac8989 | 0a08c3ce6604540f40a245b02c6d5ee7c59a15ca | refs/heads/master | 2021-06-16T17:01:14.715980 | 2017-06-01T13:54:48 | 2017-06-01T13:54:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,103 | java | package cn.rongcloud.im.utils.googleApi;
import android.text.TextUtils;
import android.util.Log;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.Map;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
class HttpGet {
protected static final int SOCKET_TIMEOUT = 10000; // 10S
protected static final String GET = "GET";
public static String get(String host, String url) {
try {
// 设置SSLContext
SSLContext sslcontext = SSLContext.getInstance("TLS");
sslcontext.init(null, new TrustManager[]{myX509TrustManager}, null);
String sendUrl = host + url;
// System.out.println("URL:" + sendUrl);
URL uri = new URL(sendUrl); // 创建URL对象
Log.e("123", "sendUrl=" + sendUrl);
HttpURLConnection conn = (HttpURLConnection) uri.openConnection();
if (conn instanceof HttpsURLConnection) {
((HttpsURLConnection) conn).setSSLSocketFactory(sslcontext.getSocketFactory());
}
conn.setConnectTimeout(SOCKET_TIMEOUT); // 设置相应超时
conn.setRequestMethod(GET);
int statusCode = conn.getResponseCode();
if (statusCode != HttpURLConnection.HTTP_OK) {
System.out.println("Http错误码:" + statusCode);
}
// 读取服务器的数据
InputStream is = conn.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(is));
StringBuilder builder = new StringBuilder();
String line = null;
while ((line = br.readLine()) != null) {
builder.append(line);
}
String text = builder.toString();
close(br); // 关闭数据流
close(is); // 关闭数据流
conn.disconnect(); // 断开连接
return text;
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (KeyManagementException e) {
e.printStackTrace();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
return null;
}
protected static void close(Closeable closeable) {
if (closeable != null) {
try {
closeable.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
/**
* 对输入的字符串进行URL编码, 即转换为%20这种形式
*
* @param input 原文
* @return URL编码. 如果编码失败, 则返回原文
*/
public static String encode(String input) {
if (input == null) {
return "";
}
try {
return URLEncoder.encode(input, "utf-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return input;
}
private static TrustManager myX509TrustManager = new X509TrustManager() {
@Override
public X509Certificate[] getAcceptedIssuers() {
return null;
}
@Override
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
}
@Override
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
}
};
}
| [
"1095309465@qq.com"
] | 1095309465@qq.com |
5c36b04266fa029a1b53e76d8029cb87e3ddac45 | 61325fcac199024e36b42954d881655e54309ea1 | /src/qcs/other/check_delete_ok.java | 3fc8951e74fbfa959ba63f1af4e676a55ba592ad | [] | no_license | RainerJava/erp-6 | 89376f75988d4662d8116da0b474565a3d992e1d | 5697a68876dc5dd2a1e54fb0a7b940e5beb34d6d | refs/heads/master | 2021-01-16T22:46:07.322118 | 2013-05-10T17:23:54 | 2013-05-10T17:23:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,180 | java | /*
*this file is part of nseer erp
*Copyright (C)2006-2010 Nseer(Beijing) Technology co.LTD/http://www.nseer.com
*
*This program is free software; you can redistribute it and/or
*modify it under the terms of the GNU General Public License
*as published by the Free Software Foundation; either
*version 2 of the License, or (at your option) any later version.
*/
package qcs.other;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import javax.servlet.*;
import java.sql.*;
import include.nseer_db.*;
import java.io.*;
public class check_delete_ok extends HttpServlet{
public synchronized void service(HttpServletRequest request,HttpServletResponse response) throws IOException,ServletException{
HttpSession dbSession=request.getSession();
JspFactory _jspxFactory=JspFactory.getDefaultFactory();
PageContext pageContext = _jspxFactory.getPageContext(this,request,response,"",true,8192,true);
ServletContext dbApplication=dbSession.getServletContext();
try{
//实例化
HttpSession session=request.getSession();
ServletContext context=session.getServletContext();
String path=context.getRealPath("/");
nseer_db_backup1 qcs_db = new nseer_db_backup1(dbApplication);
nseer_db_backup1 qcs_db1 = new nseer_db_backup1(dbApplication);
if(qcs_db.conn((String)dbSession.getAttribute("unit_db_name"))&&qcs_db1.conn((String)dbSession.getAttribute("unit_db_name"))){
String check_time = request.getParameter("check_time");
String checker = request.getParameter("checker");
String checker_id = request.getParameter("checker_id");
String qcs_id = request.getParameter("qcs_id");
String config_id = request.getParameter("config_id");
String choice=request.getParameter("choice");
String sql6="select id from qcs_workflow where object_ID='"+qcs_id+"' and ((check_tag='0' and config_id<'"+config_id+"') or (check_tag='1' and config_id='"+config_id+"'))";
ResultSet rs6=qcs_db.executeQuery(sql6);
if(!rs6.next()){
String sql1="select id from qcs_other where qcs_id='"+qcs_id+"' and check_tag='0'";
ResultSet rs=qcs_db.executeQuery(sql1);
if(!rs.next()){
response.sendRedirect("qcs/other/check_delete_ok.jsp?finished_tag=0");
}else{
if(choice!=null){
if(choice.equals("")){
String sql = "update qcs_other set checker='"+checker+"',checker_id='"+checker_id+"',check_time='"+check_time+"',check_tag='9' where qcs_id='"+qcs_id+"'";
qcs_db.executeUpdate(sql) ;
sql = "delete from qcs_workflow where object_ID='"+qcs_id+"'" ;
qcs_db.executeUpdate(sql) ;
}else{
sql6="select id from qcs_workflow where object_ID='"+qcs_id+"' and config_id<'"+config_id+"' and config_id>='"+choice+"'";
rs6=qcs_db.executeQuery(sql6);
while(rs6.next()){
String sql = "update qcs_workflow set check_tag='0' where id='"+rs6.getString("id")+"'" ;
qcs_db1.executeUpdate(sql) ;
}
}
response.sendRedirect("qcs/other/check_delete_ok.jsp?finished_tag=1");
}else{
response.sendRedirect("qcs/other/check_delete_ok.jsp?finished_tag=2");
}
}
}else{
response.sendRedirect("qcs/other/check_delete_ok.jsp?finished_tag=3");
}
qcs_db.commit();
qcs_db1.commit();
qcs_db.close();
qcs_db1.close();
}else{
response.sendRedirect("error_conn.htm");
}
}catch(Exception ex){ex.printStackTrace();}
}
}
| [
"joooohnli@gmail.com"
] | joooohnli@gmail.com |
4f9d175469e85ecab90faa593f977ed604a1be4a | dfd79178ab98c833f30ed48a6507fff714d10361 | /ifs-web-service/ifs-project-setup-mgt-service/src/main/java/org/innovateuk/ifs/project/eligibility/viewmodel/FinanceChecksProjectCostsViewModel.java | eb9813cee79451d15c4aae8640729414c8a0178c | [
"MIT"
] | permissive | jaygooby/innovation-funding-service | 16916cd0355df6f9e5ee25bc5574d2c209aaf21c | 6f630ed704553eabe41b67afe97735c3b4b6107e | refs/heads/master | 2022-12-01T09:44:23.725776 | 2020-08-14T09:01:11 | 2020-08-14T09:01:11 | 287,943,002 | 0 | 0 | null | 2020-08-16T12:51:11 | 2020-08-16T12:51:11 | null | UTF-8 | Java | false | false | 980 | java | package org.innovateuk.ifs.project.eligibility.viewmodel;
import org.innovateuk.ifs.application.forms.sections.yourprojectcosts.viewmodel.YourProjectCostsViewModel;
import org.innovateuk.ifs.finance.resource.cost.FinanceRowType;
import java.util.Set;
public class FinanceChecksProjectCostsViewModel extends YourProjectCostsViewModel {
private final FinanceRowType editableRowType;
public FinanceChecksProjectCostsViewModel(long applicationId, String competitionName, boolean open, FinanceRowType editableRowType, Set<FinanceRowType> financeRowTypes, boolean overheadAlwaysTwenty) {
super(open, true, false, financeRowTypes, overheadAlwaysTwenty, competitionName, applicationId);
this.editableRowType = editableRowType;
}
@Override
public boolean isReadOnly(FinanceRowType type) {
return isReadOnly() || !type.equals(editableRowType);
}
public FinanceRowType getEditableRowType() {
return editableRowType;
}
}
| [
"lharper@worth.systems"
] | lharper@worth.systems |
de6c0244841459105fde398801853dbb8a0f414d | 48116c8d80cb92da584a571595f223d34f2173cf | /src/test/java/first/sample/com/web/rest/TestUtil.java | f7c013341df1c8a4fc3ab58cdc9d5b9c42b8c1bc | [] | no_license | abdou-93/jhipsterSampleApplication | 3ad5578bafcf6ccee32271c14349901fe693936c | dbdadf720207b4b15a62e59a9aa34275ce045b4c | refs/heads/master | 2021-07-18T05:11:34.017882 | 2017-10-23T11:38:28 | 2017-10-23T11:38:28 | 107,973,818 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,418 | java | package first.sample.com.web.rest;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import org.hamcrest.Description;
import org.hamcrest.TypeSafeDiagnosingMatcher;
import org.springframework.http.MediaType;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.time.ZonedDateTime;
import java.time.format.DateTimeParseException;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Utility class for testing REST controllers.
*/
public class TestUtil {
/** MediaType for JSON UTF8 */
public static final MediaType APPLICATION_JSON_UTF8 = new MediaType(
MediaType.APPLICATION_JSON.getType(),
MediaType.APPLICATION_JSON.getSubtype(), StandardCharsets.UTF_8);
/**
* Convert an object to JSON byte array.
*
* @param object
* the object to convert
* @return the JSON byte array
* @throws IOException
*/
public static byte[] convertObjectToJsonBytes(Object object)
throws IOException {
ObjectMapper mapper = new ObjectMapper();
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
JavaTimeModule module = new JavaTimeModule();
mapper.registerModule(module);
return mapper.writeValueAsBytes(object);
}
/**
* Create a byte array with a specific size filled with specified data.
*
* @param size the size of the byte array
* @param data the data to put in the byte array
* @return the JSON byte array
*/
public static byte[] createByteArray(int size, String data) {
byte[] byteArray = new byte[size];
for (int i = 0; i < size; i++) {
byteArray[i] = Byte.parseByte(data, 2);
}
return byteArray;
}
/**
* A matcher that tests that the examined string represents the same instant as the reference datetime.
*/
public static class ZonedDateTimeMatcher extends TypeSafeDiagnosingMatcher<String> {
private final ZonedDateTime date;
public ZonedDateTimeMatcher(ZonedDateTime date) {
this.date = date;
}
@Override
protected boolean matchesSafely(String item, Description mismatchDescription) {
try {
if (!date.isEqual(ZonedDateTime.parse(item))) {
mismatchDescription.appendText("was ").appendValue(item);
return false;
}
return true;
} catch (DateTimeParseException e) {
mismatchDescription.appendText("was ").appendValue(item)
.appendText(", which could not be parsed as a ZonedDateTime");
return false;
}
}
@Override
public void describeTo(Description description) {
description.appendText("a String representing the same Instant as ").appendValue(date);
}
}
/**
* Creates a matcher that matches when the examined string reprensents the same instant as the reference datetime
* @param date the reference datetime against which the examined string is checked
*/
public static ZonedDateTimeMatcher sameInstant(ZonedDateTime date) {
return new ZonedDateTimeMatcher(date);
}
/**
* Verifies the equals/hashcode contract on the domain object.
*/
@SuppressWarnings("unchecked")
public static void equalsVerifier(Class clazz) throws Exception {
Object domainObject1 = clazz.getConstructor().newInstance();
assertThat(domainObject1.toString()).isNotNull();
assertThat(domainObject1).isEqualTo(domainObject1);
assertThat(domainObject1.hashCode()).isEqualTo(domainObject1.hashCode());
// Test with an instance of another class
Object testOtherObject = new Object();
assertThat(domainObject1).isNotEqualTo(testOtherObject);
assertThat(domainObject1).isNotEqualTo(null);
// Test with an instance of the same class
Object domainObject2 = clazz.getConstructor().newInstance();
assertThat(domainObject1).isNotEqualTo(domainObject2);
// HashCodes are equals because the objects are not persisted yet
assertThat(domainObject1.hashCode()).isEqualTo(domainObject2.hashCode());
}
}
| [
"jhipster-bot@users.noreply.github.com"
] | jhipster-bot@users.noreply.github.com |
c60abe65ef344fcfcce51c6de6e8f7a636a891cd | cd3ccc969d6e31dce1a0cdc21de71899ab670a46 | /agp-7.1.0-alpha01/tools/base/build-system/builder/src/benchmarks/java/com/android/builder/benchmarks/BenchmarkAdd.java | a8c9fe45c2399a0d0f2b0d0347ece29ea950f505 | [
"Apache-2.0"
] | permissive | jomof/CppBuildCacheWorkInProgress | 75e76e1bd1d8451e3ee31631e74f22e5bb15dd3c | 9e3475f6d94cb3239f27ed8f8ee81b0abde4ef51 | refs/heads/main | 2023-05-28T19:03:16.798422 | 2021-06-10T20:59:25 | 2021-06-10T20:59:25 | 374,736,765 | 0 | 1 | Apache-2.0 | 2021-06-07T21:06:53 | 2021-06-07T16:44:55 | Java | UTF-8 | Java | false | false | 3,931 | java | /*
* Copyright (C) 2019 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.builder.benchmarks;
import com.android.tools.build.apkzlib.zip.ZFile;
import com.android.zipflinger.BytesSource;
import com.android.zipflinger.ZipArchive;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
import java.util.zip.Deflater;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
public class BenchmarkAdd {
@Rule public TemporaryFolder temporaryFolder = new TemporaryFolder();
private void createFile(Path path, int size) throws IOException {
Random random = new Random(1);
byte[] content = new byte[size];
random.nextBytes(content);
FileOutputStream os = new FileOutputStream(path.toFile());
os.write(content);
os.close();
}
@Test
public void run() throws IOException {
System.out.println();
System.out.println("Adding speed:");
System.out.println("-------------");
Path tmpFolder = temporaryFolder.newFolder().toPath();
Path src = Paths.get(tmpFolder.toString(), "app.ap_");
Path dst = Paths.get(tmpFolder.toString(), "aapt2_output.ap_");
// Fake 32 MiB aapt2 like zip archive.
ZipCreator.createZip(4000, 8500, src.toString());
Map<String, Path> dexes = new HashMap<>();
// Three fake dex files like what dex could produce.
Path dex1 = Paths.get(tmpFolder.toString(), "classes18.dex");
createFile(dex1, 54020);
dexes.put("classes18.dex", dex1);
Path dex2 = Paths.get(tmpFolder.toString(), "classes3.dex");
createFile(dex2, 8683240);
dexes.put("classes3.dex", dex2);
Path dex3 = Paths.get(tmpFolder.toString(), "classes.dex");
createFile(dex3, 132016);
dexes.put("classes.dex", dex3);
Files.copy(src, dst, StandardCopyOption.REPLACE_EXISTING);
runZipFlinger(dst, dexes);
Files.copy(src, dst, StandardCopyOption.REPLACE_EXISTING);
runApkzlib(dst, dexes);
}
private void runZipFlinger(Path dst, Map<String, Path> dexes) throws IOException {
StopWatch watch = new StopWatch();
ZipArchive archive = new ZipArchive(dst.toFile());
for (String name : dexes.keySet()) {
Path path = dexes.get(name);
BytesSource source = new BytesSource(path.toFile(), name, Deflater.NO_COMPRESSION);
archive.add(source);
}
archive.close();
long runtime = watch.end();
System.out.println(String.format("Zipflinger: %4d ms", runtime / 1_000_000));
}
private void runApkzlib(Path dst, Map<String, Path> dexes) throws IOException {
StopWatch watch = new StopWatch();
ZFile zFile = ZFile.openReadWrite(dst.toFile());
for (String name : dexes.keySet()) {
Path path = dexes.get(name);
zFile.add(name, new FileInputStream(path.toFile()), false);
}
zFile.close();
long runtime = watch.end();
System.out.println(String.format("Apkzlib : %4d ms", runtime / 1_000_000));
}
}
| [
"jomof@google.com"
] | jomof@google.com |
9139356a084af0f1b7a30337c9f6c68cf7b5094b | 9f7ae2f3a2fe129420560cbf639f93131bdc3003 | /servlet/src/test/java/io/undertow/servlet/test/upgrade/SimpleUpgradeTestCase.java | 72076412bd611021b6bcadcc1d0c96d2e4a5ee06 | [
"Apache-2.0"
] | permissive | kirmerzlikin/undertow | e04db81ca38ac8fde012186ed35a385ad848a528 | d30a979647e8ae1b8ad6f2ca12c061fb800fa991 | refs/heads/master | 2020-12-02T22:12:28.199343 | 2017-07-03T10:36:36 | 2017-07-03T10:36:36 | 96,097,063 | 0 | 0 | null | 2017-07-03T09:59:10 | 2017-07-03T09:59:10 | null | UTF-8 | Java | false | false | 3,239 | java | /*
* JBoss, Home of Professional Open Source.
* Copyright 2014 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.undertow.servlet.test.upgrade;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
import javax.servlet.ServletException;
import io.undertow.servlet.api.ServletInfo;
import io.undertow.servlet.test.util.DeploymentUtils;
import io.undertow.testutils.DefaultServer;
import io.undertow.testutils.HttpOneOnly;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
/**
* @author Stuart Douglas
*/
@HttpOneOnly
@RunWith(DefaultServer.class)
public class SimpleUpgradeTestCase {
@BeforeClass
public static void setup() throws ServletException {
DeploymentUtils.setupServlet(
new ServletInfo("upgradeServlet", UpgradeServlet.class)
.addMapping("/upgrade"),
new ServletInfo("upgradeAsyncServlet", AsyncUpgradeServlet.class)
.addMapping("/asyncupgrade"));
}
@Test
public void testBlockingUpgrade() throws IOException {
runTest("/servletContext/upgrade");
}
@Test
public void testAsyncUpgrade() throws IOException {
runTest("/servletContext/asyncupgrade");
}
public void runTest(final String url) throws IOException {
final Socket socket = new Socket(DefaultServer.getHostAddress("default"), DefaultServer.getHostPort("default"));
InputStream in = socket.getInputStream();
OutputStream out = socket.getOutputStream();
out.write(("GET " + url + " HTTP/1.1\r\nConnection: upgrade\r\nUpgrade: servlet\r\n\r\n").getBytes());
out.flush();
Assert.assertTrue(readBytes(in).startsWith("HTTP/1.1 101 Switching Protocols\r\n"));
out.write("Echo Messages\r\n\r\n".getBytes());
out.flush();
Assert.assertEquals("Echo Messages\r\n\r\n", readBytes(in));
out.write("Echo Messages2\r\n\r\n".getBytes());
out.flush();
Assert.assertEquals("Echo Messages2\r\n\r\n", readBytes(in));
out.write("exit\r\n\r\n".getBytes());
out.flush();
out.close();
}
private String readBytes(final InputStream in) throws IOException {
final StringBuilder builder = new StringBuilder();
byte[] buf = new byte[100];
int read;
while (!builder.toString().contains("\r\n\r\n") && (read = in.read(buf)) != -1) { //awesome hack
builder.append(new String(buf, 0, read));
}
return builder.toString();
}
}
| [
"stuart.w.douglas@gmail.com"
] | stuart.w.douglas@gmail.com |
b67311c826d2ac9c98ee970835444bdc79630ecb | eebe7ea49de7cccdb44b6ec1d56e79d4ec3726e3 | /2019.04/2019.04.27 - AtCoder Beginner Contest 125/ABiscuitGenerator.java | ec92f21db43b1a745e4410556fcf9f70747c19ec | [] | no_license | m1kit/cc-archive | 6dfbe702680230240491a7af4e7ad63f372df312 | 66ba7fb9e5b1c61af4a016f800d6c90f6f594ed2 | refs/heads/master | 2021-06-28T21:54:02.658741 | 2020-09-08T09:38:58 | 2020-09-08T09:38:58 | 150,690,803 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 576 | java | package dev.mikit.atcoder;
import dev.mikit.atcoder.lib.io.LightScanner;
import dev.mikit.atcoder.lib.io.LightWriter;
import dev.mikit.atcoder.lib.debug.Debug;
public class ABiscuitGenerator {
private static final int MOD = (int) 1e9 + 7;
public void solve(int testNumber, LightScanner in, LightWriter out) {
// out.setBoolLabel(LightWriter.BoolLabel.YES_NO_FIRST_UP);
int a = in.ints(), b = in.ints(), t = in.ints();
int ans = 0;
for (int i = a; i <= t; i += a) {
ans += b;
}
out.ans(ans).ln();
}
}
| [
"mikihito0906@gmail.com"
] | mikihito0906@gmail.com |
d1a921e3a009a797545b44b711a353e3c516c56e | f7225589426012257795b358127ba90886ccf932 | /src/main/java/freenet/support/ReceivedPacketNumbers.java | 65a30a48fa5e4924e32964e880e2d861a38ea9d7 | [] | no_license | SebastianWeetabix/fred-maven | db1b97692f862e68d47e2d303d13c4381ba0ac87 | 884f6a39c5432ae45ab922f9824f93d2cf25c283 | refs/heads/master | 2021-01-23T22:10:27.334433 | 2011-04-30T20:23:21 | 2011-04-30T20:23:21 | 1,589,630 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,837 | java | package freenet.support;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.ListIterator;
/**
* @author amphibian
*
* Tracks which packet numbers we have received.
* Implemented as a sorted list since this is simplest and
* it's unlikely it will be very long in practice. The 512-
* packet window provides a practical limit.
*/
public class ReceivedPacketNumbers {
final LinkedList<Range> ranges;
int lowestSeqNumber;
int highestSeqNumber;
final int horizon;
public ReceivedPacketNumbers(int horizon) {
ranges = new LinkedList<Range>();
lowestSeqNumber = -1;
highestSeqNumber = -1;
this.horizon = horizon;
}
public synchronized void clear() {
lowestSeqNumber = -1;
highestSeqNumber = -1;
ranges.clear();
}
private static class Range {
int start; // inclusive
int end; // inclusive
@Override
public String toString() {
return "Range:"+start+"->"+end;
}
}
/**
* We received a packet!
* @param seqNumber The number of the packet.
* @return True if we stored the packet. False if it is out
* of range of the current window.
*/
public synchronized boolean got(int seqNumber) {
if(seqNumber < 0) throw new IllegalArgumentException();
if(ranges.isEmpty()) {
Range r = new Range();
r.start = r.end = lowestSeqNumber = highestSeqNumber = seqNumber;
ranges.addFirst(r);
return true;
} else {
ListIterator<Range> li = ranges.listIterator();
Range r = li.next();
int firstSeq = r.end;
if(seqNumber - firstSeq > horizon) {
// Delete first item
li.remove();
r = li.next();
lowestSeqNumber = r.start;
}
while(true) {
if(seqNumber == r.start-1) {
r.start--;
if(li.hasPrevious()) {
Range r1 = li.previous();
if(r1.end == seqNumber-1) {
r.start = r1.start;
li.remove();
}
} else {
lowestSeqNumber = seqNumber;
}
return true;
}
if(seqNumber < r.start-1) {
if(highestSeqNumber - seqNumber > horizon) {
// Out of window, don't store
return false;
}
Range r1 = new Range();
r1.start = r1.end = seqNumber;
li.previous(); // move cursor back
if(!li.hasPrevious()) // inserting at start??
lowestSeqNumber = seqNumber;
li.add(r1);
return true;
}
if((seqNumber >= r.start) && (seqNumber <= r.end)) {
// Duh
return true;
}
if(seqNumber == r.end+1) {
r.end++;
if(li.hasNext()) {
Range r1 = li.next();
if(r1.start == seqNumber+1) {
r.end = r1.end;
li.remove();
}
} else {
highestSeqNumber = seqNumber;
}
return true;
}
if(seqNumber > r.end+1) {
if(!li.hasNext()) {
// This is the end of the list
Range r1 = new Range();
r1.start = r1.end = highestSeqNumber = seqNumber;
li.add(r1);
return true;
}
}
r = li.next();
}
}
}
/**
* Have we received packet #seqNumber??
* @param seqNumber
* @return
*/
public synchronized boolean contains(int seqNumber) {
if(seqNumber > highestSeqNumber)
return false;
if(seqNumber == highestSeqNumber)
return true;
if(seqNumber == lowestSeqNumber)
return true;
if(highestSeqNumber - seqNumber > horizon)
return true; // Assume we have since out of window
Iterator<Range> i = ranges.iterator();
Range last = null;
for(;i.hasNext();) {
Range r = i.next();
if(r.start > r.end) {
Logger.error(this, "Bad Range: "+r);
}
if((last != null) && (r.start < last.end)) {
Logger.error(this, "This range: "+r+" but last was: "+last);
}
if((r.start <= seqNumber) && (r.end >= seqNumber))
return true;
}
return false;
}
/**
* @return The highest packet number seen so far.
*/
public synchronized int highest() {
return highestSeqNumber;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(super.toString());
sb.append(": max=");
synchronized(this) {
sb.append(highestSeqNumber);
sb.append(", min=");
sb.append(lowestSeqNumber);
sb.append(", ranges=");
Iterator<Range> i = ranges.iterator();
while(i.hasNext()) {
Range r = i.next();
sb.append(r.start);
sb.append('-');
sb.append(r.end);
if(i.hasNext()) sb.append(',');
}
}
return sb.toString();
}
}
| [
"freenet.10.technomation@recursor.net"
] | freenet.10.technomation@recursor.net |
dcb966e19bf51bfe5f4f14e1f6d26aa0872082ac | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/11/11_4e23413cee2003ed5352fcc428f6aa1411cc1265/ArtikelService/11_4e23413cee2003ed5352fcc428f6aa1411cc1265_ArtikelService_s.java | 44f1d9ab36da5b64a03389690d057e0ecc8d2d66 | [] | 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,938 | java | package de.shop.artikelverwaltung.service;
import java.io.Serializable;
import java.lang.invoke.MethodHandles;
import java.util.Collection;
import java.util.Locale;
import java.util.Set;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.inject.Inject;
import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
import javax.persistence.PersistenceContext;
import javax.validation.ConstraintViolation;
import javax.validation.Validator;
import javax.validation.groups.Default;
import org.jboss.logging.Logger;
import com.google.common.base.Strings;
import de.shop.artikelverwaltung.domain.Artikel;
import de.shop.util.Log;
import de.shop.util.ValidatorProvider;
@Log
public class ArtikelService implements Serializable {
private static final long serialVersionUID = -5105686816948437276L;
private static final Logger LOGGER = Logger.getLogger(MethodHandles.lookup().lookupClass());
@Inject
private ValidatorProvider validatorProvider;
@PersistenceContext
private transient EntityManager em;
@PostConstruct
private void postConstruct() {
LOGGER.debugf("CDI-faehiges Bean %s wurde erzeugt", this);
}
@PreDestroy
private void preDestroy() {
LOGGER.debugf("CDI-faehiges Bean %s wird geloescht", this);
}
public Artikel findArtikelById(Long id, Locale locale) {
final Artikel artikel = em.find(Artikel.class, id);
return artikel;
}
public Collection<Artikel> findAllArtikel() {
final Collection<Artikel> artikel = em.createNamedQuery(Artikel.FIND_ALL_ARTIKEL, Artikel.class)
.getResultList();
return artikel;
}
public Artikel findArtikelByName(String name, Locale locale) {
if (Strings.isNullOrEmpty(name)) {
return null;
}
final Artikel artikel = em.createNamedQuery(Artikel.FIND_ARTIKEL_BY_NAME, Artikel.class)
.setParameter(Artikel.PARAM_NAME, "%" + name + "%")
.getSingleResult();
return artikel;
}
public Artikel createArtikel(Artikel artikel, Locale locale) {
if (artikel == null) {
return null;
}
// Werden alle Constraints beim Einfuegen gewahrt?B
validateArtikel(artikel, locale, Default.class);
try {
em.createNamedQuery(Artikel.FIND_ARTIKEL_BY_NAME, Artikel.class)
.setParameter(Artikel.PARAM_NAME, artikel.getName())
.getSingleResult();
throw new ArtikelNameExistsException(artikel.getName());
}
catch (NoResultException e) {
//Noch kein Artikel mit diesem Namen
LOGGER.trace("Name existiert noch nicht.");
}
em.persist(artikel);
return artikel;
}
private void validateArtikel(Artikel artikel, Locale locale, Class<?>... groups) {
// Werden alle Constraints beim Einfuegen gewahrt?
final Validator validator = validatorProvider.getValidator(locale);
final Set<ConstraintViolation<Artikel>> violations = validator.validate(artikel, groups);
if (!violations.isEmpty()) {
throw new InvalidArtikelException(artikel, violations);
}
}
public Artikel updateArtikel(Artikel artikel, Locale locale) {
if (artikel == null) {
return null;
}
//Werden alle Constraints beim Einfuegen gewahrt?
validateArtikel(artikel, locale, Default.class);
em.detach(artikel);
// Gibt es ein anderes Objekt mit gleichem Namen?
final Artikel tmp = findArtikelByName(artikel.getName(), locale);
if (tmp != null) {
em.detach(tmp);
if (tmp.getId().longValue() != artikel.getId().longValue()) {
// anderes Objekt mit gleichem Attributwert fuer name
throw new ArtikelNameExistsException(artikel.getName());
}
}
em.merge(artikel);
return artikel;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
668888463bd8909dbea73a5e369ffb5f94354119 | cffbacf1f9d7906af219793787eb954b50d6d1f4 | /HandCopy2/src/java/br/com/handcopy/jb/Set_setorUpdateDeleteJB.java | 4d99c9d21b608893bcef5d426e5e68f5e6fc53ba | [] | no_license | geoleite/HandCopy | 538e51504e014a1ac2cdfac7ef7ef48e7da79fe1 | 2bccc6fa46657a425240931e070968755f6d284c | refs/heads/master | 2021-01-12T03:36:19.539034 | 2017-01-06T20:34:26 | 2017-01-06T20:34:26 | 78,234,627 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,671 | java | package br.com.handcopy.jb;
import java.util.List;
import br.com.easynet.jb.BeanBase;
import br.com.easynet.jb.EasyDownloadJB;
import br.com.jdragon.dao.DAOFactory;
import br.com.handcopy.dao.*;
import br.com.handcopy.transfer.*;
/** Classe Criada Automaticamente pelo "EasyNet Generate JDragon" */
public class Set_setorUpdateDeleteJB extends SystemBase {
// Atributos e propriedades
private Set_setorT set_setorT = new Set_setorT();
public void setSet_setorT(Set_setorT set_setorT) {
this.set_setorT = set_setorT;
}
public Set_setorT getSet_setorT() {
return set_setorT;
}
private List<Set_setorT> list;
public List<Set_setorT> getList() {
return list;
}
public void setList(List<Set_setorT> list) {
this.list = list;
}
public void pageLoad() throws Exception {
super.pageLoad();
}
public void clear() throws Exception {
set_setorT = new Set_setorT();
}
private void deleteRecursivo(Set_setorT setT) throws Exception {
List<Set_setorT> listSet = getSet_setorDAO().getAllFilhos(setT);
for (Set_setorT set_setorT : listSet) {
deleteRecursivo(set_setorT);
getSet_setorDAO().delete(set_setorT);
}
}
public void delete() throws Exception {
try {
if (exist()) {
Set_setorDAO set_setorDAO = getSet_setorDAO();
deleteRecursivo(set_setorT);
set_setorDAO.delete(set_setorT);
setMsg("Exclusao efetuada com sucesso!");
clear();
} else {
setMsg(ERROR, "Error: Registro inexistente!");
}
} catch (Exception e) {
e.printStackTrace();
setMsg(ERROR, "Falha ao realizar exclusao!");
} finally {
close();
}
}
public boolean exist() throws Exception {
try {
Set_setorDAO set_setorDAO = getSet_setorDAO();
List<Set_setorT> listTemp = set_setorDAO.getByPK(set_setorT);
return listTemp.size() > 0;
} catch (Exception e) {
e.printStackTrace();
setMsg("Falha ao realizar consulta!");
} finally {
close();
}
return false;
}
public void update() throws Exception {
try {
if (exist()) {
Set_setorDAO set_setorDAO = getSet_setorDAO();
set_setorDAO.update(set_setorT);
setMsg("Alteracao efetuada com sucesso!");
} else {
setMsg(ERROR, "Error: Registro inexistente!");
}
} catch (Exception e) {
e.printStackTrace();
setMsg(ERROR, "Falha ao realizar alteracao!");
} finally {
close();
}
}
// Method de lookup
//
private List<Set_setorT> listset_setor;
public List<Set_setorT> getListset_setor() {
return listset_setor;
}
public void setListset_setor(List<Set_setorT> list) {
this.listset_setor = list;
}
public void consultSet_setor() throws Exception {
try {
Set_setorDAO set_setorDAO = getSet_setorDAO();
listset_setor = set_setorDAO.getAll();
} catch (Exception e) {
e.printStackTrace();
} finally {
close();
}
}
public void obtendoSetorColaborador() {
set_setorT = (Set_setorT)getSession().getAttribute(SETOR);
}
//Method Download Image ? montando se houver algum campo do tipo bin?rio
//|DOWNLOADIMAGE|
public void findbyid() throws Exception {
try {
Set_setorDAO set_setorDAO = getSet_setorDAO();
List<Set_setorT> listTemp = set_setorDAO.getByPK(set_setorT);
set_setorT = listTemp.size() > 0 ? listTemp.get(0) : new Set_setorT();
} catch (Exception e) {
e.printStackTrace();
setMsg(ERROR, "Falha ao realizar consulta!");
} finally {
close();
}
}
/**
* Volta para a p?gina de consulta
*/
public void consult() throws Exception {
// TODO Consult
try {
String page = "set_setorConsult.jsp";// defina aqui a p?gina que deve ser chamada
getResponse().sendRedirect(page);
} catch (Exception e) {
}
}
public void cancel() throws Exception {
// TODO Cancel
try {
String page = "set_setorConsult.jsp";// defina aqui a p?gina que deve ser chamada
getResponse().sendRedirect(page);
} catch (Exception e) {
}
}
}
| [
"georgeleitejunior@gmail.com"
] | georgeleitejunior@gmail.com |
9fc3747d3d94b9210f6d8e87f0ed21b066ba775f | db97ce70bd53e5c258ecda4c34a5ec641e12d488 | /src/main/java/com/alipay/api/domain/AlipayCommerceTransportAdStocktaskBatchqueryModel.java | fd1137c709e035c73bee91304a33966d07ebe4d7 | [
"Apache-2.0"
] | permissive | smitzhang/alipay-sdk-java-all | dccc7493c03b3c937f93e7e2be750619f9bed068 | a835a9c91e800e7c9350d479e84f9a74b211f0c4 | refs/heads/master | 2022-11-23T20:32:27.041116 | 2020-08-03T13:03:02 | 2020-08-03T13:03:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 674 | 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-10-22 15:20:10
*/
public class AlipayCommerceTransportAdStocktaskBatchqueryModel extends AlipayObject {
private static final long serialVersionUID = 3771664134683544373L;
/**
* 用户id+根据用户id批量查询该用户提交的库存查询任务
*/
@ApiField("ad_user_id")
private Long adUserId;
public Long getAdUserId() {
return this.adUserId;
}
public void setAdUserId(Long adUserId) {
this.adUserId = adUserId;
}
}
| [
"ben.zy@antfin.com"
] | ben.zy@antfin.com |
c65fbb629802862c95a9f3f1fa3e18e733fb6af6 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/11/11_9ed310c339aa89a81758b811d8ba438a9d9a46b5/Main/11_9ed310c339aa89a81758b811d8ba438a9d9a46b5_Main_s.java | cfd3c67d74f616a577e986946a654832a0ff7513 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 2,404 | java | package com.findwise.hydra;
import java.io.IOException;
import org.apache.commons.configuration.ConfigurationException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.findwise.hydra.memorydb.MemoryConnector;
import com.findwise.hydra.memorydb.MemoryType;
import com.findwise.hydra.mongodb.MongoConnector;
import com.findwise.hydra.mongodb.MongoType;
import com.findwise.hydra.net.HttpRESTHandler;
import com.findwise.hydra.net.RESTServer;
public final class Main {
private Main() {
}
private static Logger logger = LoggerFactory.getLogger(Main.class);
public static void main(String[] args) {
if (args.length > 1) {
logger.error("Some parameters on command line were ignored.");
}
CoreConfiguration conf;
if(args.length>0) {
conf = getConfiguration(args[0]);
} else {
conf = getConfiguration(null);
}
DatabaseConnector<MongoType> backing = new MongoConnector(conf);
DatabaseConnector<MemoryType> cache = new MemoryConnector();
//NodeMaster nm = new NodeMaster(conf, backing, new Pipeline());
NodeMaster nm = new NodeMaster(conf, new CachingDatabaseConnector<MongoType, MemoryType>(backing, cache), new Pipeline());
RESTServer server = new RESTServer(conf, new HttpRESTHandler<DatabaseType>(nm.getDatabaseConnector(), conf.isPerformanceLogging()));
if (!server.blockingStart()) {
if (server.hasError()) {
logger.error("Failed to start REST server: ", server.getError());
}
else {
logger.error("Failed to start REST server");
}
try {
server.shutdown();
}
catch (IOException e2) {
logger.error("IOException caught while shutting down REST server thread", e2);
System.exit(1);
}
return;
}
try {
nm.blockingStart();
}
catch (IOException e) {
logger.error("Unable to start nodemaster... Shutting down.");
try {
server.shutdown();
}
catch (IOException e2) {
logger.error("IOException caught while shutting down", e2);
System.exit(1);
}
}
}
protected static CoreConfiguration getConfiguration(String fileName) {
try {
if(fileName!=null) {
return new FileConfiguration(fileName);
} else {
return new FileConfiguration();
}
}
catch(ConfigurationException e) {
logger.error("Unable to read configuration", e);
return null;
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
461e6ea97e16d8d7a642bce0305ba91fa1fda368 | 504f0ba5c18ccc7393e6715f1ce9b236c4f6d99f | /pcdn-20170411/src/main/java/com/aliyun/pcdn20170411/models/StartDomainRequest.java | 4c0b12daca153c80d9ad5bff501927c19cd52ffe | [
"Apache-2.0"
] | permissive | jhz-duanmeng/alibabacloud-java-sdk | 77f69351dee8050f9c40d7e19b05cf613d2448d6 | ac8bfeb15005d3eac06091bbdf50e7ed3e891c38 | refs/heads/master | 2023-01-16T04:30:12.898713 | 2020-11-25T11:45:31 | 2020-11-25T11:45:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,205 | java | // This file is auto-generated, don't edit it. Thanks.
package com.aliyun.pcdn20170411.models;
import com.aliyun.tea.*;
public class StartDomainRequest extends TeaModel {
@NameInMap("SecurityToken")
public String securityToken;
@NameInMap("Version")
@Validation(required = true)
public String version;
@NameInMap("Domain")
@Validation(required = true)
public String domain;
public static StartDomainRequest build(java.util.Map<String, ?> map) throws Exception {
StartDomainRequest self = new StartDomainRequest();
return TeaModel.build(map, self);
}
public StartDomainRequest setSecurityToken(String securityToken) {
this.securityToken = securityToken;
return this;
}
public String getSecurityToken() {
return this.securityToken;
}
public StartDomainRequest setVersion(String version) {
this.version = version;
return this;
}
public String getVersion() {
return this.version;
}
public StartDomainRequest setDomain(String domain) {
this.domain = domain;
return this;
}
public String getDomain() {
return this.domain;
}
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
c3934a084ab04dfa7edc5bd572cf09eb58e922af | cbc61ffb33570a1bc55bb1e754510192b0366de2 | /ole-app/olefs/src/main/java/org/kuali/ole/describe/controller/OleShelvingSchemeController.java | c1192b403efefef58d618f3789e66243615f6229 | [
"ECL-2.0"
] | permissive | VU-libtech/OLE-INST | 42b3656d145a50deeb22f496f6f430f1d55283cb | 9f5efae4dfaf810fa671c6ac6670a6051303b43d | refs/heads/master | 2021-07-08T11:01:19.692655 | 2015-05-15T14:40:50 | 2015-05-15T14:40:50 | 24,459,494 | 1 | 0 | ECL-2.0 | 2021-04-26T17:01:11 | 2014-09-25T13:40:33 | Java | UTF-8 | Java | false | false | 8,085 | java | package org.kuali.ole.describe.controller;
import org.kuali.ole.OLEConstants;
import org.kuali.ole.describe.bo.OleShelvingScheme;
import org.kuali.rice.core.api.util.RiceKeyConstants;
import org.kuali.rice.krad.document.Document;
import org.kuali.rice.krad.maintenance.MaintenanceDocument;
import org.kuali.rice.krad.service.KRADServiceLocator;
import org.kuali.rice.krad.uif.UifConstants;
import org.kuali.rice.krad.util.GlobalVariables;
import org.kuali.rice.krad.web.controller.MaintenanceDocumentController;
import org.kuali.rice.krad.web.form.DocumentFormBase;
import org.kuali.rice.krad.web.form.MaintenanceDocumentForm;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Created with IntelliJ IDEA.
* User: ?
* Date: 1/24/13
* Time: 6:00 PM
* To change this template use File | Settings | File Templates.
*/
@Controller
@RequestMapping(value = "/shelvingSchemeMaintenance")
public class OleShelvingSchemeController extends MaintenanceDocumentController {
@RequestMapping(params = "methodToCall=blanketApprove")
public ModelAndView blanketApprove(@ModelAttribute("KualiForm") DocumentFormBase form, BindingResult result,
HttpServletRequest request, HttpServletResponse response) throws Exception {
MaintenanceDocumentForm maintenanceForm = (MaintenanceDocumentForm) form;
MaintenanceDocument maintenanceDocument = (MaintenanceDocument) form.getDocument();
OleShelvingScheme oleShelvingScheme = (OleShelvingScheme) maintenanceDocument.getDocumentDataObject();
OleShelvingScheme oleShelvingSchemeOld = (OleShelvingScheme) maintenanceDocument.getOldMaintainableObject().getDataObject();
String shelvingSchemeCodeOld = oleShelvingSchemeOld.getShelvingSchemeCode();
Map<String, String> shelvingSchemeMap = new HashMap<String, String>();
shelvingSchemeMap.put(OLEConstants.OleShelvingScheme.SHELVING_SCHEME_CD, oleShelvingScheme.getShelvingSchemeCode());
List<OleShelvingScheme> shelvingSchemeInDatabase = (List<OleShelvingScheme>) KRADServiceLocator.getBusinessObjectService().findMatching(OleShelvingScheme.class, shelvingSchemeMap);
if ("Edit".equals(maintenanceDocument.getNewMaintainableObject().getMaintenanceAction())) {
Document document = form.getDocument();
String successMessageKey = null;
if (oleShelvingScheme.getShelvingSchemeCode().equals(shelvingSchemeCodeOld) || shelvingSchemeInDatabase.size() == 0) {
getDocumentService().blanketApproveDocument(document, form.getAnnotation(), combineAdHocRecipients(
form));
successMessageKey = RiceKeyConstants.MESSAGE_ROUTE_APPROVED;
GlobalVariables.getMessageMap().putInfo(OLEConstants.OleAccessMethod.ACCESS_METHOD_CODE, "message.route.approved");
return getUIFModelAndView(form);
} else {
if (shelvingSchemeInDatabase.size() > 0) {
for (OleShelvingScheme shelvingSchemeObj : shelvingSchemeInDatabase) {
String shelvingSchemeId = shelvingSchemeObj.getShelvingSchemeId().toString();
//String accessMethodCode=accessMehtodObj.getAccessMethodCode();
if (null == oleShelvingScheme.getShelvingSchemeId() ||
!(oleShelvingScheme.getShelvingSchemeId().equals(shelvingSchemeId))) {
GlobalVariables.getMessageMap().putError(OLEConstants.OleShelvingScheme.SHELVING_SCHEME_CODE, "error.duplicate.code.shelving");
return getUIFModelAndView(form);
}
getDocumentService().blanketApproveDocument(document, form.getAnnotation(), combineAdHocRecipients(
form));
successMessageKey = RiceKeyConstants.MESSAGE_ROUTE_APPROVED;
GlobalVariables.getMessageMap().putInfo(OLEConstants.OleShelvingScheme.SHELVING_SCHEME_CODE, "message.route.approved");
return getUIFModelAndView(form);
}
}
}
} else if ("Copy".equals(maintenanceDocument.getNewMaintainableObject().getMaintenanceAction())) {
String successMessageKey = null;
Document document = form.getDocument();
if (shelvingSchemeInDatabase.size() == 0) {
getDocumentService().blanketApproveDocument(document, form.getAnnotation(), combineAdHocRecipients(
form));
successMessageKey = RiceKeyConstants.MESSAGE_ROUTE_APPROVED;
GlobalVariables.getMessageMap().putInfo(OLEConstants.OleShelvingScheme.SHELVING_SCHEME_CODE, "message.route.approved");
return getUIFModelAndView(form);
} else if ((shelvingSchemeInDatabase.size() > 0)) {
for (OleShelvingScheme shelvingSchemeObj : shelvingSchemeInDatabase) {
String shelvingSchemeId = shelvingSchemeObj.getShelvingSchemeId().toString();
if (null == oleShelvingScheme.getShelvingSchemeId() ||
!(oleShelvingScheme.getShelvingSchemeId().equals(shelvingSchemeId))) {
GlobalVariables.getMessageMap().putError(OLEConstants.OleShelvingScheme.SHELVING_SCHEME_CODE, "error.duplicate.code.shelving");
return getUIFModelAndView(form);
}
}
}
} else if ("New".equals(maintenanceDocument.getNewMaintainableObject().getMaintenanceAction())) {
String successMessageKey = null;
Document document = form.getDocument();
if (shelvingSchemeInDatabase.size() == 0) {
getDocumentService().blanketApproveDocument(document, form.getAnnotation(), combineAdHocRecipients(
form));
successMessageKey = RiceKeyConstants.MESSAGE_ROUTE_APPROVED;
GlobalVariables.getMessageMap().putInfo(OLEConstants.OleShelvingScheme.SHELVING_SCHEME_CODE, "message.route.approved");
return getUIFModelAndView(form);
} else if ((shelvingSchemeInDatabase.size() > 0)) {
for (OleShelvingScheme shelvingSchemeObj : shelvingSchemeInDatabase) {
String shelvingSchemeId = shelvingSchemeObj.getShelvingSchemeId().toString();
if (null == oleShelvingScheme.getShelvingSchemeId() ||
!(oleShelvingScheme.getShelvingSchemeId().equals(shelvingSchemeId))) {
GlobalVariables.getMessageMap().putError(OLEConstants.OleShelvingScheme.SHELVING_SCHEME_CODE, "error.duplicate.code.shelving");
return getUIFModelAndView(form);
}
}
}
}
/* if((shelvingSchemeInDatabase.size() > 0)) {
for(OleShelvingScheme shelvingSchemeObj : shelvingSchemeInDatabase){
String shelvingSchemeId = shelvingSchemeObj.getShelvingSchemeId().toString();
if (null == oleShelvingScheme.getShelvingSchemeId() ||
!(oleShelvingScheme.getShelvingSchemeId().equals(shelvingSchemeId))) {
GlobalVariables.getMessageMap().putError(OLEConstants.OleShelvingScheme.SHELVING_SCHEME_CODE, "error.duplicate.code");
return getUIFModelAndView(form);
}
}
}*/
performWorkflowAction(form, UifConstants.WorkflowAction.BLANKETAPPROVE, true);
return returnToPrevious(form);
}
}
| [
"david.lacy@villanova.edu"
] | david.lacy@villanova.edu |
744f7722dc260ed8cf1a77b81986e01f73ccd5bb | 79792498d7c7327fe3678b0852c371e35229728b | /src/uk/org/whitecottage/visio/jaxb/visio2003/EnableFillPropsType.java | 468f641408ee631e5fc93c8674f6a85d6b5f246d | [] | no_license | olivergardiner/visio | da001645515b2b6cbe827dd8106b2dbe6165e027 | 32f3a29fdc03952a3bb8a81ff4b8eb8a67ac0cec | refs/heads/master | 2021-01-01T20:11:17.816775 | 2015-12-02T09:24:42 | 2015-12-02T09:24:42 | 39,273,303 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,090 | 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: 2015.06.30 at 04:02:16 PM BST
//
package uk.org.whitecottage.visio.jaxb.visio2003;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for EnableFillProps_Type complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="EnableFillProps_Type">
* <simpleContent>
* <extension base="<http://schemas.microsoft.com/visio/2003/core>Cell_Type">
* </extension>
* </simpleContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "EnableFillProps_Type")
public class EnableFillPropsType
extends CellType
{
}
| [
"olivergardiner@whitecottage.org.uk"
] | olivergardiner@whitecottage.org.uk |
3c59b42028e994dfb56e0edd314e6975af62fe85 | ffbfb7e59ee3b5b4d1ac5ea1fcc20e24f8aa04f7 | /app/src/main/java/com/booknara/whatisrunning/logic/Android5RunningAppsHandler.java | cc3a699291dd7d703270af73bf8fd4f2564e0aac | [
"Apache-2.0"
] | permissive | booknara/WhatIsRunning | 5d48fc648c201a0b71c9fd7f53ab804cb0623d52 | ded88f1d26d2d6a540ec1cef589ce6e7a73be894 | refs/heads/master | 2021-01-01T18:37:41.352385 | 2015-08-07T23:03:14 | 2015-08-07T23:03:14 | 29,324,983 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,003 | java | package com.booknara.whatisrunning.logic;
import android.app.ActivityManager;
import android.content.ComponentName;
import android.content.Context;
import android.text.TextUtils;
import android.util.Log;
import java.lang.reflect.Field;
import java.util.List;
/**
* @author : Daehee Han(@daniel_booknara)
*/
public class Android5RunningAppsHandler implements IRunningAppsHandler {
private static final String TAG = Android5RunningAppsHandler.class.getSimpleName();
private final ActivityManager activityManager;
private volatile Class cachedProcessInfoClass = null;
private volatile Field cachedProcessStateField = null;
private final int PROCESS_STATE_TOP;
public Android5RunningAppsHandler(Context context) {
activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
try {
Class activityManagerClass = Class.forName(activityManager.getClass().getName());
PROCESS_STATE_TOP = activityManagerClass.getField("PROCESS_STATE_TOP").getInt(activityManager);
} catch (Throwable t) {
Log.e(TAG, t.getMessage());
throw new RuntimeException(t);
}
}
@Override
public ComponentName getRunningApplication() {
List<ActivityManager.RunningAppProcessInfo> runningAppProcessInfo = activityManager.getRunningAppProcesses();
if (runningAppProcessInfo != null) {
// if not isInCall do regular running app handling
for (ActivityManager.RunningAppProcessInfo processInfo : runningAppProcessInfo) {
try {
int processState = getProcessStateFieldValue(processInfo);
if (processState == PROCESS_STATE_TOP) {
if (!TextUtils.isEmpty(processInfo.processName)) {
String processName = processInfo.processName.split(":")[0];
for (String pkgName : processInfo.pkgList) {
if (processName.equalsIgnoreCase(pkgName)) {
return new ComponentName(pkgName, pkgName);
}
}
}
}
} catch (Throwable t) {
Log.e(TAG, t.getMessage());
}
}
}
return null;
}
private int getProcessStateFieldValue(ActivityManager.RunningAppProcessInfo processInfo) {
try {
if(processInfo.getClass().equals(cachedProcessInfoClass))
return cachedProcessStateField.getInt(processInfo);
cachedProcessInfoClass = Class.forName(processInfo.getClass().getName());
cachedProcessStateField = cachedProcessInfoClass.getField("processState");
return cachedProcessStateField.getInt(processInfo);
} catch (Throwable t) {
Log.e(TAG, t.getMessage());
}
return -1;
}
}
| [
"bookdori81@gmail.com"
] | bookdori81@gmail.com |
947acf17ff5720352d207a02a94e7b593820d07c | 7f785360d78bb5bb91c50e788c0ad6f3081741f2 | /results/jGenProg+MinImpact/EvoSuite Tests/Math/Math81/seed19/generatedTests/org/apache/commons/math/linear/EigenDecompositionImpl_ESTest_scaffolding.java | 52ea005c99dd88600571b66b97c79b8cce139439 | [] | no_license | Spirals-Team/test4repair-experiments | 390a65cca4e2c0d3099423becfdc47bae582c406 | 5bf4dabf0ccf941d4c4053b6a0909f106efa24b5 | refs/heads/master | 2021-01-13T09:47:18.746481 | 2020-01-27T03:26:15 | 2020-01-27T03:26:15 | 69,664,991 | 5 | 6 | null | 2020-10-13T05:57:11 | 2016-09-30T12:28:13 | Java | UTF-8 | Java | false | false | 6,038 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Fri Jan 20 03:10:57 GMT 2017
*/
package org.apache.commons.math.linear;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
import org.evosuite.runtime.sandbox.Sandbox;
import org.evosuite.runtime.sandbox.Sandbox.SandboxMode;
@EvoSuiteClassExclude
public class EigenDecompositionImpl_ESTest_scaffolding {
@org.junit.Rule
public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
@BeforeClass
public static void initEvoSuiteFramework() {
org.evosuite.runtime.RuntimeSettings.className = "org.apache.commons.math.linear.EigenDecompositionImpl";
org.evosuite.runtime.GuiSupport.initialize();
org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100;
org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000;
org.evosuite.runtime.RuntimeSettings.mockSystemIn = true;
org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED;
org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT();
org.evosuite.runtime.classhandling.JDKClassResetter.init();
setSystemProperties();
initializeClasses();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
}
public static void setSystemProperties() {
/*No java.lang.System property to set*/
}
private static void initializeClasses() {
org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(EigenDecompositionImpl_ESTest_scaffolding.class.getClassLoader() ,
"org.apache.commons.math.linear.BlockFieldMatrix",
"org.apache.commons.math.MathException",
"org.apache.commons.math.linear.EigenDecompositionImpl",
"org.apache.commons.math.linear.DecompositionSolver",
"org.apache.commons.math.linear.RealVectorFormat",
"org.apache.commons.math.linear.TriDiagonalTransformer",
"org.apache.commons.math.ConvergenceException",
"org.apache.commons.math.linear.AbstractRealMatrix$5",
"org.apache.commons.math.linear.SingularMatrixException",
"org.apache.commons.math.linear.MatrixUtils",
"org.apache.commons.math.linear.AnyMatrix",
"org.apache.commons.math.linear.FieldMatrixChangingVisitor",
"org.apache.commons.math.linear.RealMatrix",
"org.apache.commons.math.MaxIterationsExceededException",
"org.apache.commons.math.linear.Array2DRowRealMatrix",
"org.apache.commons.math.linear.RealMatrixPreservingVisitor",
"org.apache.commons.math.linear.EigenDecomposition",
"org.apache.commons.math.linear.FieldMatrixPreservingVisitor",
"org.apache.commons.math.linear.NonSquareMatrixException",
"org.apache.commons.math.linear.MatrixVisitorException",
"org.apache.commons.math.linear.MatrixIndexException",
"org.apache.commons.math.linear.AbstractRealMatrix",
"org.apache.commons.math.linear.DefaultRealMatrixPreservingVisitor",
"org.apache.commons.math.util.CompositeFormat",
"org.apache.commons.math.linear.AbstractFieldMatrix",
"org.apache.commons.math.linear.BigMatrix",
"org.apache.commons.math.linear.FieldVector",
"org.apache.commons.math.linear.Array2DRowFieldMatrix",
"org.apache.commons.math.linear.BlockRealMatrix",
"org.apache.commons.math.linear.EigenDecompositionImpl$Solver",
"org.apache.commons.math.MathRuntimeException",
"org.apache.commons.math.linear.InvalidMatrixException",
"org.apache.commons.math.linear.RealVector",
"org.apache.commons.math.linear.ArrayRealVector",
"org.apache.commons.math.MathRuntimeException$1",
"org.apache.commons.math.linear.RealMatrixChangingVisitor",
"org.apache.commons.math.MathRuntimeException$2",
"org.apache.commons.math.linear.FieldMatrix",
"org.apache.commons.math.MathRuntimeException$3",
"org.apache.commons.math.MathRuntimeException$4",
"org.apache.commons.math.MathRuntimeException$5",
"org.apache.commons.math.MathRuntimeException$6",
"org.apache.commons.math.MathRuntimeException$7",
"org.apache.commons.math.MathRuntimeException$8",
"org.apache.commons.math.MathRuntimeException$10",
"org.apache.commons.math.MathRuntimeException$9",
"org.apache.commons.math.linear.EigenDecompositionImpl$1"
);
}
private static void resetClasses() {
org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(EigenDecompositionImpl_ESTest_scaffolding.class.getClassLoader());
org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
"org.apache.commons.math.linear.EigenDecompositionImpl",
"org.apache.commons.math.linear.ArrayRealVectorTest$RealVectorTestImpl",
"org.apache.commons.math.linear.SparseRealVectorTest$SparseRealVectorTestImpl",
"org.apache.commons.math.linear.OpenMapRealVector",
"org.apache.commons.math.util.OpenIntToDoubleHashMap",
"org.apache.commons.math.util.CompositeFormat",
"org.apache.commons.math.linear.RealVectorFormat",
"org.apache.commons.math.linear.ArrayRealVector",
"org.apache.commons.math.linear.Array2DRowRealMatrix",
"org.apache.commons.math.MathRuntimeException",
"org.apache.commons.math.linear.InvalidMatrixException",
"org.apache.commons.math.linear.MatrixIndexException",
"org.apache.commons.math.MathRuntimeException$4",
"org.apache.commons.math.MathException",
"org.apache.commons.math.ConvergenceException",
"org.apache.commons.math.MaxIterationsExceededException",
"org.apache.commons.math.linear.NonSquareMatrixException"
);
}
}
| [
"martin.monperrus@gnieh.org"
] | martin.monperrus@gnieh.org |
fbdf5ba900726638bb43fc84d7a439642c04253e | 6baf1fe00541560788e78de5244ae17a7a2b375a | /hollywood/com.oculus.socialplatform-base/sources/libraries/marauder/analytics/AnalyticsEventBase.java | 32b41777c865225aacb7bc2372b98cb4eeee3186 | [] | no_license | phwd/quest-tracker | 286e605644fc05f00f4904e51f73d77444a78003 | 3d46fbb467ba11bee5827f7cae7dfeabeb1fd2ba | refs/heads/main | 2023-03-29T20:33:10.959529 | 2021-04-10T22:14:11 | 2021-04-10T22:14:11 | 357,185,040 | 4 | 2 | null | 2021-04-12T12:28:09 | 2021-04-12T12:28:08 | null | UTF-8 | Java | false | false | 2,722 | java | package libraries.marauder.analytics;
import libraries.debug.log.BLog;
import org.json.JSONException;
import org.json.JSONObject;
public class AnalyticsEventBase implements IAnalyticsEvent {
public static final String EXTRAS_KEY = "extra";
public static final String NAME_KEY = "name";
public static final String TAG = "FlatAnalyticsEvent";
public static final String TIME_KEY = "time";
public JSONObject mExtras = new JSONObject();
public final JSONObject mPayload = new JSONObject();
@Override // libraries.marauder.analytics.IAnalyticsEvent
public void log() {
Analytics.sLogger.reportEvent(this);
}
@Override // libraries.marauder.analytics.IAnalyticsEvent
public AnalyticsEventBase addExtra(String str, double d) {
try {
this.mExtras.put(str, d);
return this;
} catch (JSONException e) {
BLog.e(TAG, "", e);
return this;
}
}
@Override // libraries.marauder.analytics.IAnalyticsEvent
public AnalyticsEventBase addExtra(String str, int i) {
try {
this.mExtras.put(str, i);
return this;
} catch (JSONException e) {
BLog.e(TAG, "", e);
return this;
}
}
@Override // libraries.marauder.analytics.IAnalyticsEvent
public AnalyticsEventBase addExtra(String str, long j) {
try {
this.mExtras.put(str, j);
return this;
} catch (JSONException e) {
BLog.e(TAG, "", e);
return this;
}
}
@Override // libraries.marauder.analytics.IAnalyticsEvent
public AnalyticsEventBase addExtra(String str, String str2) {
try {
this.mExtras.put(str, str2);
return this;
} catch (JSONException e) {
BLog.e(TAG, "", e);
return this;
}
}
@Override // libraries.marauder.analytics.IAnalyticsEvent
public AnalyticsEventBase addExtra(String str, boolean z) {
try {
this.mExtras.put(str, z);
return this;
} catch (JSONException e) {
BLog.e(TAG, "", e);
return this;
}
}
@Override // libraries.marauder.analytics.IAnalyticsEvent
public AnalyticsEventBase setTime(long j) {
try {
this.mPayload.put(TIME_KEY, AnalyticsUtil.formatServerTime(j));
return this;
} catch (JSONException e) {
BLog.e(TAG, "", e);
return this;
}
}
@Override // libraries.marauder.analytics.IAnalyticsEvent
public AnalyticsEventBase setUserId(String str) {
addExtra("pk", str);
return this;
}
}
| [
"cyuubiapps@gmail.com"
] | cyuubiapps@gmail.com |
04f6b9d990a7e9691642957c505746829b29858e | 98c049efdfebfafc5373897d491271b4370ab9b4 | /src/main/java/lapr/project/model/Order.java | d35fb0c56e5adbd1bb0379897d020d2f922cbf3d | [] | no_license | antoniodanielbf-isep/LAPR3-2020 | 3a4f4cc608804f70cc87a3ccb29cbc05f5edf0f3 | 7ee16e8c995aea31c30c858f93e8ebdf1de7617f | refs/heads/main | 2023-05-27T14:42:05.442427 | 2021-06-20T18:09:59 | 2021-06-20T18:09:59 | 378,709,095 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,926 | java | package lapr.project.model;
import java.time.LocalDateTime;
import java.util.Objects;
/**
* The type Order.
*/
public class Order {
private int id;
private LocalDateTime orderDate;
private int stateId;
/**
* Instantiates a new Order.
*
* @param id the id
* @param orderDate the order date
* @param stateId the state id
*/
public Order(int id, LocalDateTime orderDate, int stateId) {
this.id = id;
this.orderDate = orderDate;
this.stateId = stateId;
}
/**
* Gets id.
*
* @return the id
*/
public int getId() {
return id;
}
/**
* Sets id.
*
* @param id the id
*/
public void setId(int id) {
this.id = id;
}
/**
* Gets order date.
*
* @return the order date
*/
public LocalDateTime getOrderDate() {
return orderDate;
}
/**
* Sets order date.
*
* @param orderDate the order date
*/
public void setOrderDate(LocalDateTime orderDate) {
this.orderDate = orderDate;
}
/**
* Gets state id.
*
* @return the state id
*/
public int getStateId() {
return stateId;
}
/**
* Sets state id.
*
* @param stateId the state id
*/
public void setStateId(int stateId) {
this.stateId = stateId;
}
@Override
public String toString() {
return "Order:" +
"id=" + id +
", orderDate=" + orderDate +
", stateId=" + stateId
;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Order)) return false;
Order order = (Order) o;
return getId() == order.getId();
}
@Override
public int hashCode() {
return Objects.hash(getId());
}
} | [
"1190402@isep.ipp.pt"
] | 1190402@isep.ipp.pt |
92babb9e8df7cc530fc8f22d6878a67277b4c120 | dce6c0fa6cc9f26315c69c626acddf01d1a120e4 | /Backend/JAVA/Complete Java Masterclass/sec_7/s7_5/src/Animal.java | 3efd3c3d1ef1794555047dc2071e55ea2989d81c | [
"MIT"
] | permissive | specter01wj/LAB-Udemy | 5df55e82c11eb2ef881045082d11791bfd307ae2 | 6bbb779c2d3efc84671674c124ae751bfb126a7e | refs/heads/master | 2023-08-19T03:21:15.081682 | 2023-08-18T03:30:02 | 2023-08-18T03:30:02 | 102,077,376 | 1 | 0 | MIT | 2023-03-06T07:39:10 | 2017-09-01T05:36:39 | HTML | UTF-8 | Java | false | false | 762 | java |
public class Animal {
private String name;
private int brain;
private int body;
private int size;
private int weight;
public Animal(String name, int brain, int body, int size, int weight) {
this.name = name;
this.brain = brain;
this.body = body;
this.size = size;
this.weight = weight;
}
public void eat() {
System.out.println("Animal.eat() called");
}
public void move() {
}
public String getName() {
return name;
}
public int getBrain() {
return brain;
}
public int getBody() {
return body;
}
public int getSize() {
return size;
}
public int getWeight() {
return weight;
}
}
| [
"specter01wj@gmail.com"
] | specter01wj@gmail.com |
3dd848503748d1f9bfb35f8da1b06d482a876ccf | 4de66c464d0fd16801c099805f35a01f3c28be4d | /DP/1912.java | ca8e7439c92ca00a3cedf98e590c11192f7d2f4d | [] | no_license | wlsgussla123/Algorithms | 9ec745dea4e45dbc21fff28119e923b3bedf0b5f | f7fe0c2509dcb852182dd1f8a673991362f6d174 | refs/heads/master | 2021-01-23T09:35:23.721109 | 2020-11-15T06:36:49 | 2020-11-15T06:36:49 | 102,583,416 | 6 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,357 | java | package algo;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Stack;
import java.util.StringTokenizer;
class Task {
private int N;
private int[] dp;
private int[] sequence;
private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
private StringTokenizer st;
private StringTokenizer getStringTokenizer() throws IOException {
return new StringTokenizer(br.readLine(), " ");
}
private void init() {
dp = new int[N+1];
sequence = new int[N+1];
}
// 입력
private void input() throws IOException {
st = getStringTokenizer();
N = Integer.parseInt(st.nextToken());
init();
st= getStringTokenizer();
for(int i=1; i<=N; i++) {
sequence[i] = Integer.parseInt(st.nextToken());
}
}
private void sequenceSum() {
dp[1] = sequence[1];
for(int i=1; i<=N; i++) {
if(dp[i-1] + sequence[i] > sequence[i]) {
dp[i] = dp[i-1] + sequence[i];
} else {
dp[i] = sequence[i];
}
}
int answer = dp[1];
for(int i=2; i<=N; i++) {
if(dp[i] > answer) answer = dp[i];
}
System.out.println(answer);
}
public void run() throws IOException {
input();
sequenceSum();
br.close();
}
}
public class Main {
public static void main(String[] args) throws IOException {
Task task = new Task();
task.run();
}
}
| [
"wlsgussla123@gmail.com"
] | wlsgussla123@gmail.com |
733582ff9d495c5091ba1ec18d7c2e13f63bc9e0 | 77b7f3b87ef44182c5d0efd42ae1539a9b8ca14c | /src/generated/java/com/turnengine/client/api/local/group/AddParentGroupReturnTypeDataSerializer.java | 0bb4e5df5e0fa6e58161e3a3f6544088563bee20 | [] | no_license | robindrew/turnengine-client-api | b4d9e767e9cc8401859758d83b43b0104bce7cd1 | 5bac91a449ad7f55201ecd64e034706b16578c36 | refs/heads/master | 2023-03-16T05:59:14.189396 | 2023-03-08T14:09:24 | 2023-03-08T14:09:24 | 232,931,212 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,253 | java | package com.turnengine.client.api.local.group;
import com.robindrew.common.io.data.IDataReader;
import com.robindrew.common.io.data.IDataWriter;
import com.robindrew.common.io.data.serializer.ObjectSerializer;
import com.robindrew.common.io.data.serializer.lang.StringSerializer;
import java.io.IOException;
public class AddParentGroupReturnTypeDataSerializer extends ObjectSerializer<IAddParentGroup> {
public AddParentGroupReturnTypeDataSerializer() {
super(false);
}
public AddParentGroupReturnTypeDataSerializer(boolean nullable) {
super(nullable);
}
@Override
public IAddParentGroup readValue(IDataReader reader) throws IOException {
long param1 = reader.readLong();
int param2 = reader.readInt();
String param3 = reader.readObject(new StringSerializer(false));
String param4 = reader.readObject(new StringSerializer(false));
return new AddParentGroup(param1, param2, param3, param4);
}
@Override
public void writeValue(IDataWriter writer, IAddParentGroup object) throws IOException {
writer.writeLong(object.getLoginId());
writer.writeInt(object.getInstanceId());
writer.writeObject(object.getName(), new StringSerializer(false));
writer.writeObject(object.getFactionName(), new StringSerializer(false));
}
}
| [
"robin.drew@gmail.com"
] | robin.drew@gmail.com |
15960b287145918c17bccb3d411a62971926c03f | ee9aa986a053e32c38d443d475d364858db86edc | /src/main/java/com/ebay/soap/eBLBaseComponents/BuyerRoleMetricsType.java | 2eebaddb4d6a7ada61621bfd014e76a54fe799f3 | [
"Apache-2.0"
] | permissive | modelccc/springarin_erp | 304db18614f69ccfd182ab90514fc1c3a678aaa8 | 42eeb70ee6989b4b985cfe20472240652ec49ab8 | refs/heads/master | 2020-05-15T13:10:21.874684 | 2018-05-24T15:39:20 | 2018-05-24T15:39:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,155 | java |
package com.ebay.soap.eBLBaseComponents;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import org.w3c.dom.Element;
/**
*
* Type defining the <b>BuyerRoleMetrics</b> container which is returned in the <b>GetFeedback</b> response. the <b>BuyerRoleMetrics</b> container consists of a eBay user's feedback statistics for the latest one-year period, dating back from the current date.
*
*
* <p>Java class for BuyerRoleMetricsType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="BuyerRoleMetricsType">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="PositiveFeedbackLeftCount" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
* <element name="NegativeFeedbackLeftCount" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
* <element name="NeutralFeedbackLeftCount" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
* <element name="FeedbackLeftPercent" type="{http://www.w3.org/2001/XMLSchema}float" minOccurs="0"/>
* <any/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "BuyerRoleMetricsType", propOrder = {
"positiveFeedbackLeftCount",
"negativeFeedbackLeftCount",
"neutralFeedbackLeftCount",
"feedbackLeftPercent",
"any"
})
public class BuyerRoleMetricsType
implements Serializable
{
private final static long serialVersionUID = 12343L;
@XmlElement(name = "PositiveFeedbackLeftCount")
protected Integer positiveFeedbackLeftCount;
@XmlElement(name = "NegativeFeedbackLeftCount")
protected Integer negativeFeedbackLeftCount;
@XmlElement(name = "NeutralFeedbackLeftCount")
protected Integer neutralFeedbackLeftCount;
@XmlElement(name = "FeedbackLeftPercent")
protected Float feedbackLeftPercent;
@XmlAnyElement(lax = true)
protected List<Object> any;
/**
* Gets the value of the positiveFeedbackLeftCount property.
*
* @return
* possible object is
* {@link Integer }
*
*/
public Integer getPositiveFeedbackLeftCount() {
return positiveFeedbackLeftCount;
}
/**
* Sets the value of the positiveFeedbackLeftCount property.
*
* @param value
* allowed object is
* {@link Integer }
*
*/
public void setPositiveFeedbackLeftCount(Integer value) {
this.positiveFeedbackLeftCount = value;
}
/**
* Gets the value of the negativeFeedbackLeftCount property.
*
* @return
* possible object is
* {@link Integer }
*
*/
public Integer getNegativeFeedbackLeftCount() {
return negativeFeedbackLeftCount;
}
/**
* Sets the value of the negativeFeedbackLeftCount property.
*
* @param value
* allowed object is
* {@link Integer }
*
*/
public void setNegativeFeedbackLeftCount(Integer value) {
this.negativeFeedbackLeftCount = value;
}
/**
* Gets the value of the neutralFeedbackLeftCount property.
*
* @return
* possible object is
* {@link Integer }
*
*/
public Integer getNeutralFeedbackLeftCount() {
return neutralFeedbackLeftCount;
}
/**
* Sets the value of the neutralFeedbackLeftCount property.
*
* @param value
* allowed object is
* {@link Integer }
*
*/
public void setNeutralFeedbackLeftCount(Integer value) {
this.neutralFeedbackLeftCount = value;
}
/**
* Gets the value of the feedbackLeftPercent property.
*
* @return
* possible object is
* {@link Float }
*
*/
public Float getFeedbackLeftPercent() {
return feedbackLeftPercent;
}
/**
* Sets the value of the feedbackLeftPercent property.
*
* @param value
* allowed object is
* {@link Float }
*
*/
public void setFeedbackLeftPercent(Float value) {
this.feedbackLeftPercent = value;
}
/**
*
*
* @return
* array of
* {@link Object }
* {@link Element }
*
*/
public Object[] getAny() {
if (this.any == null) {
return new Object[ 0 ] ;
}
return ((Object[]) this.any.toArray(new Object[this.any.size()] ));
}
/**
*
*
* @return
* one of
* {@link Object }
* {@link Element }
*
*/
public Object getAny(int idx) {
if (this.any == null) {
throw new IndexOutOfBoundsException();
}
return this.any.get(idx);
}
public int getAnyLength() {
if (this.any == null) {
return 0;
}
return this.any.size();
}
/**
*
*
* @param values
* allowed objects are
* {@link Object }
* {@link Element }
*
*/
public void setAny(Object[] values) {
this._getAny().clear();
int len = values.length;
for (int i = 0; (i<len); i ++) {
this.any.add(values[i]);
}
}
protected List<Object> _getAny() {
if (any == null) {
any = new ArrayList<Object>();
}
return any;
}
/**
*
*
* @param value
* allowed object is
* {@link Object }
* {@link Element }
*
*/
public Object setAny(int idx, Object value) {
return this.any.set(idx, value);
}
}
| [
"601906911@qq.com"
] | 601906911@qq.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.