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
51a2a8551f641740fd61c264efa7006e2cc76845
218785d0caefcfc7ef9e39850a4649842144ed86
/src/main/java/com/jsen/test/dubbo/BootConsumer.java
3fcc638a94f9f26e98a55950aed95c45f623d41e
[]
no_license
jsenjobs/DubboTest
b7042840ffcb4c2bd8a610eafd426ff6022b47ac
a6cb4c5efaafd860e918cd6f4ccf8a31744c3cdf
refs/heads/master
2021-04-18T21:37:22.154086
2018-03-21T09:03:32
2018-03-21T09:03:32
126,151,304
0
0
null
null
null
null
UTF-8
Java
false
false
723
java
package com.jsen.test.dubbo; import com.jsen.test.dubbo.iface.HelloService; import org.springframework.context.support.ClassPathXmlApplicationContext; public class BootConsumer { public static void main(String[] args) throws InterruptedException { System.setProperty("java.net.preferIPv4Stack", "true"); ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[] {"META-INF/spring/dubbo-consumer.xml"}); context.start(); HelloService helloService = (HelloService)context.getBean("demoService"); int i = 0; while (true) { Thread.sleep(1000); System.out.println(helloService.hello("jsen" + ++i)); } } }
[ "jsen1922279340@163.com" ]
jsen1922279340@163.com
103972433fca3a6bff7018495ef3de5299a2882d
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
/benchmark/test/com/alibaba/druid/bvt/sql/sqlserver/SQLServerCommitTest.java
3eca171a0e04d47795dca9a4e65fcd506d27d63f
[]
no_license
STAMP-project/dspot-experiments
f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5
121487e65cdce6988081b67f21bbc6731354a47f
refs/heads/master
2023-02-07T14:40:12.919811
2019-11-06T07:17:09
2019-11-06T07:17:09
75,710,758
14
19
null
2023-01-26T23:57:41
2016-12-06T08:27:42
null
UTF-8
Java
false
false
2,263
java
/** * Copyright 1999-2018 Alibaba Group Holding Ltd. * * 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.alibaba.druid.bvt.sql.sqlserver; import JdbcUtils.SQL_SERVER; import com.alibaba.druid.sql.SQLUtils; import com.alibaba.druid.sql.ast.SQLStatement; import com.alibaba.druid.sql.dialect.sqlserver.parser.SQLServerStatementParser; import java.util.List; import junit.framework.TestCase; import org.junit.Assert; public class SQLServerCommitTest extends TestCase { public void test_0() { String sql = "COMMIT WORK"; SQLServerStatementParser parser = new SQLServerStatementParser(sql); List<SQLStatement> stmtList = parser.parseStatementList(); Assert.assertEquals(1, stmtList.size()); String text = SQLUtils.toSQLString(stmtList, SQL_SERVER); Assert.assertEquals("COMMIT WORK", text); } public void test_1() { String sql = "COMMIT TRAN"; SQLServerStatementParser parser = new SQLServerStatementParser(sql); List<SQLStatement> stmtList = parser.parseStatementList(); Assert.assertEquals(1, stmtList.size()); String text = SQLUtils.toSQLString(stmtList, SQL_SERVER); Assert.assertEquals("COMMIT TRANSACTION", text); } public void test_2() { String sql = "COMMIT TRANSACTION @tran_name_variable WITH ( DELAYED_DURABILITY = OFF )"; SQLServerStatementParser parser = new SQLServerStatementParser(sql); List<SQLStatement> stmtList = parser.parseStatementList(); Assert.assertEquals(1, stmtList.size()); String text = SQLUtils.toSQLString(stmtList, SQL_SERVER); Assert.assertEquals("COMMIT TRANSACTION @tran_name_variable WITH ( DELAYED_DURABILITY = OFF )", text); } }
[ "benjamin.danglot@inria.fr" ]
benjamin.danglot@inria.fr
25f2e834b8e39f6ddebeb3c379cb5eaec9aab4f5
a96464b6a7a487842b123a967ad79efb42dcdcea
/src/dataProviderDemos/AddCustomerDemo.java
e9e63f8619643d64fa656cb4fe2e9178c5223488
[]
no_license
amolujagare123/Selenium730BatchAugust2020
6f74c1fe7f63738174eca58ded379196c8af2f4b
a447e88f683f40b6ccd2a5316641e0b69ed8004d
refs/heads/master
2022-12-27T22:13:23.155259
2020-10-12T15:08:03
2020-10-12T15:08:03
292,619,312
0
0
null
null
null
null
UTF-8
Java
false
false
2,968
java
package dataProviderDemos; import io.github.bonigarcia.wdm.WebDriverManager; import org.apache.poi.hssf.usermodel.HSSFRow; import org.apache.poi.xssf.usermodel.XSSFCell; import org.apache.poi.xssf.usermodel.XSSFRow; import org.apache.poi.xssf.usermodel.XSSFSheet; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.testng.annotations.BeforeClass; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.util.concurrent.TimeUnit; public class AddCustomerDemo { WebDriver driver; @BeforeClass public void myMethod() { WebDriverManager.chromedriver().setup(); driver = new ChromeDriver(); driver.manage().window().maximize(); driver.get("http://stock.scriptinglogic.net/"); WebElement txtUsername = driver.findElement(By.id("login-username")); // now lets type into the textbox ----> use sendKeys("text") txtUsername.sendKeys("admin"); WebElement txtPassword = driver.findElement(By.id("login-password")); txtPassword.sendKeys("admin"); WebElement btnSubmit = driver.findElement(By.name("submit")); btnSubmit.click(); driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); } @Test (dataProvider = "getData") public void addCustomertest(String name,String address ,String contact1,String contact2) { WebElement lnkAddCustomer = driver.findElement(By.linkText("Add Customer")); lnkAddCustomer.click(); WebElement txtName = driver.findElement(By.name("name")); txtName.sendKeys(name); WebElement txtAddress = driver.findElement(By.name("address")); txtAddress.sendKeys(address); WebElement txtContact1 = driver.findElement(By.name("contact1")); txtContact1.sendKeys(contact1); WebElement txtContact2 = driver.findElement(By.name("contact2")); txtContact2.sendKeys(contact2); WebElement btnAdd = driver.findElement(By.name("Submit")); btnAdd.click(); } @DataProvider public Object[][] getData() throws IOException { FileInputStream fp= new FileInputStream("Data\\anotherFile.xlsx"); XSSFWorkbook workbook = new XSSFWorkbook(fp); XSSFSheet sheet = workbook.getSheet("Sheet4"); int rowCount = sheet.getPhysicalNumberOfRows(); Object[][] data = new Object[rowCount][4]; for(int i=0;i<rowCount;i++) { XSSFRow row = sheet.getRow(i); for(int j=0;j<4;j++) { XSSFCell element = row.getCell(j); data[i][j] = element.toString().trim(); } } return data; } }
[ "amolujagare@gmail.com" ]
amolujagare@gmail.com
90ba0352c912034268c99582ddd80c6c359eca48
3f51bc6494a1910a0db9425bc67b867a8100ca4b
/CountOfSmallerNumbersAfterSelf.java
25be555b6aeb7deead3f957d153796f4bf4e171e
[]
no_license
ruudhaya/leetcode
a3e0e6b3bc98bbfce4f9c6e4546d489d9af20e58
87187693fe5e48a278232233abda5ee0f4c2c76a
refs/heads/master
2021-01-22T06:22:54.859858
2017-08-28T04:58:35
2017-08-28T04:58:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,539
java
import java.util.ArrayList; import java.util.List; public class CountOfSmallerNumbersAfterSelf { public List<Integer> countSmaller(int[] nums) { List<Integer> result = new ArrayList<Integer>(); for (int i = 0; i < nums.length; i++) { result.add(0); } NumberAndIndex[] nis = new NumberAndIndex[nums.length]; for (int i = 0; i < nis.length; i++) { nis[i] = new NumberAndIndex(nums[i], i); } sort(result, nis, 0, nums.length - 1); return result; } void sort(List<Integer> result, NumberAndIndex[] nis, int beginIndex, int endIndex) { if (endIndex <= beginIndex) { return; } int middleIndex = (beginIndex + endIndex) / 2; sort(result, nis, beginIndex, middleIndex); sort(result, nis, middleIndex + 1, endIndex); List<NumberAndIndex> merged = new ArrayList<NumberAndIndex>(); int leftIndex = beginIndex; int rightIndex = middleIndex + 1; while (leftIndex <= middleIndex || rightIndex <= endIndex) { if (leftIndex == middleIndex + 1 || (rightIndex != endIndex + 1 && nis[rightIndex].number >= nis[leftIndex].number)) { merged.add(nis[rightIndex]); rightIndex++; } else { result.set(nis[leftIndex].index, result.get(nis[leftIndex].index) + (endIndex + 1 - rightIndex)); merged.add(nis[leftIndex]); leftIndex++; } } for (int i = beginIndex; i <= endIndex; i++) { nis[i] = merged.get(i - beginIndex); } } } class NumberAndIndex { int number; int index; NumberAndIndex(int number, int index) { this.number = number; this.index = index; } }
[ "charles.wangkai@gmail.com" ]
charles.wangkai@gmail.com
9d7b980ab7f0c8827253fe1768f6149fb4612cec
a5d720296be9ebe995db6d101c29bd180f01a164
/src/breder/util/deploy/DeployFrame.java
cd9d6c085ca5e8a51335caa7977b6cc8c810e56c
[]
no_license
bernardobreder/java-utils
5145e012c893bcb3ceab5c70c878f87dfa12902c
a4f82c7f4581b5ffb02c4f02f43f70f345341091
refs/heads/master
2021-07-03T16:59:05.890157
2017-09-23T00:16:05
2017-09-23T00:16:05
104,528,897
0
1
null
null
null
null
UTF-8
Java
false
false
3,745
java
package breder.util.deploy; import java.awt.Component; import java.awt.FlowLayout; import java.awt.GridBagLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.BorderFactory; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JPasswordField; import javax.swing.JProgressBar; import javax.swing.JScrollPane; import javax.swing.JTextArea; import breder.util.swing.GBC; /** * Janela de Deploy * * @author bernardobreder * */ public class DeployFrame extends JFrame { /** Senha */ private JPasswordField password; /** Progresso */ private JProgressBar progress; /** Texto */ private JTextArea area; /** * Construtor */ public DeployFrame() { this.add(this.build()); this.setTitle("Deploy"); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setSize(640, 480); this.setLocationRelativeTo(null); } /** * Constroi a janela * * @return */ private Component build() { JPanel panel = new JPanel(new GridBagLayout()); panel.add(this.buildTextArea(), new GBC(0, 0).both()); panel.add(this.buildProgress(), new GBC(0, 1).horizontal()); panel.add(this.buildPassword(), new GBC(0, 2).horizontal()); panel.add(this.buildButtons(), new GBC(0, 3).horizontal()); return panel; } /** * Janela Texto * * @return componente */ private Component buildTextArea() { this.area = new JTextArea(); JScrollPane scroll = new JScrollPane(area); scroll.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); return scroll; } /** * Janela Texto * * @return componente */ private Component buildProgress() { this.progress = new JProgressBar(0, 100); return progress; } /** * Janela Texto * * @return componente */ private Component buildPassword() { JLabel label = new JLabel("Password :"); this.password = new JPasswordField(); JPanel panel = new JPanel(new GridBagLayout()); panel.add(label, new GBC(0, 0)); panel.add(password, new GBC(1, 0).horizontal()); return panel; } /** * Janela Texto * * @return componente */ private Component buildButtons() { JPanel panel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); { JButton c = new JButton("Ok"); c.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { onOkAction(); } }); this.getRootPane().setDefaultButton(c); panel.add(c); } { JButton c = new JButton("Cancel"); c.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { onCancelAction(); } }); panel.add(c); } return panel; } /** * Ação de cancelar */ protected void onCancelAction() { this.dispose(); } /** * Ação de cancelar */ protected void onOkAction() { } /** * @return the password */ public JPasswordField getPassword() { return password; } /** * @param password the password to set */ public void setPassword(JPasswordField password) { this.password = password; } /** * @return the progress */ public JProgressBar getProgress() { return progress; } /** * @param progress the progress to set */ public void setProgress(JProgressBar progress) { this.progress = progress; } /** * @return the area */ public JTextArea getArea() { return area; } /** * @param area the area to set */ public void setArea(JTextArea area) { this.area = area; } }
[ "bernardobreder@gmail.com" ]
bernardobreder@gmail.com
d3ac4fb7f7746daa8cf2cebfde77b044e864149f
7016cec54fb7140fd93ed805514b74201f721ccd
/src/java/com/echothree/model/control/party/common/transfer/DivisionTransfer.java
fba9d700d8afb27a9bff996bbed464fe7ed345cf
[ "MIT", "Apache-1.1", "Apache-2.0" ]
permissive
echothreellc/echothree
62fa6e88ef6449406d3035de7642ed92ffb2831b
bfe6152b1a40075ec65af0880dda135350a50eaf
refs/heads/master
2023-09-01T08:58:01.429249
2023-08-21T11:44:08
2023-08-21T11:44:08
154,900,256
5
1
null
null
null
null
UTF-8
Java
false
false
2,557
java
// -------------------------------------------------------------------------------- // Copyright 2002-2023 Echo Three, 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. // -------------------------------------------------------------------------------- package com.echothree.model.control.party.common.transfer; import com.echothree.model.control.accounting.common.transfer.CurrencyTransfer; public class DivisionTransfer extends PartyTransfer { private CompanyTransfer company; private String divisionName; private String isDefault; private String sortOrder; /** Creates a new instance of DivisionTransfer */ public DivisionTransfer(String partyName, PartyTypeTransfer partyType, LanguageTransfer preferredLanguage, CurrencyTransfer preferredCurrency, TimeZoneTransfer preferredTimeZone, DateTimeFormatTransfer preferredDateTimeFormat, PersonTransfer person, PartyGroupTransfer partyGroup, CompanyTransfer company, String divisionName, String isDefault, String sortOrder) { super(partyName, partyType, preferredLanguage, preferredCurrency, preferredTimeZone, preferredDateTimeFormat, person, partyGroup, null); this.company = company; this.divisionName = divisionName; this.isDefault = isDefault; this.sortOrder = sortOrder; } public CompanyTransfer getCompany() { return company; } public void setCompany(CompanyTransfer company) { this.company = company; } public String getDivisionName() { return divisionName; } public void setDivisionName(String divisionName) { this.divisionName = divisionName; } public String getIsDefault() { return isDefault; } public void setIsDefault(String isDefault) { this.isDefault = isDefault; } public String getSortOrder() { return sortOrder; } public void setSortOrder(String sortOrder) { this.sortOrder = sortOrder; } }
[ "rich@echothree.com" ]
rich@echothree.com
b8f59004ee7807a9869c486c855dbd28c31a3d8f
e1bb75d04030b514ed13eae594dd70e1474ae953
/src/main/java/com/paladin/framework/excel/Convert.java
f724223602b97f1114cca8d3cb67663db7666e71
[]
no_license
zxwgdft/paladin-vod
84317f8dd938efb1ef63c1b1e50bc73b699da13e
713d1e5f26882fedde4a5e845f8574913f14f128
refs/heads/master
2022-12-09T03:40:48.134894
2020-09-10T01:50:20
2020-09-10T01:50:20
292,524,649
1
0
null
null
null
null
UTF-8
Java
false
false
345
java
package com.paladin.framework.excel; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Target(ElementType.FIELD) @Retention(RetentionPolicy.RUNTIME) public @interface Convert { Class<? extends PropertyConvert<?>> convert(); }
[ "823498927@qq.com" ]
823498927@qq.com
c0eb74d2c25bc4a2614f73a8f5366e1296d08f4c
4aa8f43d1d3e25075f05cd835e0d90fe6143aca4
/Plugins/org.feature.model.constraint.resource.csl.ui/src/gen/java/org/feature/model/constraint/resource/csl/ui/CslCompletionProposal.java
001d57b676f72cc2f7b8f8e431776977c4e1464f
[]
no_license
multi-perspectives/cluster
bb8adb5f1710eb502e1d933375e9d51da9bb2c7c
8c3f2ccfc784fb0e0cce7411f75e18e25735e9f8
refs/heads/master
2016-09-05T11:23:16.096796
2014-03-13T20:07:59
2014-03-13T20:07:59
2,890,695
0
1
null
2012-11-22T14:58:18
2011-12-01T11:41:12
Java
UTF-8
Java
false
false
6,461
java
/** * <copyright> * </copyright> * * */ package org.feature.model.constraint.resource.csl.ui; /** * A proposal for completing an incomplete document. */ public class CslCompletionProposal implements java.lang.Comparable<CslCompletionProposal> { /** * The root object of the resource for which this proposal was computed. */ private org.eclipse.emf.ecore.EObject root; /** * The terminal that was expected at the cursor position. */ private org.feature.model.constraint.resource.csl.mopp.CslExpectedTerminal expectedTerminal; /** * The string that will be inserted if the user picks this proposal. This string * can differ from 'displayString' because usually only the missing part of the * text is inserted and an existing prefix is kept. */ private String insertString; /** * The string that will be shown in the pop-up containing the completion proposals. */ private String displayString; /** * The part of the document right before the cursor that belongs to the proposal. * This may for example be a partial name of a cross-referenced element. */ private String prefix; /** * A flag that indicates whether this proposal is valid w.r.t. the prefix (i.e., * the text that has already been typed). We do keep proposals that do not match * the prefix to allow proposal post processors to access these and add valid * proposals even if the built-in proposal engine did not find a matching * proposal. The completion pop-up will only show proposals for which this method * returns true. See also {@link #getMatchesPrefix()}. */ private boolean matchesPrefix; /** * The structural feature (attribute or non-containment reference) that was * expected at the cursor position. */ private org.eclipse.emf.ecore.EStructuralFeature structuralFeature; /** * The container objects that covers the cursor position. This container object * may not be contained in the resource we're computing proposals for. See {@link * #materialize(Runnable)} for an explanation of this. */ private org.eclipse.emf.ecore.EObject container; /** * The image that will be shown in the pop-up containing the completion proposals. */ private org.eclipse.swt.graphics.Image image; public CslCompletionProposal(org.feature.model.constraint.resource.csl.mopp.CslExpectedTerminal expectedTerminal, String insertString, String prefix, boolean matchesPrefix, org.eclipse.emf.ecore.EStructuralFeature structuralFeature, org.eclipse.emf.ecore.EObject container) { super(); this.expectedTerminal = expectedTerminal; this.insertString = insertString; this.prefix = prefix; this.matchesPrefix = matchesPrefix; this.structuralFeature = structuralFeature; this.container = container; } public CslCompletionProposal(org.feature.model.constraint.resource.csl.mopp.CslExpectedTerminal expectedTerminal, String insertString, String prefix, boolean matchesPrefix, org.eclipse.emf.ecore.EStructuralFeature structuralFeature, org.eclipse.emf.ecore.EObject container, org.eclipse.swt.graphics.Image image) { this(expectedTerminal, insertString, prefix, matchesPrefix, structuralFeature, container); this.image = image; } public CslCompletionProposal(org.feature.model.constraint.resource.csl.mopp.CslExpectedTerminal expectedTerminal, String insertString, String prefix, boolean matchesPrefix, org.eclipse.emf.ecore.EStructuralFeature structuralFeature, org.eclipse.emf.ecore.EObject container, org.eclipse.swt.graphics.Image image, String displayString) { this(expectedTerminal, insertString, prefix, matchesPrefix, structuralFeature, container, image); this.displayString = displayString; } public org.eclipse.emf.ecore.EObject getRoot() { return root; } public void setRoot(org.eclipse.emf.ecore.EObject root) { this.root = root; } public String getInsertString() { return insertString; } public String getDisplayString() { return displayString; } public String getPrefix() { return prefix; } /** * Returns true if this proposal matched the prefix. This does not imply that the * proposal exactly starts with the prefix, it can also match case-insensitive or * using the camel case style. Only proposals that return true will be considered * for the final list of proposals that is presented in the editor. */ public boolean getMatchesPrefix() { return matchesPrefix; } public org.eclipse.swt.graphics.Image getImage() { return image; } public boolean isStructuralFeature() { return structuralFeature != null; } public org.eclipse.emf.ecore.EStructuralFeature getStructuralFeature() { return structuralFeature; } public org.eclipse.emf.ecore.EObject getContainer() { return container; } public org.feature.model.constraint.resource.csl.mopp.CslExpectedTerminal getExpectedTerminal() { return expectedTerminal; } public boolean equals(Object object) { if (object instanceof CslCompletionProposal) { CslCompletionProposal other = (CslCompletionProposal) object; return other.getInsertString().equals(getInsertString()); } return false; } public int hashCode() { return getInsertString().hashCode(); } public int compareTo(CslCompletionProposal object) { if (object instanceof CslCompletionProposal) { CslCompletionProposal other = (CslCompletionProposal) object; // proposals that start with the prefix are preferred over the ones that do not int startCompare = (matchesPrefix ? 1 : 0) - (other.getMatchesPrefix() ? 1 : 0); // if both proposals start with the prefix of both do not the insert string is // compared return startCompare == 0 ? getInsertString().compareTo(other.getInsertString()) : -startCompare; } return -1; } public String toString() { String result = (container == null ? "null" : container.eClass().getName()) + "."; result += (structuralFeature == null ? "null" : structuralFeature.getName()); result += ": " + insertString; return result; } /** * This method creates a model that reflects the state that would be obtained if * this proposal was accepted. This model can differ from the current model, * because different proposals can result in different models. The code that is * passed as argument is executed once the (changed) model was created. After * executing the given code, all changes are reverted. */ public void materialize(Runnable code) { expectedTerminal.materialize(code); } }
[ "julia.schroeter@sap.com" ]
julia.schroeter@sap.com
a425ed6a681374bf4e6f60afb212e0e1dca6db46
8c745997a86a042148adecdc6511b9840e06c2b5
/ops-pc/src/main/java/cn/fooltech/fool_ops/web/basedata/BillRuleController.java
ecf24faecea06404f3a7f65acd2bd9093b7ad47c
[]
no_license
bulison/test
48166eae90e4cda38acd690725a5e1ae19bacc46
680f85ed942a589655b44b2c426adc48d5374c23
refs/heads/master
2021-01-21T23:09:24.394616
2017-06-23T09:19:51
2017-06-23T09:19:51
95,199,624
0
1
null
null
null
null
UTF-8
Java
false
false
2,381
java
package cn.fooltech.fool_ops.web.basedata; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import cn.fooltech.fool_ops.component.core.PageJson; import cn.fooltech.fool_ops.component.core.PageParamater; import cn.fooltech.fool_ops.component.core.RequestResult; import cn.fooltech.fool_ops.domain.basedata.entity.BillRule; import cn.fooltech.fool_ops.domain.basedata.service.BillRuleService; import cn.fooltech.fool_ops.domain.basedata.vo.BillRuleVo; import cn.fooltech.fool_ops.web.base.BaseController; /** * <p>单据单号生成规则</p> * @author rqh * @version 1.0 * @date 2015年9月14日 */ @Controller @RequestMapping("/billrule") public class BillRuleController extends BaseController{ /** * 单据单号生成规则网页服务类 */ @Autowired private BillRuleService ruleService; /** * 管理页面 * @return */ @RequestMapping("/manage") public String manage(){ return "/billRule/billRule"; } /** * 规则列表(JSON) * @param paramater * @return */ @RequestMapping("/list") @ResponseBody public PageJson list(PageParamater paramater){ Page<BillRuleVo> page = ruleService.query(paramater); return new PageJson(page); } /** * 新增规则页面 * @param id 规则ID * @param model * @return */ @RequestMapping("/add") public String add (){ return "/billRule/addBillRule"; } /** * 规则明细页面 * @param id 规则ID * @param model * @return */ @RequestMapping("/detail") public String detail(String id, Model model){ BillRuleVo billRule = ruleService.getById(id); model.addAttribute("billRule", billRule); return "/basedata/billrule/billRuleDetail"; } /** * 编辑页面 * @param id 规则ID * @param model * @return */ @RequestMapping("/edit") public String edit(String id, Model model){ BillRuleVo billRule = ruleService.getById(id); model.addAttribute("billRule", billRule); return "/billRule/addBillRule"; } /** * 编辑 * @param vo * @return */ @RequestMapping("/save") @ResponseBody public RequestResult save(BillRuleVo vo){ return ruleService.save(vo); } }
[ "julongren@vip.qq.com" ]
julongren@vip.qq.com
68c8f171a3b626100b0033e07f3f41997ee9cd46
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
/com.tencent.minihd.qq/assets/exlibs.2.jar/classes.jar/etg.java
e2db8afc9ad5a10ff917a15de3239dfa0b157ac0
[]
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
864
java
import android.app.Dialog; import android.view.View; import android.view.View.OnClickListener; import com.tencent.mobileqq.activity.QQMapActivity; public class etg implements View.OnClickListener { public etg(QQMapActivity paramQQMapActivity, Dialog paramDialog) {} public void onClick(View paramView) { if ((this.jdField_a_of_type_AndroidAppDialog != null) && (this.jdField_a_of_type_AndroidAppDialog.isShowing())) { this.jdField_a_of_type_AndroidAppDialog.dismiss(); } if (!this.jdField_a_of_type_ComTencentMobileqqActivityQQMapActivity.k) { this.jdField_a_of_type_ComTencentMobileqqActivityQQMapActivity.finish(); } } } /* Location: L:\local\mybackup\temp\qq_apk\com.tencent.minihd.qq\assets\exlibs.2.jar\classes.jar * Qualified Name: etg * JD-Core Version: 0.7.0.1 */
[ "98632993+tsuzcx@users.noreply.github.com" ]
98632993+tsuzcx@users.noreply.github.com
21c5589a93aa360278d6406efa30307c51175af5
c91815da8e87f3d00ecaa919eee77b2a36385949
/service-api/src/main/java/net/sunwukong/www/api/crypto/CryptoException.java
30832dc1e5144a43b56382588effe9f53ae37669
[]
no_license
yht-817/SpringCloud_Manage
3492e3a6b496d01d9a6fb1a88631bda26f87c258
6b8d6eb49caeb33a47973ee1b280054294254621
refs/heads/master
2020-05-03T19:01:23.532371
2019-04-01T03:10:23
2019-04-01T03:10:23
178,776,579
1
2
null
null
null
null
UTF-8
Java
false
false
861
java
package net.sunwukong.www.api.crypto; import com.sdkinfo.www.core.exceptions.ExceptionUtil; import com.sdkinfo.www.core.util.StrUtil; /** * 加密异常 * @author Looly * */ public class CryptoException extends RuntimeException { private static final long serialVersionUID = 8068509879445395353L; public CryptoException(Throwable e) { super(ExceptionUtil.getMessage(e), e); } public CryptoException(String message) { super(message); } public CryptoException(String messageTemplate, Object... params) { super(StrUtil.format(messageTemplate, params)); } public CryptoException(String message, Throwable throwable) { super(message, throwable); } public CryptoException(Throwable throwable, String messageTemplate, Object... params) { super(StrUtil.format(messageTemplate, params), throwable); } }
[ "1475409096@qq.com" ]
1475409096@qq.com
a6944779b8064f1893beeeec51431e362a6be980
d1a6d1e511df6db8d8dd0912526e3875c7e1797d
/genny_JavaWithLambdasApi21/applicationModule/src/test/java/applicationModulepackageJava1/Foo775Test.java
02cae326b6871fc32260b8781349ae0c6e2b81f2
[]
no_license
NikitaKozlov/generated-project-for-desugaring
0bc1443ab3ddc84cd289331c726761585766aea7
81506b3711004185070ca4bb9a93482b70011d36
refs/heads/master
2020-03-20T00:35:06.996525
2018-06-12T09:30:37
2018-06-12T09:30:37
137,049,317
0
0
null
null
null
null
UTF-8
Java
false
false
741
java
package applicationModulepackageJava1; import org.junit.Test; public class Foo775Test { @Test public void testFoo0() { new Foo775().foo0(); } @Test public void testFoo1() { new Foo775().foo1(); } @Test public void testFoo2() { new Foo775().foo2(); } @Test public void testFoo3() { new Foo775().foo3(); } @Test public void testFoo4() { new Foo775().foo4(); } @Test public void testFoo5() { new Foo775().foo5(); } @Test public void testFoo6() { new Foo775().foo6(); } @Test public void testFoo7() { new Foo775().foo7(); } @Test public void testFoo8() { new Foo775().foo8(); } @Test public void testFoo9() { new Foo775().foo9(); } }
[ "nikita.e.kozlov@gmail.com" ]
nikita.e.kozlov@gmail.com
b8971c2fc0f006cba15d5bf051c8c0138eb4d27c
fb60413b02cdf8a5c38d24b033d2900832ba9f19
/game_server/src/com/pwrd/war/gameserver/pet/msg/CGPetHire.java
faf3ecf7f0932879f25678aa97b518efc843f1d8
[]
no_license
tommyadan/webgame
4729fc44617b9f104e0084d41763d98b3068f394
2117929e143e7498e524305ed529c4ee09163474
refs/heads/master
2021-05-27T04:59:34.506955
2012-08-20T14:30:07
2012-08-20T14:30:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,297
java
package com.pwrd.war.gameserver.pet.msg; import com.pwrd.war.core.msg.MessageType; import com.pwrd.war.gameserver.common.msg.CGMessage; import com.pwrd.war.gameserver.pet.handler.PetHandlerFactory; /** * 招募武将 * * @author CodeGenerator, don't modify this file please. */ public class CGPetHire extends CGMessage{ /** 酒馆 */ private String pub; /** */ private String petSn; public CGPetHire (){ } public CGPetHire ( String pub, String petSn ){ this.pub = pub; this.petSn = petSn; } @Override protected boolean readImpl() { pub = readString(); petSn = readString(); return true; } @Override protected boolean writeImpl() { writeString(pub); writeString(petSn); return true; } @Override public short getType() { return MessageType.CG_PET_HIRE; } @Override public String getTypeName() { return "CG_PET_HIRE"; } public String getPub(){ return pub; } public void setPub(String pub){ this.pub = pub; } public String getPetSn(){ return petSn; } public void setPetSn(String petSn){ this.petSn = petSn; } @Override public void execute() { PetHandlerFactory.getHandler().handlePetHire(this.getSession().getPlayer(), this); } }
[ "zhutao@brunjoy.com" ]
zhutao@brunjoy.com
780d8c453f8c1a518ad12c6c5cc37f454f132f3d
da800a838b44e5577c87c5252c551c9fbe8f03f7
/photography/src/main/java/photography/dto/export_photographers_ordered_json/ExportPhotographerJson.java
c56ee7b235504e4938a420d53b31e502c8485760
[]
no_license
cvet-yordanova/Java-Fund-Databse
b3b3f027a9f31dfcc25b21fa27f3fc0d6572938c
27b51d798aa46648ab68855a831eedf3845f8d1e
refs/heads/master
2021-06-27T01:42:22.308967
2017-09-14T03:41:33
2017-09-14T03:41:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
886
java
package photography.dto.export_photographers_ordered_json; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; public class ExportPhotographerJson { @Expose @SerializedName(value = "FirstName") private String firstName; @Expose @SerializedName(value = "LastName") private String lastName; @Expose @SerializedName(value = "Phone") private String phone; public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } }
[ "cvet_yordanova@abv.bg" ]
cvet_yordanova@abv.bg
274002d5d356b5d1414899e0d1a9090369a6b2ac
44e5a256fef6f99e87b5649527944678091d8bb7
/main/boofcv-geo/src/test/java/boofcv/alg/geo/bundle/cameras/TestBundleUniversalOmni.java
c2e340e6321d0311f42d3834b567b7d03458bd50
[ "LicenseRef-scancode-takuya-ooura", "Apache-2.0" ]
permissive
lessthanoptimal/BoofCV
3aa27e99056ce3c42814fddb013d6404bd9bdcad
24adbeee4fc1371face00b4c5cacb99c0398de55
refs/heads/SNAPSHOT
2023-09-01T11:14:56.219779
2023-08-31T14:16:30
2023-08-31T14:16:30
1,635,932
955
264
null
2023-09-10T02:12:28
2011-04-19T14:51:10
Java
UTF-8
Java
false
false
4,164
java
/* * Copyright (c) 2023, Peter Abeles. All Rights Reserved. * * This file is part of BoofCV (http://boofcv.org). * * 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 boofcv.alg.geo.bundle.cameras; import boofcv.factory.distort.LensDistortionFactory; import boofcv.struct.calib.CameraUniversalOmni; import boofcv.struct.distort.Point3Transform2_F64; import boofcv.testing.BoofStandardJUnit; import georegression.struct.point.Point2D_F64; import org.ejml.UtilEjml; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertTrue; public class TestBundleUniversalOmni extends BoofStandardJUnit { @Test void compareForward() { CameraUniversalOmni cam = new CameraUniversalOmni(2); cam.fx = 300; cam.fy = 200; cam.cx = cam.cy = 400; cam.radial[0] = 0.01; cam.radial[1] = -0.02; cam.skew = 0.001; cam.t1 = 0.01; cam.t2 = -0.01; cam.mirrorOffset = 1; BundleUniversalOmni alg = new BundleUniversalOmni(cam); Point3Transform2_F64 n2p = LensDistortionFactory.wide(cam).distortStoP_F64(); Point2D_F64 found = new Point2D_F64(); double X = 0.1, Y = -0.2, Z = 2; alg.project(X, Y, Z, found); Point2D_F64 expected = new Point2D_F64(); // convert to unit sphere double n = Math.sqrt(X*X + Y*Y + Z*Z); n2p.compute(X/n, Y/n, Z/n, expected); assertTrue(found.distance(expected) < UtilEjml.TEST_F64); } @Test void withAllParameters() throws Exception { double[][] parameters = new double[][]{{300, 200, 400, 400, 0.01, 0.015, -0.001, 0.002, 0.1, 0.9}, {400, 600, 1000, 1000, 0.01, 0.015, -0.001, 0.002, 2, 0.9}}; new GenericChecksBundleAdjustmentCamera(new BundleUniversalOmni(false, 2, true, false), 0.02) {} .setParameters(parameters) .checkAll(); } @Test void withFixedMirror() throws Exception { double[][] parameters = new double[][]{{300, 200, 400, 400, 0.01, 0.015, -0.001, 0.002, 0.1}, {400, 600, 1000, 1000, 0.01, 0.015, -0.001, 0.002, 2}}; new GenericChecksBundleAdjustmentCamera(new BundleUniversalOmni(false, 2, true, 0.9), 0.02) {} .setParameters(parameters) .checkAll(); } @Test void withoutSkew() throws Exception { double[][] parameters = new double[][]{{300, 200, 400, 400, 0.01, 0.02, -0.001, 0.002, 0.9}, {400, 600, 1000, 1000, 0.01, 0.02, -0.001, 0.002, 0.9}}; new GenericChecksBundleAdjustmentCamera(new BundleUniversalOmni(true, 2, true, false), 0.02) {} .setParameters(parameters) .checkAll(); } @Test void variousRadialLengths() throws Exception { for (int i = 0; i <= 3; i++) { CameraUniversalOmni cam = new CameraUniversalOmni(i); cam.fx = 300; cam.fy = 200; cam.cx = cam.cy = 400; cam.skew = 0.01; for (int j = 0; j < i; j++) { cam.radial[j] = 0.01 - j*0.001; } cam.t1 = -0.001; cam.t2 = 0.002; cam.mirrorOffset = 0.05; BundleUniversalOmni alg = new BundleUniversalOmni(cam); double[][] parameters = new double[1][alg.getIntrinsicCount()]; alg.getIntrinsic(parameters[0], 0); new GenericChecksBundleAdjustmentCamera(alg, 0.02) {} .setParameters(parameters) .checkAll(); } } @Test void zeroTangential() throws Exception { CameraUniversalOmni cam = new CameraUniversalOmni(1); cam.fx = 300; cam.fy = 200; cam.cx = cam.cy = 400; cam.skew = 0.01; cam.radial[0] = 0.01; cam.mirrorOffset = 0.9; // since t1 and t2 are zero it will automatically turn off tangential BundleUniversalOmni alg = new BundleUniversalOmni(cam); double[][] parameters = new double[1][alg.getIntrinsicCount()]; alg.getIntrinsic(parameters[0], 0); new GenericChecksBundleAdjustmentCamera(alg, 0.02) {} .setParameters(parameters) .checkAll(); } }
[ "peter.abeles@gmail.com" ]
peter.abeles@gmail.com
a1d3bea51859000e86b0a03cc16b7afe4e4e48f6
421f0a75a6b62c5af62f89595be61f406328113b
/generated_tests/no_seeding/56_jhandballmoves-visu.handball.moves.actions.AbstractSupportSaveAction-1.0-4/visu/handball/moves/actions/AbstractSupportSaveAction_ESTest.java
9810e75f14b35e641bcbefd4c8718ae5fe9e60ba
[]
no_license
tigerqiu712/evosuite-model-seeding-empirical-evaluation
c78c4b775e5c074aaa5e6ca56bc394ec03c2c7c6
11a920b8213d9855082d3946233731c843baf7bc
refs/heads/master
2020-12-23T21:04:12.152289
2019-10-30T08:02:29
2019-10-30T08:02:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,026
java
/* * This file was automatically generated by EvoSuite * Mon Oct 28 17:12:33 GMT 2019 */ package visu.handball.moves.actions; import org.junit.Test; import static org.junit.Assert.*; import static org.evosuite.runtime.EvoAssertions.*; import java.awt.HeadlessException; import java.awt.event.ActionEvent; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; import visu.handball.moves.actions.CloseAction; import visu.handball.moves.actions.OpenAction; import visu.handball.moves.model.HandballModel; @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true, useJEE = true) public class AbstractSupportSaveAction_ESTest extends AbstractSupportSaveAction_ESTest_scaffolding { @Test(timeout = 4000) public void test0() throws Throwable { HandballModel handballModel0 = new HandballModel(); CloseAction closeAction0 = new CloseAction(handballModel0); // Undeclared exception! try { closeAction0.actionPerformed((ActionEvent) null); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("visu.handball.moves.actions.CloseAction", e); } } @Test(timeout = 4000) public void test1() throws Throwable { HandballModel handballModel0 = new HandballModel(); OpenAction openAction0 = new OpenAction(handballModel0); handballModel0.addOffender(3250, 3250); // Undeclared exception! try { openAction0.actionPerformed((ActionEvent) null); fail("Expecting exception: HeadlessException"); } catch(HeadlessException e) { // // no message in exception (getMessage() returned null) // verifyException("java.awt.GraphicsEnvironment", e); } } }
[ "pderakhshanfar@bsr01.win.tue.nl" ]
pderakhshanfar@bsr01.win.tue.nl
45ba18bf41df8ad2acb95e32887ecd144635114c
208ba847cec642cdf7b77cff26bdc4f30a97e795
/p/src/main/java/org.wp.p/ui/prefs/DeleteSiteDialogFragment.java
ef0bf65860f8164e164acb02ab060775c170bc95
[]
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
4,271
java
package org.wp.p.ui.prefs; import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; import android.app.DialogFragment; import android.app.Fragment; import android.content.DialogInterface; import android.graphics.Typeface; import android.os.Bundle; import android.text.Editable; import android.text.Spannable; import android.text.SpannableString; import android.text.TextWatcher; import android.text.style.StyleSpan; import android.view.View; import android.widget.Button; import android.widget.EditText; import org.wp.p.R; public class DeleteSiteDialogFragment extends DialogFragment implements TextWatcher, DialogInterface.OnShowListener { public static final String SITE_DOMAIN_KEY = "site-domain"; private AlertDialog mDeleteSiteDialog; private EditText mUrlConfirmation; private Button mDeleteButton; private String mSiteDomain = ""; @Override public Dialog onCreateDialog(Bundle savedInstanceState) { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); retrieveSiteDomain(); configureAlertViewBuilder(builder); mDeleteSiteDialog = builder.create(); mDeleteSiteDialog.setOnShowListener(this); return mDeleteSiteDialog; } @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { } @Override public void afterTextChanged(Editable s) { if (isUrlConfirmationTextValid()) { mDeleteButton.setEnabled(true); } else { mDeleteButton.setEnabled(false); } } @Override public void onShow(DialogInterface dialog) { mDeleteButton = mDeleteSiteDialog.getButton(DialogInterface.BUTTON_POSITIVE); mDeleteButton.setEnabled(false); } private void configureAlertViewBuilder(AlertDialog.Builder builder) { builder.setTitle(R.string.confirm_delete_site); builder.setMessage(confirmationPromptString()); configureUrlConfirmation(builder); configureButtons(builder); } private void configureButtons(AlertDialog.Builder builder) { builder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dismiss(); } }); builder.setPositiveButton(R.string.delete, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { Fragment target = getTargetFragment(); if (target != null) { target.onActivityResult(getTargetRequestCode(), Activity.RESULT_OK, null); } dismiss(); } }); } private Spannable confirmationPromptString() { String deletePrompt = String.format(getString(R.string.confirm_delete_site_prompt), mSiteDomain); Spannable promptSpannable = new SpannableString(deletePrompt); int beginning = deletePrompt.indexOf(mSiteDomain); int end = beginning + mSiteDomain.length(); promptSpannable.setSpan(new StyleSpan(Typeface.BOLD), beginning, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); return promptSpannable; } private void configureUrlConfirmation(AlertDialog.Builder builder) { View view = getActivity().getLayoutInflater().inflate(R.layout.delete_site_dialog, null); mUrlConfirmation = (EditText) view.findViewById(R.id.url_confirmation); mUrlConfirmation.addTextChangedListener(this); builder.setView(view); } private void retrieveSiteDomain() { Bundle args = getArguments(); mSiteDomain = getString(R.string.wordpress_dot_com).toLowerCase(); if (args != null) { mSiteDomain = args.getString(SITE_DOMAIN_KEY); } } private boolean isUrlConfirmationTextValid() { String confirmationText = mUrlConfirmation.getText().toString().trim().toLowerCase(); String hintText = mSiteDomain.toLowerCase(); return confirmationText.equals(hintText); } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
d7fe46f3d9c20776943a16e0cabd28b932812e26
40d844c1c780cf3618979626282cf59be833907f
/src/testcases/CWE190_Integer_Overflow/s07/CWE190_Integer_Overflow__int_max_preinc_71a.java
6e65529882d23d586c1de6f6e83e2a3c3b7f83a1
[]
no_license
rubengomez97/juliet
f9566de7be198921113658f904b521b6bca4d262
13debb7a1cc801977b9371b8cc1a313cd1de3a0e
refs/heads/master
2023-06-02T00:37:24.532638
2021-06-23T17:22:22
2021-06-23T17:22:22
379,676,259
1
0
null
null
null
null
UTF-8
Java
false
false
2,379
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE190_Integer_Overflow__int_max_preinc_71a.java Label Definition File: CWE190_Integer_Overflow__int.label.xml Template File: sources-sinks-71a.tmpl.java */ /* * @description * CWE: 190 Integer Overflow * BadSource: max Set data to the maximum value for int * GoodSource: A hardcoded non-zero, non-min, non-max, even number * Sinks: increment * GoodSink: Ensure there will not be an overflow before incrementing data * BadSink : Increment data, which can cause an overflow * Flow Variant: 71 Data flow: data passed as an Object reference argument from one method to another in different classes in the same package * * */ package testcases.CWE190_Integer_Overflow.s07; import testcasesupport.*; import javax.servlet.http.*; public class CWE190_Integer_Overflow__int_max_preinc_71a extends AbstractTestCase { public void bad() throws Throwable { int data; /* POTENTIAL FLAW: Use the maximum value for this type */ data = Integer.MAX_VALUE; (new CWE190_Integer_Overflow__int_max_preinc_71b()).badSink((Object)data ); } public void good() throws Throwable { goodG2B(); goodB2G(); } /* goodG2B() - use goodsource and badsink */ private void goodG2B() throws Throwable { int data; /* FIX: Use a hardcoded number that won't cause underflow, overflow, divide by zero, or loss-of-precision issues */ data = 2; (new CWE190_Integer_Overflow__int_max_preinc_71b()).goodG2BSink((Object)data ); } /* goodB2G() - use badsource and goodsink */ private void goodB2G() throws Throwable { int data; /* POTENTIAL FLAW: Use the maximum value for this type */ data = Integer.MAX_VALUE; (new CWE190_Integer_Overflow__int_max_preinc_71b()).goodB2GSink((Object)data ); } /* Below is the main(). It is only used when building this testcase on * its own for testing or for building a binary to use in testing binary * analysis tools. It is not used when compiling all the testcases as one * application, which is how source code analysis tools are tested. */ public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException { mainFromParent(args); } }
[ "you@example.com" ]
you@example.com
f0d1e50a4515e36771c8f7a6969e479a44fa685e
f03907d62cc8d8898ce84517edba830747a5e0bc
/org.jrebirth.af.presentation.javafx2/src/main/java/org/jrebirth/af/presentation/javafx/ui/slides/control/ControlSlideStep.java
f8f30c87316369cabfac71cbf280f3a04f41c93f
[]
no_license
JRebirth/JFX-Presentation
72dcc4032dbeb819376c77eeb54e9354bfc5c837
51673d201d7ae820cac6eb1843617b56058fdd91
refs/heads/master
2020-04-29T08:05:07.699866
2017-02-28T07:47:49
2017-02-28T07:47:49
3,514,638
4
1
null
null
null
null
UTF-8
Java
false
false
1,648
java
/** * Get more info at : www.jrebirth.org . * Copyright JRebirth.org © 2011-2013 * Contact : sebastien.bordes@jrebirth.org * * 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.jrebirth.af.presentation.javafx.ui.slides.control; import org.jrebirth.af.presentation.ui.base.SlideStep; // TODO: Auto-generated Javadoc /** * The class <strong>ControlSlideStep</strong>. * * @author Sébastien Bordes */ public enum ControlSlideStep implements SlideStep { /** The Text. */ Text, /** The Labeled step. */ // Labeled, /** The TextInputControl step. */ // TextInputControl, /** The ChoiceBox step. */ ChoiceBox, /** The Slider step. */ Slider, /** The HTMLEditor step. */ HTMLEditor, /** The Separator step. */ // Separator, /** The ProgressIndicator step. */ ProgressIndicator, /** The MenuBar step. */ MenuBar, /** The ToolBar step. */ ToolBar, /** The ListView step. */ ListView, /** The TableView step. */ TableView, /** The TreeView step. */ TreeView; }
[ "sebastien.bordes@jrebirth.org" ]
sebastien.bordes@jrebirth.org
4d78349f74fa6847b2b2aee03b971438a73a5359
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/google--error-prone/74b237d6c07be0108be1743d4b1d2ad83f7e37a1/before/Overrides.java
9b721493d8f7e3b812bc7b4c0824de2fed631268
[]
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
4,078
java
/* * Copyright 2013 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.errorprone.bugpatterns; import static com.google.errorprone.BugPattern.Category.JDK; import static com.google.errorprone.BugPattern.SeverityLevel.WARNING; import com.google.errorprone.BugPattern; import com.google.errorprone.VisitorState; import com.google.errorprone.bugpatterns.BugChecker.MethodTreeMatcher; import com.google.errorprone.fixes.SuggestedFix; import com.google.errorprone.matchers.Description; import com.google.errorprone.util.ASTHelpers; import com.sun.source.tree.MethodTree; import com.sun.source.tree.Tree; import com.sun.source.tree.VariableTree; import com.sun.tools.javac.code.Flags; import com.sun.tools.javac.code.Symbol.MethodSymbol; import java.util.Iterator; import java.util.List; import java.util.Set; /** * Matches the behaviour of javac's overrides Xlint warning. * * @author cushon@google.com (Liam Miller-Cushon) */ @BugPattern( name = "Overrides", altNames = "overrides", summary = "Varargs doesn't agree for overridden method", category = JDK, severity = WARNING ) public class Overrides extends BugChecker implements MethodTreeMatcher { @Override public Description matchMethod(MethodTree methodTree, VisitorState state) { MethodSymbol methodSymbol = ASTHelpers.getSymbol(methodTree); boolean isVarargs = (methodSymbol.flags() & Flags.VARARGS) != 0; Set<MethodSymbol> superMethods = ASTHelpers.findSuperMethods(methodSymbol, state.getTypes()); // If there are no super methods, we're fine: if (superMethods.isEmpty()) { return Description.NO_MATCH; } Iterator<MethodSymbol> superMethodsIterator = superMethods.iterator(); boolean areSupersVarargs = superMethodsIterator.next().isVarArgs(); while (superMethodsIterator.hasNext()) { if (areSupersVarargs != superMethodsIterator.next().isVarArgs()) { // The super methods are inconsistent (some are varargs, some are not varargs). Then the // current method is inconsistent with some of its supermethods, so report a match. return describeMatch(methodTree); } } // The current method is consistent with all of its supermethods: if (isVarargs == areSupersVarargs) { return Description.NO_MATCH; } // The current method is inconsistent with all of its supermethods, so flip the varargs-ness // of the current method. List<? extends VariableTree> parameterTree = methodTree.getParameters(); Tree paramType = parameterTree.get(parameterTree.size() - 1).getType(); CharSequence paramTypeSource = state.getSourceForNode(paramType); if (paramTypeSource == null) { // No fix if we don't have tree end positions. return describeMatch(methodTree); } Description.Builder descriptionBuilder = buildDescription(methodTree); if (isVarargs) { descriptionBuilder.addFix( SuggestedFix.replace(paramType, "[]", paramTypeSource.length() - 3, 0)); } else { // There may be a comment that includes a '[' character between the open and closed // brackets of the array type. If so, we don't return a fix. int arrayOpenIndex = paramTypeSource.length() - 2; while (paramTypeSource.charAt(arrayOpenIndex) == ' ') { arrayOpenIndex--; } if (paramTypeSource.charAt(arrayOpenIndex) == '[') { descriptionBuilder.addFix(SuggestedFix.replace(paramType, "...", arrayOpenIndex, 0)); } } return descriptionBuilder.build(); } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
63c05811cbf7d752d48d0d114aeb866c25df133a
000ca3a56100f386f77a1fe6ff3901dd43e955c4
/seekbar/src/main/java/com/brioal/seekbar/SizeUtil.java
07bede10f2cc8e226425319e93baaee36b05f146
[]
no_license
Brioal/NormalRangeSeekBar
63c4149a60ec81bd797ce9771ef47c25a160dfcb
92dbce6fd1a7a3f4c10c2878aeacc8c0dc21b116
refs/heads/master
2021-01-12T17:24:11.562029
2016-10-21T12:08:19
2016-10-21T12:08:19
71,561,576
2
0
null
null
null
null
UTF-8
Java
false
false
3,187
java
package com.brioal.seekbar; import android.app.Activity; import android.content.Context; import android.util.DisplayMetrics; import android.util.TypedValue; import android.view.View; import android.view.Window; import android.view.WindowManager; /** * 尺寸相关工具类 * 1.dpi转px * 2.px转dp * 3.sp转px * 4.px转sp * 5.onCreate中强行获取View的宽高 * 6.获取屏幕的宽度px * 7.获取屏幕的高度px * 8.获取状态栏高度 * 9.获取状态栏高度+标题栏(ActionBar)高度 * * Created by Brioal on 2016/7/21. */ public class SizeUtil { //dpi转px public static float Dp2Px(Context context, float dpi) { return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dpi, context.getResources().getDisplayMetrics()); } //px转dp public static float Px2Dp(Context context, float px) { return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_PX, px, context.getResources().getDisplayMetrics()); } //sp转px public static float Sp2Px(Context context, float sp) { return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, sp, context.getResources().getDisplayMetrics()); } //px转sp public static float Px2Sp(Context context, float px) { return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_PX, px, context.getResources().getDisplayMetrics()); } //onCreate中强行获取View的宽高 public static int[] forceGetViewSize(View view) { int widthMeasureSpec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED); int heightMeasureSpec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED); view.measure(widthMeasureSpec, heightMeasureSpec); return new int[]{widthMeasureSpec, heightMeasureSpec}; } //获取屏幕的宽度px public static int getDeviceWidth(Context context) { WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); DisplayMetrics outMetrics = new DisplayMetrics();// 创建了一张白纸 windowManager.getDefaultDisplay().getMetrics(outMetrics);// 给白纸设置宽高 return outMetrics.widthPixels; } //获取屏幕的高度px public static int getDeviceHeight(Context context) { WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); DisplayMetrics outMetrics = new DisplayMetrics();// 创建了一张白纸 windowManager.getDefaultDisplay().getMetrics(outMetrics);// 给白纸设置宽高 return outMetrics.heightPixels; } //获取状态栏高度 public int getStatusBarHeight(Context context) { int result = 0; int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android"); if (resourceId > 0) { result = context.getResources().getDimensionPixelSize(resourceId); } return result; } //获取状态栏高度+标题栏(ActionBar)高度 public static int getTopBarHeight(Activity activity) { return activity.getWindow().findViewById(Window.ID_ANDROID_CONTENT).getTop(); } }
[ "brioal@foxmail.com" ]
brioal@foxmail.com
435f54c38ff843074a51fe3087896b0d7f6b8632
716fde74ba932fb5fefca41dc2802087734cba82
/schemacrawler-commandline/src/main/java/schemacrawler/tools/commandline/ConnectionOptionsParser.java
095b9dbdd3b6c4990006b0d6ecaf5c27cfc2b535
[]
no_license
SwanMountain/SchemaCrawler
2e3d2599ad2b446663bcf9452047cf649d0383d5
79b2f7ce7968ef104d38eb55b86f6c6f488b4033
refs/heads/master
2020-05-05T04:00:54.952924
2019-04-05T11:46:12
2019-04-05T11:46:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,478
java
/* ======================================================================== SchemaCrawler http://www.schemacrawler.com Copyright (c) 2000-2019, Sualeh Fatehi <sualeh@hotmail.com>. All rights reserved. ------------------------------------------------------------------------ SchemaCrawler is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. SchemaCrawler and the accompanying materials are made available under the terms of the Eclipse Public License v1.0, GNU General Public License v3 or GNU Lesser General Public License v3. You may elect to redistribute this code under any of these licenses. The Eclipse Public License is available at: http://www.eclipse.org/legal/epl-v10.html The GNU General Public License v3 and the GNU Lesser General Public License v3 are available at: http://www.gnu.org/licenses/ ======================================================================== */ package schemacrawler.tools.commandline; import static us.fatehi.commandlineparser.CommandLineUtility.newCommandLine; import picocli.CommandLine; /** * Parses the command-line. * * @author Sualeh Fatehi */ public final class ConnectionOptionsParser implements OptionsParser { private final CommandLine commandLine; @CommandLine.ArgGroup(exclusive = true) private DatabaseConnectionOptions databaseConnectionOptions; @CommandLine.Spec private CommandLine.Model.CommandSpec spec; @CommandLine.Parameters private String[] remainder = new String[0]; private DatabaseConnectable databaseConnectable; public ConnectionOptionsParser() { commandLine = newCommandLine(this); } public DatabaseConnectable getDatabaseConnectable() { return databaseConnectable; } @Override public void parse(final String[] args) { commandLine.parse(args); if (databaseConnectionOptions == null) { throw new CommandLine.ParameterException(spec.commandLine(), "No database connection options provided"); } databaseConnectable = databaseConnectionOptions.getDatabaseConnectable(); if (databaseConnectable == null) { throw new CommandLine.ParameterException(spec.commandLine(), "No database connection options provided"); } } @Override public String[] getRemainder() { return remainder; } }
[ "sualeh@hotmail.com" ]
sualeh@hotmail.com
c7ed1f37e19613f0e7edfe95978959af1b0748aa
8b261b77c9bd77b360a4473f92aec27b9b55d9c1
/yxclient/src/main/java/com/yxclient/app/adapter/NoScrollViewPager.java
8919ce30ad8156aba3aebd03d538553a3a2f885f
[]
no_license
kh1011/Master
f8f66d5d3126f626e4f06debbc5983a302a385ed
5b9d36f6922f9dd2833f06c60eacc502e3e39b81
refs/heads/master
2020-03-14T00:48:48.841358
2018-04-28T02:32:02
2018-04-28T02:32:02
131,364,497
0
0
null
null
null
null
UTF-8
Java
false
false
1,407
java
package com.yxclient.app.adapter; import android.content.Context; import android.support.v4.view.ViewPager; import android.util.AttributeSet; import android.view.MotionEvent; /** * create by jpeng 11-23 */ public class NoScrollViewPager extends ViewPager { private boolean noScroll = true; public NoScrollViewPager(Context context, AttributeSet attrs) { super(context, attrs); // TODO Auto-generated constructor stub } public NoScrollViewPager(Context context) { super(context); } public ViewPager setNoScroll(boolean noScroll) { this.noScroll = noScroll; return null; } @Override public void scrollTo(int x, int y) { super.scrollTo(x, y); } @Override public boolean onTouchEvent(MotionEvent arg0) { /* return false;//super.onTouchEvent(arg0); */ if (noScroll) return false; else return super.onTouchEvent(arg0); } @Override public boolean onInterceptTouchEvent(MotionEvent arg0) { if (noScroll) return false; else return super.onInterceptTouchEvent(arg0); } @Override public void setCurrentItem(int item, boolean smoothScroll) { super.setCurrentItem(item, smoothScroll); } @Override public void setCurrentItem(int item) { super.setCurrentItem(item); } }
[ "782818448@qq.com" ]
782818448@qq.com
a5f4086935b193d9246f0e100cbf4fd0ad8d7092
daab099e44da619b97a7a6009e9dee0d507930f3
/rt/sun/audio/AudioSecurityExceptionAction.java
19bd4f26f938f4abb1071f628f6d1f2ab35635b7
[]
no_license
xknower/source-code-jdk-8u211
01c233d4f498d6a61af9b4c34dc26bb0963d6ce1
208b3b26625f62ff0d1ff6ee7c2b7ee91f6c9063
refs/heads/master
2022-12-28T17:08:25.751594
2020-10-09T03:24:14
2020-10-09T03:24:14
278,289,426
0
0
null
null
null
null
UTF-8
Java
false
false
285
java
package sun.audio; public interface AudioSecurityExceptionAction { Object run() throws Exception; } /* Location: D:\tools\env\Java\jdk1.8.0_211\rt.jar!\sun\audio\AudioSecurityExceptionAction.class * Java compiler version: 8 (52.0) * JD-Core Version: 1.1.3 */
[ "xknower@126.com" ]
xknower@126.com
91b94a5cd0053057bf2a4c6ae16d29122ed03e2a
ef8a34419cdc807c15b074d8cc8e6d72fa88cf13
/boot-framework/boot-mybatis/src/main/java/com/gemini/boot/framework/mybatis/exception/UidServiceException.java
1243b34119148c3af4a6e94dc9f9e2a4a6e41abe
[]
no_license
xiaominglol/framework
997f4f03eea047041cd2c590396d1a45aff5d559
aa0058663bec98618b5c392bac1dde0e9a192780
refs/heads/master
2022-07-09T22:57:24.456158
2020-03-30T06:29:01
2020-03-30T06:29:01
185,519,590
0
0
null
2022-06-17T02:20:39
2019-05-08T03:16:00
Java
UTF-8
Java
false
false
1,727
java
/* * Copyright (c) 2017 Baidu, Inc. All Rights Reserve. * * 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.gemini.boot.framework.mybatis.exception; /** * UidGenerateException */ public class UidServiceException extends RuntimeException { /** * Serial Version UID */ private static final long serialVersionUID = -27048199131316992L; /** * Default constructor */ public UidServiceException() { super(); } /** * Constructor with message & cause * * @param message * @param cause */ public UidServiceException(String message, Throwable cause) { super(message, cause); } /** * Constructor with message * * @param message */ public UidServiceException(String message) { super(message); } /** * Constructor with message format * * @param msgFormat * @param args */ public UidServiceException(String msgFormat, Object... args) { super(String.format(msgFormat, args)); } /** * Constructor with cause * * @param cause */ public UidServiceException(Throwable cause) { super(cause); } }
[ "474345633@qq.com" ]
474345633@qq.com
77a153a7137671059fb9b6ddfb05e8e7c8e790e8
6baa09045c69b0231c35c22b06cdf69a8ce227d6
/modules/adwords_appengine/src/main/java/com/google/api/ads/adwords/jaxws/v201603/cm/AppFeedItemAppStore.java
e3695f12e73eceab068031fbd8a1636dc8cac48a
[ "Apache-2.0" ]
permissive
remotejob/googleads-java-lib
f603b47117522104f7df2a72d2c96ae8c1ea011d
a330df0799de8d8de0dcdddf4c317d6b0cd2fe10
refs/heads/master
2020-12-11T01:36:29.506854
2016-07-28T22:13:24
2016-07-28T22:13:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,144
java
package com.google.api.ads.adwords.jaxws.v201603.cm; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for AppFeedItem.AppStore. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * &lt;simpleType name="AppFeedItem.AppStore"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;enumeration value="APPLE_ITUNES"/> * &lt;enumeration value="GOOGLE_PLAY"/> * &lt;enumeration value="UNKNOWN"/> * &lt;/restriction> * &lt;/simpleType> * </pre> * */ @XmlType(name = "AppFeedItem.AppStore") @XmlEnum public enum AppFeedItemAppStore { APPLE_ITUNES, GOOGLE_PLAY, /** * * <span class="constraint Rejected">Used for return value only. An enumeration could not be processed, typically due to incompatibility with your WSDL version.</span> * * */ UNKNOWN; public String value() { return name(); } public static AppFeedItemAppStore fromValue(String v) { return valueOf(v); } }
[ "jradcliff@users.noreply.github.com" ]
jradcliff@users.noreply.github.com
1bfc4f785297a04a846c46d5c794b5644d95dd6e
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/TIME-7b-5-22-NSGA_II-WeightedSum:TestLen:CallDiversity/org/joda/time/format/DateTimeParserBucket_ESTest_scaffolding.java
c7eda00e73a583d596f31bc145c0182c7606963d
[]
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
5,508
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Sun Jan 19 04:26:29 UTC 2020 */ package org.joda.time.format; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class DateTimeParserBucket_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.joda.time.format.DateTimeParserBucket"; org.evosuite.runtime.GuiSupport.initialize(); org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; org.evosuite.runtime.Runtime.getInstance().resetRuntime(); } @Before public void initTestCase(){ threadStopper.storeCurrentThreads(); threadStopper.startRecordingTime(); 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.agent.InstrumentingAgent.deactivate(); org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); } private static void initializeClasses() { org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(DateTimeParserBucket_ESTest_scaffolding.class.getClassLoader() , "org.joda.time.DateTimeZone", "org.joda.time.tz.DateTimeZoneBuilder$Recurrence", "org.joda.time.DateTimeUtils$MillisProvider", "org.joda.time.chrono.GJYearOfEraDateTimeField", "org.joda.time.field.OffsetDateTimeField", "org.joda.time.chrono.GJMonthOfYearDateTimeField", "org.joda.time.field.RemainderDateTimeField", "org.joda.time.chrono.BasicWeekyearDateTimeField", "org.joda.time.JodaTimePermission", "org.joda.time.chrono.BasicWeekOfWeekyearDateTimeField", "org.joda.time.DateTimeField", "org.joda.time.DateTimeFieldType", "org.joda.time.field.FieldUtils", "org.joda.time.DateTimeFieldType$StandardDateTimeFieldType", "org.joda.time.chrono.BasicChronology$HalfdayField", "org.joda.time.ReadableInterval", "org.joda.time.chrono.GJDayOfWeekDateTimeField", "org.joda.time.DateTimeUtils$SystemMillisProvider", "org.joda.time.IllegalFieldValueException", "org.joda.time.IllegalInstantException", "org.joda.time.chrono.BasicChronology$YearInfo", "org.joda.time.tz.DateTimeZoneBuilder$PrecalculatedZone", "org.joda.time.field.UnsupportedDurationField", "org.joda.time.tz.DefaultNameProvider", "org.joda.time.tz.Provider", "org.joda.time.field.ImpreciseDateTimeField$LinkedDurationField", "org.joda.time.ReadablePeriod", "org.joda.time.chrono.ZonedChronology$ZonedDateTimeField", "org.joda.time.chrono.GregorianChronology", "org.joda.time.chrono.AssembledChronology$Fields", "org.joda.time.DurationFieldType", "org.joda.time.chrono.ISOChronology", "org.joda.time.chrono.BasicChronology", "org.joda.time.tz.NameProvider", "org.joda.time.chrono.BasicYearDateTimeField", "org.joda.time.field.DividedDateTimeField", "org.joda.time.chrono.ZonedChronology", "org.joda.time.field.BaseDateTimeField", "org.joda.time.field.ZeroIsMaxDateTimeField", "org.joda.time.chrono.BasicMonthOfYearDateTimeField", "org.joda.time.DateTimeUtils", "org.joda.time.tz.CachedDateTimeZone$Info", "org.joda.time.field.MillisDurationField", "org.joda.time.field.DecoratedDurationField", "org.joda.time.tz.DateTimeZoneBuilder$DSTZone", "org.joda.time.chrono.AssembledChronology", "org.joda.time.chrono.GJEraDateTimeField", "org.joda.time.tz.ZoneInfoProvider", "org.joda.time.DateTimeZone$1", "org.joda.time.tz.DateTimeZoneBuilder", "org.joda.time.chrono.BaseChronology", "org.joda.time.format.DateTimeParserBucket", "org.joda.time.field.UnsupportedDateTimeField", "org.joda.time.field.ImpreciseDateTimeField", "org.joda.time.field.PreciseDurationField", "org.joda.time.tz.DateTimeZoneBuilder$OfYear", "org.joda.time.chrono.BasicGJChronology", "org.joda.time.field.ScaledDurationField", "org.joda.time.DurationField", "org.joda.time.Chronology", "org.joda.time.field.PreciseDurationDateTimeField", "org.joda.time.tz.FixedDateTimeZone", "org.joda.time.field.PreciseDateTimeField", "org.joda.time.tz.CachedDateTimeZone", "org.joda.time.format.DateTimeParserBucket$SavedField", "org.joda.time.chrono.BasicDayOfMonthDateTimeField", "org.joda.time.chrono.ZonedChronology$ZonedDurationField", "org.joda.time.ReadablePartial", "org.joda.time.chrono.BasicDayOfYearDateTimeField", "org.joda.time.DurationFieldType$StandardDurationFieldType", "org.joda.time.field.DecoratedDateTimeField", "org.joda.time.field.BaseDurationField" ); } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
6c55a1227be6175b5192cb778a2bf0bd0bb6afea
976f39a8e16e1da2f300a4b8368c29e4f734718c
/caex-environment/plugins/caex.caex30.sirius/src/caex/caex30/sirius/external/actions/DeleteEObjectFromCrossReference.java
065a2c2c84ad356e1dfb9f57459906fba50b500b
[]
no_license
antoniogarmendia/gallery-graphical-dsls-emfStencil
05fbf62f633850fbbb6d1108dfe0b15e13150af3
827c46be04a804a39dfd24744388920741344f46
refs/heads/master
2023-02-25T09:15:06.670557
2023-02-06T16:49:08
2023-02-06T16:49:08
225,592,329
0
0
null
null
null
null
UTF-8
Java
false
false
2,144
java
package caex.caex30.sirius.external.actions; import java.util.Collection; import java.util.Iterator; import java.util.Map; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.emf.ecore.util.EcoreUtil; import org.eclipse.sirius.diagram.DDiagramElement; import org.eclipse.sirius.diagram.DNode; import org.eclipse.sirius.tools.api.ui.IExternalJavaAction; public class DeleteEObjectFromCrossReference implements IExternalJavaAction { @Override public void execute(Collection<? extends EObject> selections, Map<String, Object> parameters) { EObject elementView = (EObject) parameters.get("elementView"); EObject currentObject = getTargetEObject(elementView); EObject parentEObject = getTargetEObject(elementView.eContainer()); String feature = getFeature(elementView); EStructuralFeature structuralFeature = parentEObject.eClass().getEStructuralFeature(feature); Object featureObject = parentEObject.eGet(structuralFeature, true); if (featureObject instanceof EList<?>) { EList<?> listOfObjects = (EList<?>) featureObject; Iterator<?> itObjects = listOfObjects.iterator(); while (itObjects.hasNext()) { Object object = itObjects.next(); if (object.equals(currentObject)) { EcoreUtil.remove(parentEObject,structuralFeature, currentObject); break; } } } } @Override public boolean canExecute(Collection<? extends EObject> selections) { return true; } private String getFeature(Object nodeObject) { if (nodeObject instanceof DNode) { DNode node = (DNode) nodeObject; String semanticCandidate = node.getActualMapping().getSemanticCandidatesExpression(); String feature = semanticCandidate.substring(semanticCandidate.indexOf(":") + 1, semanticCandidate.length()); return feature; } return null; } private EObject getTargetEObject(EObject element) { if (element instanceof DDiagramElement) { DDiagramElement parentNode = (DDiagramElement) element; return parentNode.getTarget(); } return null; } }
[ "antonio.agj@gmail.com" ]
antonio.agj@gmail.com
5535b145d48fda731ddafc26c83a033b17ab6b27
e2f1b18cd6ca38adc2e286354e01cbe4d4423fd9
/src/com/javarush/test/level15/lesson12/home04/Sun.java
9ac4cfad8d65639943bc6c2b68df41934ae117d0
[]
no_license
Polurival/JRHW
092ab6d034d6e46dd99d57b67910ca4a7749f602
6f08a005d5b444f6ad00df80aa0eac645b662831
refs/heads/master
2020-04-10T10:12:38.467016
2016-05-09T11:47:33
2016-05-09T11:47:33
50,867,434
7
14
null
null
null
null
UTF-8
Java
false
false
303
java
package com.javarush.test.level15.lesson12.home04; public class Sun implements Planet { private static Sun instance; private Sun(){} public static Sun getInstance() { if (instance == null) { instance = new Sun(); } return instance; } }
[ "polurival@gmail.com" ]
polurival@gmail.com
cae1e5da66640ea6897e66150744f9dcf7af486b
ac3a7a8d120d4e281431329c8c9d388fcfb94342
/src/test/java/com/leetcode/algorithm/easy/findpivotindex/SolutionTest.java
333286f860a19fc55c0c8d6d46b55ec788005832
[ "MIT" ]
permissive
paulxi/LeetCodeJava
c69014c24cda48f80a25227b7ac09c6c5d6cfadc
10b4430629314c7cfedaae02c7dc4c2318ea6256
refs/heads/master
2021-04-03T08:03:16.305484
2021-03-02T06:20:24
2021-03-02T06:20:24
125,126,097
3
3
null
null
null
null
UTF-8
Java
false
false
478
java
package com.leetcode.algorithm.easy.findpivotindex; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; public class SolutionTest { @Test public void testCase1() { Solution solution = new Solution(); assertEquals(3, solution.pivotIndex(new int[] {1, 7, 3, 6, 5, 6})); } @Test public void testCase2() { Solution solution = new Solution(); assertEquals(-1, solution.pivotIndex(new int[] {1, 2, 3})); } }
[ "paulxi@gmail.com" ]
paulxi@gmail.com
4d0ce8409a6721d13c643f32c17b1ce0e555442f
b9538eb0da24d3bb9d2cbd4b38b51665ea57964f
/Leetcode/src/test/java/easy/Q443StringCompressionTest.java
af8f10f0f31f7117ee4db2304ffa72d27821f5c1
[]
no_license
nicklee1006/AlgorithmLearning
aa9125b893f84e7ae48777aeb5840470a5bd71e5
70a6773c08837411303dad850cf887b2f9975710
refs/heads/master
2021-08-18T11:26:42.575287
2020-06-12T10:46:20
2020-06-12T10:46:20
193,403,011
0
0
null
null
null
null
UTF-8
Java
false
false
339
java
package easy; import org.junit.Assert; import org.junit.Test; public class Q443StringCompressionTest { @Test public void compress() { Assert.assertEquals(6, Q443StringCompression.compress(new char[]{'a','a','b','b','c','c','c'})); Assert.assertEquals(1, Q443StringCompression.compress(new char[]{'a'})); } }
[ "nicklee1006@gmail.com" ]
nicklee1006@gmail.com
347bb88f65f7597facf27c54197936c566db5a68
0da120c056a94abf09021c6c9ce0ecebd42ff2fe
/src/main/java/com/imooc/appoint/enums/AppointStateEnum.java
19e9dd37b5aa349c2daf73f759ccfed97a10d81f
[]
no_license
Lightwing-Ng/Java_SSM_BookReservation
4bea106acd25a3a6619af4d7c91464b3bd5ebb19
04b5e32a566040bf93494d8b7d4f2a2593742ba5
refs/heads/master
2020-03-27T07:08:58.912278
2018-08-26T09:34:39
2018-08-26T09:34:39
146,166,486
0
0
null
null
null
null
UTF-8
Java
false
false
861
java
package com.imooc.appoint.enums; // 使用枚举表述常量数据字典,我们先定义几个预约图书操作返回码的数据字典,也就是我们要返回给客户端的信息。 public enum AppointStateEnum { SUCCESS(1, "预约成功"), NO_NUMBER(0, "库存不足"), REPEAT_APPOINT(-1, "重复预约"), INNER_ERROR(-2, "系统异常"); private int state; private String stateInfo; AppointStateEnum(int state, String stateInfo) { this.state = state; this.stateInfo = stateInfo; } public int getState() { return state; } public String getStateInfo() { return stateInfo; } public static AppointStateEnum stateOf(int index) { for (AppointStateEnum state : values()) if (state.getState() == index) return state; return null; } }
[ "rodney_ng@icloud.com" ]
rodney_ng@icloud.com
3c28f941e69ae63fa5988974b7a8eccedda363cb
14c0363ee37ff91009859b7d22ef185729e7f05e
/src/com/talenguyen/androidframework/views/SwipeBackLayoutUsage.java
6a69f53cb578e57447bf1695ec37f42633a9d39a
[]
no_license
talenguyen/AndroidFramework
d6911ea3f14dbef11125897cc9e8ac362bca46bf
8027b21251a5b056f74e2cc234d089da11b6e435
refs/heads/master
2021-01-20T10:13:57.003330
2014-06-27T10:19:56
2014-06-27T10:19:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,099
java
package com.talenguyen.androidframework.views; import android.app.Activity; import android.os.Bundle; /** * Created by TALE on 5/14/2014. */ public class SwipeBackLayoutUsage extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // SwipeBackLayout mSwipeBackLayout = (SwipeBackLayout) findViewById(R.id.swipe); // mSwipeBackLayout.setContentView(findViewById(R.id.content_view)); // mSwipeBackLayout.setEdgeTrackingEnabled(SwipeBackLayout.EDGE_ALL); // mSwipeBackLayout.addSwipeListener(new SwipeBackLayout.SwipeListener() { // @Override // public void onScrollStateChange(int state, float scrollPercent) { // // } // // @Override // public void onEdgeTouch(int edgeFlag) { // // } // // @Override // public void onScrollOverThreshold() { // // } // // @Override // public void onSwipeCompleted() { // finish(); // } // }); } }
[ "giangnguyen.tale@gmail.com" ]
giangnguyen.tale@gmail.com
e996348dc7398bde4de60971f021dfe86bb0fe34
d5f09c7b0e954cd20dd613af600afd91b039c48a
/sources/com/coolapk/market/view/node/app/AppNodePresenter$followApp$1.java
7fcf51a485bb042f35c62a38fc9f3e32804ff0de
[]
no_license
t0HiiBwn/CoolapkRelease
af5e00c701bf82c4e90b1033f5c5f9dc8526f4b3
a6a2b03e32cde0e5163016e0078391271a8d33ab
refs/heads/main
2022-07-29T23:28:35.867734
2021-03-26T11:41:18
2021-03-26T11:41:18
345,290,891
5
2
null
null
null
null
UTF-8
Java
false
false
3,180
java
package com.coolapk.market.view.node.app; import com.coolapk.market.manager.DataManager; import com.coolapk.market.network.Result; import com.coolapk.market.util.RxUtils; import com.coolapk.market.view.node.app.AppNodePresenter; import java.util.Map; import kotlin.Metadata; import kotlin.jvm.functions.Function1; import kotlin.jvm.internal.Intrinsics; import kotlin.jvm.internal.Lambda; import rx.Observable; import rx.Subscription; import rx.functions.Action1; @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u000e\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u0003H\n¢\u0006\u0002\b\u0004"}, d2 = {"<anonymous>", "Lrx/Subscription;", "it", "Lcom/coolapk/market/view/node/app/AppNodePresenter$Request;", "invoke"}, k = 3, mv = {1, 4, 2}) /* compiled from: AppNodeContract.kt */ final class AppNodePresenter$followApp$1 extends Lambda implements Function1<AppNodePresenter.Request, Subscription> { final /* synthetic */ String $apkId; final /* synthetic */ boolean $newValue; final /* synthetic */ boolean $oldValue; final /* synthetic */ AppNodePresenter this$0; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ AppNodePresenter$followApp$1(AppNodePresenter appNodePresenter, boolean z, String str, boolean z2) { super(1); this.this$0 = appNodePresenter; this.$newValue = z; this.$apkId = str; this.$oldValue = z2; } public final Subscription invoke(AppNodePresenter.Request request) { Observable<Result<Map<String, String>>> observable; Intrinsics.checkNotNullParameter(request, "it"); if (this.$newValue) { observable = DataManager.getInstance().followApp(this.$apkId); } else { observable = DataManager.getInstance().unfollowApp(this.$apkId); } Subscription subscribe = observable.compose(RxUtils.applyIOSchedulers()).compose(request.applyLoading()).map(RxUtils.checkResult()).subscribe(new Action1<Result<Map<String, String>>>(this) { /* class com.coolapk.market.view.node.app.AppNodePresenter$followApp$1.AnonymousClass1 */ final /* synthetic */ AppNodePresenter$followApp$1 this$0; { this.this$0 = r1; } public final void call(Result<Map<String, String>> result) { this.this$0.this$0.getView().onFollowAppComplete(this.this$0.$oldValue, this.this$0.$newValue, result, null); } }, new Action1<Throwable>(this) { /* class com.coolapk.market.view.node.app.AppNodePresenter$followApp$1.AnonymousClass2 */ final /* synthetic */ AppNodePresenter$followApp$1 this$0; { this.this$0 = r1; } public final void call(Throwable th) { this.this$0.this$0.getView().onFollowAppComplete(this.this$0.$oldValue, this.this$0.$newValue, null, th); } }); Intrinsics.checkNotNullExpressionValue(subscribe, "if (newValue) {\n …e)\n })"); return subscribe; } }
[ "test@gmail.com" ]
test@gmail.com
6f664567d9ff5435f091af849e50d92bf7aa1b7c
4717e5b2601e706c6bd17fa045f4f88e936c41ec
/src/MyMethods/MethodsTest.java
4c2f8421d1e74de9eaf8e1ea32e236534eedccfc
[]
no_license
TechnoStudyy/ProjectMethods
e59cc5d12759894eac9dcffc248b7c3ae77bbd73
93a6f1f51fac2e9605ab87cc64973a2c4e463a99
refs/heads/master
2020-09-16T15:59:43.304819
2019-11-24T22:53:05
2019-11-24T22:53:05
223,821,754
1
0
null
null
null
null
UTF-8
Java
false
false
6,410
java
package MyMethods; import org.junit.Assert; import org.junit.Test; import java.util.ArrayList; public class MethodsTest { MethodsCode c1 = new MethodsCode(); @Test public void getTotal1() { String myNum = "5421312341"; int myTotal = c1.getTotal(myNum); int expected = 10; Assert.assertTrue(myTotal == expected); } @Test public void getTotal2() { String myNum = "5654656213"; int myTotal = c1.getTotal(myNum); int expected = 29; Assert.assertTrue(myTotal == expected); } @Test public void getTotal3() { String myNum = "00000000000"; int myTotal = c1.getTotal(myNum); int expected = -1; Assert.assertTrue(myTotal == expected); } @Test public void BankStatement_Calculator1() { ArrayList<String> myStatement = new ArrayList<>(); myStatement.add("$23.21"); myStatement.add("$18.10"); myStatement.add("$22.18"); myStatement.add("$100.90"); myStatement.add("$23.10"); double statmentTotal = c1.BankStatement_Calculator(myStatement); Assert.assertTrue(statmentTotal == 187.49); } @Test public void BankStatement_Calculator2() { ArrayList<String> myStatement = new ArrayList<>(); myStatement.add("$14.21"); myStatement.add("$200.60"); myStatement.add("$1,000.28"); myStatement.add("$2,000.50"); myStatement.add("$23.10"); double statmentTotal = c1.BankStatement_Calculator(myStatement); Assert.assertTrue(statmentTotal == 3238.69); } @Test public void BankStatement_Calculator3() { ArrayList<String> myStatement = new ArrayList<>(); myStatement.add("$0"); myStatement.add("$0"); myStatement.add("$0"); myStatement.add("$0"); myStatement.add("$0"); double statmentTotal = c1.BankStatement_Calculator(myStatement); Assert.assertTrue(statmentTotal == -1.0); } @Test public void getPopulation1() { ArrayList<String> CountryNames = new ArrayList<>(); CountryNames.add("USA"); CountryNames.add("Mexico"); CountryNames.add("South Korea"); CountryNames.add("Brazil"); ArrayList<String> Population = new ArrayList<>(); Population.add("300000000"); Population.add("60000000"); Population.add("5200000"); Population.add("12000000"); int randomNum = c1.RandomGenerator(CountryNames.size()); String CountYname = CountryNames.get(randomNum); String populationREturn = c1.getPopulation(CountryNames, Population, CountYname); String population = Population.get(randomNum); Assert.assertTrue(population.equals(populationREturn)); } @Test public void getPopulation2() { ArrayList<String> CountryNames = new ArrayList<>(); CountryNames.add("Turkey"); CountryNames.add("Greece"); CountryNames.add("Romania"); CountryNames.add("Germany"); CountryNames.add("France"); CountryNames.add("Russia"); CountryNames.add("Argentina"); CountryNames.add("South Korea"); CountryNames.add("North Korea"); CountryNames.add("China"); CountryNames.add("India"); CountryNames.add("Kazakhistan"); CountryNames.add("Algeria"); CountryNames.add("Belgium"); CountryNames.add("Litvania"); CountryNames.add("Somewhere"); ArrayList<String> Population = new ArrayList<>(); Population.add("80000000"); Population.add("63200000"); Population.add("965555520"); Population.add("1000000"); Population.add("14000000"); Population.add("66200000"); Population.add("999555520"); Population.add("6700000"); Population.add("123000000"); Population.add("5432200000"); Population.add("125555520"); Population.add("6300000"); Population.add("99000000"); Population.add("69200000"); Population.add("7655555520"); Population.add("32100000"); int randomNum = c1.RandomGenerator(CountryNames.size()); String CountYname = CountryNames.get(randomNum); String populationREturn = c1.getPopulation(CountryNames, Population, CountYname); String population = Population.get(randomNum); Assert.assertTrue(population.equals(populationREturn)); } @Test public void RandomGenerator(){ for(int i = 0 ;i < 20 ; i++){ int rnd = c1.RandomGenerator(3); if(rnd==0){ Assert.assertTrue(false); }else{ Assert.assertTrue(true); } } } @Test public void getPopulation3() { ArrayList<String> CountryNames = new ArrayList<>(); CountryNames.add("Sourh Africa"); CountryNames.add("Mali"); CountryNames.add("Morocco"); CountryNames.add("Algeria"); ArrayList<String> Population = new ArrayList<>(); Population.add("20000000"); Population.add("90000000"); Population.add("2300000"); Population.add("12000000"); int randomNum = c1.RandomGenerator(CountryNames.size()); String CountYname = "Somewhere"; String populationREturn = c1.getPopulation(CountryNames, Population, CountYname); System.out.println(populationREturn); Assert.assertTrue(populationREturn.equals("-1")); } // if the total number = bigger then 18 return should be --> "You have a chance" // // if the total number = bigger or equal to 10 return should be --> "You are chicken" // // if the total number = less then 10 return should be --> "You are deep loser" @Test public void BJ21_1() { String s1 = c1.BJ21(); if(s1.contains("You are a loser")){ Assert.assertTrue(true); }else if(s1.contains("You have a chance")){ Assert.assertTrue(true); }else if(s1.contains("You are chicken")){ Assert.assertTrue(true); }else if(s1.contains("You are deep loser")){ Assert.assertTrue(true); }else{ Assert.assertTrue(false); } } }
[ "makoklu32@gmail.com" ]
makoklu32@gmail.com
548b29ac220619c879df46251e4e369504f5a87b
785b5780e27e3028ce1e84496d02080cd63617ee
/chap01_Architect_Inner_Power_Skills/chap01_02_Design_Patterns/chap01_02_04_Proxy_Pattern/proxy-pattern-lesson/src/main/java/cn/sitedev/order/DynamicProxyTest.java
ecc830ee7422ab810b827b8d68a3549f0d3ac4c8
[]
no_license
mrp321/java_architect_lesson_2020
52bbcee169ea527ff764ae2f6f200204d11ad705
890f11291681f5ade35ca6aeb23d4df8a8087df7
refs/heads/master
2022-06-27T09:22:05.278456
2020-06-25T15:55:52
2020-06-25T15:55:52
243,526,129
0
0
null
2022-06-17T02:58:42
2020-02-27T13:29:23
Java
UTF-8
Java
false
false
674
java
package cn.sitedev.order; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class DynamicProxyTest { public static void main(String[] args) { try { Order order = new Order(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd"); Date date = sdf.parse("2020/03/03"); order.setCreateTime(date.getTime()); IOrderService orderService = (IOrderService) new OrderServiceDynamicProxy().getInstance(new OrderService()); orderService.createOrder(order); } catch (ParseException e) { e.printStackTrace(); } } }
[ "y7654f@gmail.com" ]
y7654f@gmail.com
ac5c68b18d713b9d4bacbab86860c704739c39ac
e21d17cdcd99c5d53300a7295ebb41e0f876bbcb
/22_Chapters_Edition/src/main/resources/ExampleCodes/generics/Holder3.java
4641b2dc9ecc346406a5e20df0544fff6846c54a
[]
no_license
lypgod/Thinking_In_Java_4th_Edition
dc42a377de28ae51de2c4000a860cd3bc93d0620
5dae477f1a44b15b9aa4944ecae2175bd5d8c10e
refs/heads/master
2020-04-05T17:39:55.720961
2018-11-11T12:07:56
2018-11-11T12:08:26
157,070,646
0
0
null
null
null
null
UTF-8
Java
false
false
458
java
package ExampleCodes.generics;//: generics/Holder3.java public class Holder3<T> { private T a; public Holder3(T a) { this.a = a; } public void set(T a) { this.a = a; } public T get() { return a; } public static void main(String[] args) { Holder3<Automobile> h3 = new Holder3<Automobile>(new Automobile()); Automobile a = h3.get(); // No cast needed // h3.set("Not an Automobile"); // Error // h3.set(1); // Error } } ///:~
[ "lypgod@hotmail.com" ]
lypgod@hotmail.com
9288c5c5f8b476b6e4c58b1e633eed8a3fc0f22c
10bdfe0647574ff35db5ec4c8d7cd6afe8352536
/ribbon-consumer/src/main/java/com/seven/ribbonconsumer/web/UserService.java
18fae9ae9dc4a1d1891129e7cf2fb9c81df56a82
[]
no_license
lumiseven/lumi1
bf40f2746f09ea84f8149484828f9a79b2aea4ae
038331052e705ee073c98405a6c92ff1d0c51b46
refs/heads/master
2021-05-23T05:25:02.021878
2018-09-17T08:07:15
2018-09-17T08:07:15
95,193,113
1
0
null
null
null
null
UTF-8
Java
false
false
1,829
java
package com.seven.ribbonconsumer.web; import java.util.concurrent.Future; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.web.client.RestClientException; import org.springframework.web.client.RestTemplate; import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand; import com.netflix.hystrix.contrib.javanica.annotation.ObservableExecutionMode; import com.netflix.hystrix.contrib.javanica.command.AsyncResult; import rx.Observable; /** * * @author seven * * @description only for test */ @Service public class UserService { @Autowired private RestTemplate restTemplate; /** * * @param id * @return * 同步 */ @HystrixCommand public User getUserById(Long id) { return restTemplate.getForObject("http://USER-SERVICE/users/{1}", User.class, id); } /** * * @param id * @return * 异步实现 */ @HystrixCommand public Future<User> getUserByIdAsync(final String id) { return new AsyncResult<User>() { @Override public User invoke() { return restTemplate.getForObject("http://USER-SERVICE/users/{1}", User.class, id); } }; } /** * * @param id * @return * observable 实现(响应式命令) * * observableExecutionMode 默认Eager表示使用observe()执行方式 * Lazy表示使用toObservable()执行方式 */ @HystrixCommand(observableExecutionMode = ObservableExecutionMode.EAGER) public Observable<User> getUserById(final String id) { return Observable.create((t) -> { try { if (!t.isUnsubscribed()) { User user = restTemplate.getForObject("http://USER-SERVICE/users/{1}", User.class, id); t.onNext(user); t.onCompleted(); } } catch (RestClientException e) { t.onError(e); } }); } }
[ "lumiseven@yahoo.com" ]
lumiseven@yahoo.com
3fb70bac13f5b2c34e512b25eef0cb55eab60dfa
1c6367ce1a371810c4c7635d9dbcb74e01033cc5
/src/LittleElephantAndBallsAgain.java
0c910dd2ddb163d0178c5fc1a919367400c568bb
[]
no_license
yuki2006/topcoder
be3c34180422bc8d2e88df2a2ed154dc5b9755f0
1bd674658f7785a0fe4af68ecc23a1a271a719a2
refs/heads/master
2020-06-01T00:34:50.494226
2014-06-19T14:33:59
2014-06-19T14:33:59
10,480,715
7
1
null
null
null
null
UTF-8
Java
false
false
3,513
java
// Paste me into the FileEdit configuration dialog // SRM 595 DIV 2 - 250.0 public class LittleElephantAndBallsAgain { public int getNumber(String S) { char[] cs = S.toCharArray(); int max = 0; int current = 1; for (int i = 1; i < cs.length; i++) { if (cs[i - 1] != cs[i]) { max = Math.max(max, current); current = 1; } else { current++; } } max = Math.max(max, current); return S.length() - max; } // BEGIN CUT HERE public static void main(String[] args) { if (args.length == 0) { LittleElephantAndBallsAgainHarness.run_test(-1); } else { for (int i = 0; i < args.length; ++i) LittleElephantAndBallsAgainHarness.run_test(Integer .valueOf(args[i])); } } // END CUT HERE } // BEGIN CUT HERE class LittleElephantAndBallsAgainHarness { public static void run_test(int casenum) { if (casenum != -1) { if (runTestCase(casenum) == -1) System.err.println("Illegal input! Test case " + casenum + " does not exist."); return; } int correct = 0, total = 0; for (int i = 0;; ++i) { int x = runTestCase(i); if (x == -1) { if (i >= 100) break; continue; } correct += x; ++total; } if (total == 0) { System.err.println("No test cases run."); } else if (correct < total) { System.err.println("Some cases FAILED (passed " + correct + " of " + total + ")."); } else { System.err.println("All " + total + " tests passed!"); } } static boolean compareOutput(int expected, int result) { return expected == result; } static String formatResult(int res) { return String.format("%d", res); } static int verifyCase(int casenum, int expected, int received) { System.err.print("Example " + casenum + "... "); if (compareOutput(expected, received)) { System.err.println("PASSED"); return 1; } else { System.err.println("FAILED"); System.err.println(" Expected: " + formatResult(expected)); System.err.println(" Received: " + formatResult(received)); return 0; } } static int runTestCase(int casenum__) { switch (casenum__) { case 0: { String S = "RRGGBB"; int expected__ = 4; return verifyCase(casenum__, expected__, new LittleElephantAndBallsAgain().getNumber(S)); } case 1: { String S = "R"; int expected__ = 0; return verifyCase(casenum__, expected__, new LittleElephantAndBallsAgain().getNumber(S)); } case 2: { String S = "RGBRGB"; int expected__ = 5; return verifyCase(casenum__, expected__, new LittleElephantAndBallsAgain().getNumber(S)); } case 3: { String S = "RGGGBB"; int expected__ = 3; return verifyCase(casenum__, expected__, new LittleElephantAndBallsAgain().getNumber(S)); } case 4: { String S = "RGBRBRGRGRBBBGRBRBRGBGBBBGRGBBBBRGBGRRGGRRRGRBBBBR"; int expected__ = 46; return verifyCase(casenum__, expected__, new LittleElephantAndBallsAgain().getNumber(S)); } // custom cases /* * case 5: { String S = ; int expected__ = ; * * return verifyCase(casenum__, expected__, new * LittleElephantAndBallsAgain().getNumber(S)); } */ /* * case 6: { String S = ; int expected__ = ; * * return verifyCase(casenum__, expected__, new * LittleElephantAndBallsAgain().getNumber(S)); } */ /* * case 7: { String S = ; int expected__ = ; * * return verifyCase(casenum__, expected__, new * LittleElephantAndBallsAgain().getNumber(S)); } */ default: return -1; } } } // END CUT HERE
[ "yagfair@gmail.com" ]
yagfair@gmail.com
2916afbf9125228a93fd247eacfa14b1dcdab1dc
f6e8e38b3728101753dd5679beebbaf9d5365cd2
/src/test/java/com/ankurpathak/HamcrestStringMatchers.java
b440a67f7c4a90e7a6726fca0b440d4f1e5d36ca
[]
no_license
ankurpathak/testing
adbc8e4cd3b18bfdab6293e450b1a0eb76dabbe8
2933b56c8a88e038257322b904e6e4abab239bc0
refs/heads/master
2020-03-23T08:01:26.129363
2018-07-17T14:54:58
2018-07-17T14:54:58
141,304,003
0
0
null
null
null
null
UTF-8
Java
false
false
1,078
java
package com.ankurpathak; import org.hamcrest.Matchers; import org.junit.Before; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; public class HamcrestStringMatchers { private String string, emptyString, nullString, emptyStringWithWhitespace; @Before public void initializeString(){ string = "Too much long string!"; emptyString = ""; emptyStringWithWhitespace = " "; } @Test public void stringIsEmpty(){ assertThat(emptyString, isEmptyString()); } @Test public void stringIsEmptyOrNull(){ assertThat(emptyString, isEmptyOrNullString()); assertThat(emptyString, isEmptyOrNullString()); } @Test public void stringContaingSubstring(){ assertThat(string, containsString("long")); } @Test public void stringStartingWith(){ assertThat(string, startsWith("Too")); } @Test public void stringEndingWith(){ assertThat(string, endsWith("!")); } }
[ "ankurpathak@live.in" ]
ankurpathak@live.in
2d45e5418ad3089a9fd334bb80ec9f71b53c44a8
28ce6f31fa72b9d42eb93d24b8832fa9b7c94616
/test-case-src/src/main/java/java/sfBugs/Bug2033091.java
deceeb801a6a9942a1676e63f5bc576832217edc
[]
no_license
HarveyLuo91/KillBugTestCases
754ac1163b11add7261fc4cbe84e5d6269b392ac
e1da3c69d6ce1f9238fbe41c68d6ebffd5080be4
refs/heads/master
2021-08-28T04:26:44.356531
2017-12-11T07:23:38
2017-12-11T07:23:38
113,673,769
0
0
null
null
null
null
UTF-8
Java
false
false
1,075
java
package java.sfBugs; import java.io.IOException; import java.util.concurrent.locks.ReentrantReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock; public class Bug2033091 { static ReentrantReadWriteLock lockArray[]; static { lockArray = new ReentrantReadWriteLock[5]; for (int i = 0; i < lockArray.length; i++) lockArray[i] = new ReentrantReadWriteLock(); } static void falsePositive(int n) throws IOException { // WriteLock lock = lockArray[n].writeLock(); // lock.lock(); lockArray[n].writeLock().lock(); try { // do some disk I/O } finally { // lock.unlock(); lockArray[n].writeLock().unlock(); } } static void method2(int n) throws IOException { WriteLock lock = lockArray[n].writeLock(); lock.lock(); try { // do some disk I/O } finally { lock.unlock(); } } public static void main(String[] args) throws IOException { } }
[ "93994822@qq.com" ]
93994822@qq.com
45e8b9454aba24a6222ceb7a91aa55d6b3abf0e1
d4dafb381a9c5930918db8bedf403944df918884
/src/main/java/cn/com/niosample/sample/CopyFile.java
7b129df110216a25a98917f3cc6e5b3bf2552aca
[]
no_license
git-sky/javabasics
3f307d33876e17b260740492fcd6c33bdf91bddb
25bf3ddbe6c08b77b499450cfdbd75e4eb81b51d
refs/heads/master
2022-12-25T12:01:04.569153
2021-06-20T14:48:55
2021-06-20T14:48:55
97,925,787
0
0
null
null
null
null
UTF-8
Java
false
false
1,443
java
package cn.com.niosample.sample; import java.io.FileInputStream; import java.io.FileOutputStream; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; public class CopyFile { public static void main(String[] args) throws Exception { String infile = "C:\\copy.sql"; String outfile = "C:\\copy.txt"; // ��ȡԴ�ļ���Ŀ���ļ������������ FileInputStream fin = new FileInputStream(infile); FileOutputStream fout = new FileOutputStream(outfile); // ��ȡ�������ͨ�� FileChannel fcin = fin.getChannel(); FileChannel fcout = fout.getChannel(); // ���������� ByteBuffer buffer = ByteBuffer.allocate(1024); while (true) { // clear�������軺������ʹ�����Խ��ܶ�������� buffer.clear(); // ������ͨ���н����ݶ��������� int r = fcin.read(buffer); // read�������ض�ȡ���ֽ���������Ϊ�㣬�����ͨ���ѵ�������ĩβ���򷵻�-1 if (r == -1) { break; } // flip�����û��������Խ��¶��������д����һ��ͨ�� buffer.flip(); // �����ͨ���н�����д�뻺���� fcout.write(buffer); } } }
[ "linkme2008@sina.com" ]
linkme2008@sina.com
e9ce1537614c743fa904082ed6c54d793e37463b
5148293c98b0a27aa223ea157441ac7fa9b5e7a3
/Method_Scraping/xml_scraping/NicadOutputFile_t1_beam/Nicad_t1_beam3144.java
a5d02116fe4386206902d3072289a42d4dd3d3cd
[]
no_license
ryosuke-ku/TestCodeSeacherPlus
cfd03a2858b67a05ecf17194213b7c02c5f2caff
d002a52251f5461598c7af73925b85a05cea85c6
refs/heads/master
2020-05-24T01:25:27.000821
2019-08-17T06:23:42
2019-08-17T06:23:42
187,005,399
0
0
null
null
null
null
UTF-8
Java
false
false
479
java
// clone pairs:11023:90% // 16425:beam/sdks/java/extensions/google-cloud-platform-core/src/main/java/org/apache/beam/sdk/extensions/gcp/util/gcsfs/GcsPath.java public class Nicad_t1_beam3144 { public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } GcsPath paths = (GcsPath) o; return bucket.equals(paths.bucket) && object.equals(paths.object); } }
[ "naist1020@gmail.com" ]
naist1020@gmail.com
4e1c5025aa6f0dfba9613cb312a9b3e4cd71c39e
7d1926140921a33d933397add81b5fb8d45d12dd
/jy-shop/jy-shop-mall/src/main/java/com/jiyi/modules/user/service/dto/UserLevelDto.java
57267e301b5ded20bb8adcbfccb43785682919aa
[]
no_license
jyPBDepartment/jyshop
28484f47d3d19fc151e73ab1a2f13e07647b5f9e
a59aa66632e41c6da6f642545d1abf5c22a821e5
refs/heads/master
2023-03-01T12:30:13.021414
2021-02-05T08:17:58
2021-02-05T08:17:58
336,201,679
0
0
null
null
null
null
UTF-8
Java
false
false
370
java
package com.jiyi.modules.user.service.dto; import com.jiyi.modules.user.vo.YxSystemUserLevelQueryVo; import lombok.Data; import java.io.Serializable; import java.util.List; /** * @ClassName UserLevelDto * * @Date 2019/12/6 **/ @Data public class UserLevelDto implements Serializable { private List<YxSystemUserLevelQueryVo> list; private TaskDto task; }
[ "zhouguohui0328@163.com" ]
zhouguohui0328@163.com
045909168dbdfe7f4d671dea54e0c653052edb05
4627d514d6664526f58fbe3cac830a54679749cd
/projects/mockito/src/org/mockito/internal/invocation/realmethod/FilteredCGLIBProxyRealMethod.java
c4b6429f73f9de0e7baa3cdf4d7f97f7c8ace511
[ "MIT", "BSD-3-Clause", "Apache-2.0" ]
permissive
STAMP-project/Cling-application
c624175a4aa24bb9b29b53f9b84c42a0f18631bd
0ff4d7652b434cbfd9be8d8bb38cfc8d8eaa51b5
refs/heads/master
2022-07-27T09:30:16.423362
2022-07-19T12:01:46
2022-07-19T12:01:46
254,310,667
2
2
null
2021-07-12T12:29:50
2020-04-09T08:11:35
null
UTF-8
Java
false
false
1,194
java
/* * Copyright (c) 2007 Mockito contributors * This program is made available under the terms of the MIT License. */ package org.mockito.internal.invocation.realmethod; import java.io.Serializable; import org.mockito.internal.creation.MockitoMethodProxy; import org.mockito.internal.exceptions.base.ConditionalStackTraceFilter; public class FilteredCGLIBProxyRealMethod implements RealMethod, HasCGLIBMethodProxy, Serializable { private static final long serialVersionUID = 3596550785818938496L; private final RealMethod realMethod; public FilteredCGLIBProxyRealMethod(MockitoMethodProxy methodProxy) { this(new CGLIBProxyRealMethod(methodProxy)); } public FilteredCGLIBProxyRealMethod(RealMethod realMethod) { this.realMethod = realMethod; } public Object invoke(Object target, Object[] arguments) throws Throwable { try { return realMethod.invoke(target, arguments); } catch (Throwable t) { new ConditionalStackTraceFilter().filter(t); throw t; } } public MockitoMethodProxy getMethodProxy() { return ((HasCGLIBMethodProxy) realMethod).getMethodProxy(); } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
a6a5954c40471b70c43b26680794ad2dfa417706
afab90e214f8cb12360443e0877ab817183fa627
/bitcamp-project-server/old/v47_1/src/main/java/com/eomcs/lms/servlet/LessonAddServlet.java
03cdd91655aceae6c21cc3e45234b5da32c57941
[]
no_license
oreoTaste/bitcamp-study
40a96ef548bce1f80b4daab0eb650513637b46f3
8f0af7cd3c5920841888c5e04f30603cbeb420a5
refs/heads/master
2020-09-23T14:47:32.489490
2020-05-26T09:05:40
2020-05-26T09:05:40
225,523,347
1
0
null
null
null
null
UTF-8
Java
false
false
1,375
java
package com.eomcs.lms.servlet; import java.io.PrintStream; import java.util.Scanner; import com.eomcs.lms.domain.Lesson; import com.eomcs.lms.service.LessonService; import com.eomcs.util.Component; import com.eomcs.util.Prompt; import com.eomcs.util.RequestMapping; @Component public class LessonAddServlet { LessonService lessonService; public LessonAddServlet(LessonService lessonService) { this.lessonService = lessonService; } @RequestMapping("/lesson/add") public void service(Scanner in, PrintStream out) throws Exception { try { Lesson lesson = new Lesson(); lesson.setTitle(Prompt.getString(in, out, "수업명? ")); lesson.setContext(Prompt.getString(in, out, "수업내용? ")); lesson.setStartDate(Prompt.getDate(in, out, "시작일? (형식 : 2019-01-01) ")); lesson.setEndDate(Prompt.getDate(in, out, "종료일? (형식 : 2019-01-01) ")); lesson.setTotalHour(Prompt.getInt(in, out, "총수업시간? (형식: 1000) ")); lesson.setDailyHour(Prompt.getInt(in, out, "일수업시간? (형식: 8) ")); if (lessonService.add(lesson)){ out.println("새 글을 등록했습니다."); } else { out.println("수업정보 등록에 실패했습니다."); } } catch (Exception e) { System.out.println("수업정도 추가중 오류발생"); } } }
[ "youngkuk.sohn@gmail.com" ]
youngkuk.sohn@gmail.com
31e1282c5c487ae251f9aa69b17f2f1b1e1bcdd4
5193df90cb901752fdcb0c90623465d2895d9e2d
/no.hal.quiz.model.ui/src/no/hal/quiz/provider/XmlQuestionItemProvider.java
7ccd8171ba0efa6ef2dce76a103b217b7c67902b
[]
no_license
hallvard/tdt4250
de056c4d0019ce69ad458775e4b04f7733ef20a7
e2a685d956f2ed9f044a4d303e5c58d9da7cef29
refs/heads/master
2020-03-27T22:47:21.213572
2018-09-10T19:55:12
2018-09-10T19:55:12
38,511,355
3
2
null
null
null
null
UTF-8
Java
false
false
3,945
java
/** */ package no.hal.quiz.provider; import java.util.Collection; import java.util.List; import no.hal.quiz.QuizFactory; import no.hal.quiz.QuizPackage; import no.hal.quiz.XmlQuestion; import org.eclipse.emf.common.notify.AdapterFactory; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; import org.eclipse.emf.edit.provider.ViewerNotification; /** * This is the item provider adapter for a {@link no.hal.quiz.XmlQuestion} object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public class XmlQuestionItemProvider extends QuestionItemProvider { /** * This constructs an instance from a factory and a notifier. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public XmlQuestionItemProvider(AdapterFactory adapterFactory) { super(adapterFactory); } /** * This returns the property descriptors for the adapted class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) { if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); } return itemPropertyDescriptors; } /** * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) { if (childrenFeatures == null) { super.getChildrenFeatures(object); childrenFeatures.add(QuizPackage.Literals.XML_QUESTION__XML); } return childrenFeatures; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EStructuralFeature getChildFeature(Object object, Object child) { // Check the type of the specified child object and return the proper feature to use for // adding (see {@link AddCommand}) it as a child. return super.getChildFeature(object, child); } /** * This returns XmlQuestion.gif. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/XmlQuestion")); } /** * This returns the label text for the adapted class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String getText(Object object) { return getString("_UI_XmlQuestion_type"); } /** * This handles model notifications by calling {@link #updateChildren} to update any cached * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void notifyChanged(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(XmlQuestion.class)) { case QuizPackage.XML_QUESTION__XML: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } super.notifyChanged(notification); } /** * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children * that can be created under this object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); newChildDescriptors.add (createChildParameter (QuizPackage.Literals.XML_QUESTION__XML, QuizFactory.eINSTANCE.createXml())); } }
[ "hal@idi.ntnu.no" ]
hal@idi.ntnu.no
f4bf1753861c5108c4bc3177408f34fbde51ac30
c4fbfc635607f9c9e7de89383833ca73d71832d6
/SimpleSecurity/src/main/java/com/zy/security/web/session/ConcurrentSessionControlAuthenticationStrategy.java
6eee4762bfdb2adc455984264fd654aa6cc64e40
[]
no_license
azurite-Y/SimpleSecurityOAuth2
e195c0543b61bdf7203cdfeb510ee21419164af8
04c17918b4917e5e1210b8c68a183003a6dd563e
refs/heads/master
2022-11-28T11:59:28.696125
2020-07-18T05:22:36
2020-07-18T05:22:36
252,095,584
1
0
null
2022-11-15T23:49:55
2020-04-01T06:52:15
Java
UTF-8
Java
false
false
3,462
java
package com.zy.security.web.session; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import com.zy.security.core.token.Authentication; import com.zy.security.core.userdetails.WebAttribute; import com.zy.security.web.session.interfaces.SessionAuthenticationStrategy; import com.zy.security.web.session.interfaces.SessionRegistry; /** * @author zy * @Date 2019-11-21 周四 下午 14:32:51 * @Description 处理并发会话控制的策略 * @version */ public class ConcurrentSessionControlAuthenticationStrategy implements SessionAuthenticationStrategy { private final SessionRegistry sessionStrategy; // session的最大并发数 private int maxSessions; private boolean isControl = false; public int getMaxSessions() { return maxSessions; } public void setMaxSessions(int maxSessions) { this.maxSessions = maxSessions; } public SessionRegistry getSessionStrategy() { return sessionStrategy; } public ConcurrentSessionControlAuthenticationStrategy(SessionRegistry sessionStrategy, int maxSessions) { this(sessionStrategy); this.isControl = true; if(maxSessions < 1) { // 设置最小值 this.maxSessions = 1; return ; } this.maxSessions = maxSessions; } public ConcurrentSessionControlAuthenticationStrategy(SessionRegistry sessionStrategy) { if(sessionStrategy == null) { throw new IllegalArgumentException("SessionStrategy 不可为null"); } this.sessionStrategy = sessionStrategy; } @Override public void onAuthentication(Authentication authentication, HttpServletRequest request,HttpServletResponse response) { if(!isControl) { // 若未设置最大并发数则不作限制 return; } // 获得全部为过期的会话 List<SessionInformation> sessions = sessionStrategy.getAllSessions(authentication.getPrincipal(), false); int sessionCount = sessions.size(); if(sessionCount < this.maxSessions || this.maxSessions == 0) { // 未超过上限或没有session注册 return; } if(sessionCount == this.maxSessions) { HttpSession session = request.getSession(false); if(session != null) { for (SessionInformation sessionInformation : sessions) { // 如果当前session未过期则结束此方法 if( sessionInformation.getSessionId().equals(session.getId()) ) { return ; } } } } // 超出允许会话数 allowableSessionsExceeded(sessions,request); } /** * 寻找最后访问时间最早的session,并将其设为过期 * @param sessions * @param num * @param sessionStrategy */ private void allowableSessionsExceeded(List<SessionInformation> sessions,HttpServletRequest req) { // 对for循环中上一个session的引用 SessionInformation lastInfo = null; for (SessionInformation session : sessions) { /* public boolean before(Date when) { return getMillisOf(this) < getMillisOf(when); }*/ // 类似于冒泡排序,找寻比自己小的对象 if (lastInfo == null || session.getLastVisit().before(lastInfo.getLastVisit())) { lastInfo = session; } } lastInfo.setExpire(true); req.setAttribute(WebAttribute.EXIPRED_SESSION, lastInfo); // 在SessionInformation失效时移除相关的csrf信息 CsrfContextHolder.remove(lastInfo.getSessionId()); } }
[ "15969413461@163.com" ]
15969413461@163.com
ce1df5a66e6ca660f422f6c52f64ba0d606de0c8
c343a0ef45405fb447d6a8735509efe2c1d6febf
/Pucho/app/app/src/test/java/com/indiainnovates/pucho/EmailValidator.java
85c7afc3f0f49f86be0f37e42dafc89d08feb295
[]
no_license
MouleshS/SamplesAndroid
89fcc15efb707e63fcf01adf5b02a33f9a5f39c4
8342cc4a5d596a4ac33db12a3c2aa4ef3aaea83e
refs/heads/master
2020-03-18T21:02:51.889155
2018-05-26T16:50:58
2018-05-26T16:50:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
930
java
package com.indiainnovates.pucho; /** * Created by Raghunandan on 14-01-2016. */ import com.indiainnovates.pucho.utils.Utility; import org.junit.Test; import java.util.regex.Pattern; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; public class EmailValidator { @Test public void emailValidator_CorrectEmailSimple_ReturnsTrue() { assertThat(Utility.validateEmailRegex("name@email.com"), is(true)); } @Test public void name_CorrectName_ReturnsTrue() { assertThat(Utility.validateNameRegex("abcdefg"), is(true)); } /* password must atleast contain 1 capital, 1 special character and 1 number*/ @Test public void password_Correctpassword_ReturnsTrue() { assertThat(Utility.validatePasswordRegex("Raghu@raghu123"), is(true)); } }
[ "raghunandankavi2010@gmail.com" ]
raghunandankavi2010@gmail.com
30f3e89c1bc42f689bde6f5ca6231d174a2a851f
4699df8f9a56ec0b09e36d6089761a6d8c8ae147
/client/jars/org.jboss.tools.rsp.client.cli/src/main/java/org/jboss/tools/rsp/client/bindings/ServerManagementClientLauncher.java
09e175d5e6eafd738563e476f17ff059aec2ee4a
[]
no_license
adietish/rsp-server
7286e042490100b5fad8accc4962b67f44332e96
38eb5fb0c445b96ae2468041b12eac6079bddc2c
refs/heads/master
2020-03-27T08:34:51.490734
2018-12-14T12:20:36
2018-12-14T12:20:36
146,269,085
0
0
null
2019-05-14T15:27:42
2018-08-27T08:27:43
Java
UTF-8
Java
false
false
2,641
java
/******************************************************************************* * Copyright (c) 2018 Red Hat, Inc. Distributed under license by Red Hat, Inc. * All rights reserved. This program is made available under the terms of the * Eclipse Public License v1.0 which accompanies this distribution, and is * available at http://www.eclipse.org/legal/epl-v10.html * * Contributors: Red Hat, Inc. ******************************************************************************/ package org.jboss.tools.rsp.client.bindings; import java.io.IOException; import java.net.Socket; import java.net.UnknownHostException; import org.jboss.tools.rsp.api.RSPServer; import org.jboss.tools.rsp.api.SocketLauncher; import org.jboss.tools.rsp.client.cli.InputProvider; public class ServerManagementClientLauncher { private ServerManagementClientImpl myClient; private SocketLauncher<RSPServer> launcher; private Socket socket; private String host; private int port; private boolean connectionOpen = false; private InputProvider provider; private IClientConnectionClosedListener listener; public ServerManagementClientLauncher(String host, int port, InputProvider provider) { this.host = host; this.port = port; this.provider = provider; } public void launch() throws UnknownHostException, IOException { // create the chat client ServerManagementClientImpl client = new ServerManagementClientImpl(); // connect to the server this.socket = new Socket(host, port); // open a JSON-RPC connection for the opened socket this.launcher = new SocketLauncher<>(client, RSPServer.class, socket); /* * Start listening for incoming message. * When the JSON-RPC connection is closed, * e.g. the server is died, * the client process should exit. */ launcher.startListening().thenRun(() -> clientClosed()); // start the chat session with a remote chat server proxy client.initialize(launcher.getRemoteProxy(), provider); myClient = client; connectionOpen = true; } private void clientClosed() { this.myClient = null; connectionOpen = false; if( listener != null ) listener.connectionClosed(); } public void closeConnection() { if( launcher != null ) { launcher.close(); } } public ServerManagementClientImpl getClient() { return this.myClient; } public boolean isConnectionActive() { return connectionOpen; } public RSPServer getServerProxy() { if( myClient != null ) { return myClient.getProxy(); } return null; } public void setListener(IClientConnectionClosedListener listener) { this.listener = listener; } }
[ "rob@oxbeef.net" ]
rob@oxbeef.net
7ff6d8e2e0ce48d2b0e2575da0c176f4be31ed3e
92b7cbb3c657170d38d75a5cd646fa3be12fd4bb
/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/FortMerchantInstance.java
ecfd3989c904f90fb809675758b4782959fdc553
[]
no_license
uvbs/l2j_mobius
1197702ecd2e2b37b4c5a5f98ec665d6b1c0efef
bf4bbe4124497f338cb5ce50c88c06c6280ca50a
refs/heads/master
2020-07-29T20:43:38.851566
2019-08-08T10:29:34
2019-08-08T10:29:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,826
java
/* * This file is part of the L2J Mobius project. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package org.l2jmobius.gameserver.model.actor.instance; import java.util.StringTokenizer; import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.network.serverpackets.ActionFailed; import org.l2jmobius.gameserver.network.serverpackets.MyTargetSelected; import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation; import org.l2jmobius.gameserver.templates.creatures.NpcTemplate; /** * @author programmos, scoria dev */ public class FortMerchantInstance extends NpcWalkerInstance { public FortMerchantInstance(int objectID, NpcTemplate template) { super(objectID, template); } @Override public void onAction(PlayerInstance player) { if (!canTarget(player)) { return; } // Check if the PlayerInstance already target the NpcInstance if (this != player.getTarget()) { // Set the target of the PlayerInstance player player.setTarget(this); // Send a Server->Client packet MyTargetSelected to the PlayerInstance player MyTargetSelected my = new MyTargetSelected(getObjectId(), 0); player.sendPacket(my); // Send a Server->Client packet ValidateLocation to correct the NpcInstance position and heading on the client player.sendPacket(new ValidateLocation(this)); } else if (!canInteract(player)) // Calculate the distance between the PlayerInstance and the NpcInstance { // Notify the PlayerInstance AI with AI_INTENTION_INTERACT player.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, this); } else { showMessageWindow(player); } // Send a Server->Client ActionFailed to the PlayerInstance in order to avoid that the client wait another packet player.sendPacket(ActionFailed.STATIC_PACKET); } @Override public void onBypassFeedback(PlayerInstance player, String command) { StringTokenizer st = new StringTokenizer(command, " "); String actualCommand = st.nextToken(); // Get actual command String par = ""; if (st.countTokens() >= 1) { par = st.nextToken(); } if (actualCommand.equalsIgnoreCase("Chat")) { int val = 0; try { val = Integer.parseInt(par); } catch (IndexOutOfBoundsException | NumberFormatException ioobe) { } showMessageWindow(player, val); } else if (actualCommand.equalsIgnoreCase("showSiegeInfo")) { showSiegeInfoWindow(player); } else { super.onBypassFeedback(player, command); } } private void showMessageWindow(PlayerInstance player) { showMessageWindow(player, 0); } private void showMessageWindow(PlayerInstance player, int val) { player.sendPacket(ActionFailed.STATIC_PACKET); String filename; if (val == 0) { filename = "data/html/fortress/merchant.htm"; } else { filename = "data/html/fortress/merchant-" + val + ".htm"; } NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); html.setFile(filename); html.replace("%objectId%", String.valueOf(getObjectId())); html.replace("%npcId%", String.valueOf(getNpcId())); if (getFort().getOwnerClan() != null) { html.replace("%clanname%", getFort().getOwnerClan().getName()); } else { html.replace("%clanname%", "NPC"); } html.replace("%castleid%", Integer.toString(getCastle().getCastleId())); player.sendPacket(html); } /** * If siege is in progress shows the Busy HTML<BR> * else Shows the SiegeInfo window * @param player */ public void showSiegeInfoWindow(PlayerInstance player) { if (validateCondition(player)) { getFort().getSiege().listRegisterClan(player); } else { NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); html.setFile("data/html/fortress/merchant-busy.htm"); html.replace("%fortname%", getFort().getName()); html.replace("%objectId%", String.valueOf(getObjectId())); player.sendPacket(html); player.sendPacket(ActionFailed.STATIC_PACKET); } } private boolean validateCondition(PlayerInstance player) { if (getFort().getSiege().getIsInProgress()) { return false; // Busy because of siege } return true; } }
[ "mobius@cyber-wizard.com" ]
mobius@cyber-wizard.com
494cc6f6da5d443a48bd2a121ebceacf7afb38bc
08f41ecf9852010e71bd5a070327239c69ee0c8c
/src/main/java/org/tomitribe/churchkey/Key.java
4662f68293a1c2913bf0114ad77d387c41391cca
[ "Apache-2.0" ]
permissive
jeanouii/churchkey
8f1f74cf9896168727d4a9c080794558effafd88
211e677802be532a519fa1d4747a439799034dea
refs/heads/master
2020-04-26T18:12:08.065034
2018-10-05T03:37:51
2018-10-05T03:37:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,972
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.tomitribe.churchkey; import org.tomitribe.churchkey.jwk.JwkParser; import org.tomitribe.churchkey.pem.PemParser; import org.tomitribe.churchkey.ssh.OpenSSHParser; import org.tomitribe.churchkey.ssh.SSH2Parser; import java.util.HashMap; import java.util.Map; public class Key { private final java.security.Key key; private final Type type; private final Algorithm algorithm; private final Format format; private final Map<String, String> attributes = new HashMap<>(); public Key(final java.security.Key key, final Type type, final Algorithm algorithm, final Format format) { this(key, type, algorithm, format, new HashMap<>()); } public Key(final java.security.Key key, final Type type, final Algorithm algorithm, final Format format, final Map<String, String> attributes) { this.key = key; this.type = type; this.algorithm = algorithm; this.format = format; this.attributes.putAll(attributes); } public Map<String, String> getAttributes() { return attributes; } public String getAttribute(final String name) { return attributes.get(name); } public java.security.Key getKey() { return key; } public Type getType() { return type; } public Algorithm getAlgorithm() { return algorithm; } public Format getFormat() { return format; } public enum Type { PUBLIC, PRIVATE } public enum Algorithm { RSA, DSA, EC } public enum Format { JWK(new JwkParser()), OPENSSH(new OpenSSHParser()), SSH2(new SSH2Parser()), PEM(new PemParser()),; private final Parser parser; Format(final Parser parser) { this.parser = parser; } public byte[] encode(final Key key) { return parser.encode(key); } public Key decode(final byte[] bytes) { return parser.decode(bytes); } public interface Parser { Key decode(final byte[] bytes); byte[] encode(final Key key); } } }
[ "david.blevins@gmail.com" ]
david.blevins@gmail.com
e1950e22357612122307a2d9d30d9e1668258ab3
3e176296759f1f211f7a8bcfbba165abb1a4d3f1
/idea-gosu-plugin/src/main/java/gw/plugin/ij/callhierarchy/GosuCallHierarchyBrowser.java
90c672e742b1dcb7d05d1b539620a55c3725eac7
[ "Apache-2.0", "BSD-3-Clause", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
gosu-lang/old-gosu-repo
6335ac90cd0c635fdec6360e3e208ba12ac0a39e
48c598458abd412aa9f2d21b8088120e8aa9de00
refs/heads/master
2020-05-18T03:39:34.631550
2014-04-21T17:36:38
2014-04-21T17:36:38
1,303,622
1
2
null
null
null
null
UTF-8
Java
false
false
1,038
java
/* * Copyright 2013 Guidewire Software, Inc. */ package gw.plugin.ij.callhierarchy; import com.intellij.ide.hierarchy.HierarchyTreeStructure; import com.intellij.ide.hierarchy.call.CallHierarchyBrowser; import com.intellij.openapi.project.Project; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiMethod; import org.jetbrains.annotations.NotNull; public class GosuCallHierarchyBrowser extends CallHierarchyBrowser { public GosuCallHierarchyBrowser(@NotNull Project project, @NotNull PsiMethod method) { super(project, method); } @Override protected HierarchyTreeStructure createHierarchyTreeStructure(@NotNull String typeName, @NotNull PsiElement psiElement) { if (CALLER_TYPE.equals(typeName)) { return new GosuCallerMethodsTreeStructure(myProject, (PsiMethod) psiElement, getCurrentScopeType()); } else if (CALLEE_TYPE.equals(typeName)) { return new GosuCalleeMethodsTreeStructure(myProject, (PsiMethod) psiElement, getCurrentScopeType()); } else { return null; } } }
[ "lboasso@guidewire.com" ]
lboasso@guidewire.com
9d175f9f7ca068d058186b602cf45b4889157e75
89470ecfa6c4cfddb18e4b0191ecbaecc4d580c0
/koala-bpm/koala-bpm-core/koala-bpm-core-bizmodel/src/main/java/org/openkoala/bpm/core/KoalaAssignDetail.java
00ccb5cc41613ebdc32f98e67c3f49061d4036df
[]
no_license
xuliugen/koala-project
9019188f583c12c2346d178ce695db436dc622f0
9fc1d5be65abbae66b8c6788257b33b279cedc7d
refs/heads/master
2021-01-10T01:18:25.255922
2016-01-03T01:28:31
2016-01-03T01:28:31
47,016,537
0
3
null
null
null
null
UTF-8
Java
false
false
2,308
java
package org.openkoala.bpm.core; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import org.dayatang.domain.AbstractEntity; import org.openkoala.koala.commons.domain.KoalaAbstractEntity; @Entity public class KoalaAssignDetail extends KoalaAbstractEntity { private static final long serialVersionUID = 9037655291650063741L; @ManyToOne(fetch=FetchType.EAGER,cascade = CascadeType.PERSIST) @JoinColumn(name="assign_info_id") private KoalaAssignInfo assignInfo; public KoalaAssignDetail() { super(); } public KoalaAssignDetail(String processId) { super(); this.processId = processId; } public KoalaAssignDetail(KoalaAssignInfo assignInfo, String processId) { super(); this.assignInfo = assignInfo; this.processId = processId; } @Column private String processId; public KoalaAssignInfo getAssignInfo() { return assignInfo; } public void setAssignInfo(KoalaAssignInfo assignInfo) { this.assignInfo = assignInfo; } public String getProcessId() { return processId; } public void setProcessId(String processId) { this.processId = processId; } @Override public String toString() { return "KoalaAssignDetail [assignInfo=" + assignInfo + ", processId=" + processId + "]"; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((assignInfo == null) ? 0 : assignInfo.hashCode()); result = prime * result + ((processId == null) ? 0 : processId.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; KoalaAssignDetail other = (KoalaAssignDetail) obj; if (assignInfo == null) { if (other.assignInfo != null) return false; } else if (!assignInfo.equals(other.assignInfo)) return false; if (processId == null) { if (other.processId != null) return false; } else if (!processId.equals(other.processId)) return false; return true; } @Override public String[] businessKeys() { // TODO Auto-generated method stub return null; } }
[ "1573876303@qq.com" ]
1573876303@qq.com
214aff70050bfc6dab9ff853728c7dc923d4bc73
04316ebe39ccd60b0e4a4e0af6cec0aca3a1c58a
/src/test/java/com/sample/app/tests/ITestResultDemo.java
e059f008a653e1fe01fdc772b7e58b2f970af3d0
[]
no_license
harikrishna553/testng
9b899dae19f3417c9388024aff88066a9b802f2d
bdbba27ba616de539e87a9f57e1c81c9c2df0bfd
refs/heads/master
2023-05-25T23:07:22.072305
2019-11-24T06:59:27
2019-11-24T06:59:27
223,702,416
1
0
null
2023-05-09T18:35:27
2019-11-24T06:29:45
Java
UTF-8
Java
false
false
816
java
package com.sample.app.tests; import static org.testng.Assert.assertTrue; import org.testng.ITestResult; import org.testng.annotations.AfterMethod; import org.testng.annotations.Test; public class ITestResultDemo { @Test public void test1() { assertTrue(false); } @Test public void test2() { assertTrue(true); } @Test public void test3() { assertTrue(false); } @Test public void test4() { assertTrue(true); } @AfterMethod public void logResult(ITestResult itestResult) { String methodName = itestResult.getMethod().getMethodName(); if (itestResult.getStatus() == ITestResult.SUCCESS) { System.out.println("*****" + methodName + " passed*****"); } if (itestResult.getStatus() == ITestResult.FAILURE) { System.out.println("*****" + methodName + " failed*****"); } } }
[ "you@example.com" ]
you@example.com
ac5a456cc11cc1d0e07434497dfa6fa9a647cb17
d9f3b454ed8e581a88c849f299bd0da384d805fd
/src/main/java/com/lanbao/redis/vo/RedisGoodsTypeBrandVo.java
26771083d4250fd5f2cd25647f8fd42ea5dbaf7c
[]
no_license
gulangzai/jiujichina-common-redis
5a7fd23100c8df8679d62f5d6e17a487bf319360
537a9715d52e491a87b7fa83b2b7bf646d114a38
refs/heads/master
2021-07-07T14:22:02.357602
2017-10-06T02:41:26
2017-10-06T02:41:26
105,958,552
0
0
null
null
null
null
UTF-8
Java
false
false
374
java
package com.lanbao.redis.vo; import java.io.Serializable; import java.util.List; public class RedisGoodsTypeBrandVo implements Serializable{ private List<GoodsTypeBrandT>gtbrand; public List<GoodsTypeBrandT> getGtbrand() { return gtbrand; } public void setGtbrand(List<GoodsTypeBrandT> gtbrand) { this.gtbrand = gtbrand; } }
[ "1871710810@qq.com" ]
1871710810@qq.com
2079888f58c3af24f233699542d68620cd041f4b
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/6/6_3e66840ab937f24be80032cb6ea9ca5ef3f2c7d6/DenyBrokerCommissionContractForm/6_3e66840ab937f24be80032cb6ea9ca5ef3f2c7d6_DenyBrokerCommissionContractForm_s.java
34a6e85c95dce8d0601cce93677e1d6840031c36
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
1,520
java
/* This file is part of Cyclos (www.cyclos.org). A project of the Social Trade Organisation (www.socialtrade.org). Cyclos 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. Cyclos is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Cyclos; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package nl.strohalm.cyclos.controls.members.brokering; import org.apache.struts.action.ActionForm; /** * Form used to deny a broker commission contract * @author Jefferson Magno */ public class DenyBrokerCommissionContractForm extends ActionForm { private static final long serialVersionUID = -4326884548930433622L; private long brokerCommissionContractId; public long getBrokerCommissionContractId() { return brokerCommissionContractId; } public void setBrokerCommissionContractId(final long brokerCommissionContractId) { this.brokerCommissionContractId = brokerCommissionContractId; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
bf0d36c17803e1152f076209b9c43fff76f26d0a
ebdcaff90c72bf9bb7871574b25602ec22e45c35
/modules/adwords_appengine/src/main/java/com/google/api/ads/adwords/jaxws/v201809/cm/FunctionError.java
a6bcfcad0645341b7ce625d9f44631174316ac59
[ "Apache-2.0" ]
permissive
ColleenKeegan/googleads-java-lib
3c25ea93740b3abceb52bb0534aff66388d8abd1
3d38daadf66e5d9c3db220559f099fd5c5b19e70
refs/heads/master
2023-04-06T16:16:51.690975
2018-11-15T20:50:26
2018-11-15T20:50:26
158,986,306
1
0
Apache-2.0
2023-04-04T01:42:56
2018-11-25T00:56:39
Java
UTF-8
Java
false
false
2,242
java
// Copyright 2018 Google 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. package com.google.api.ads.adwords.jaxws.v201809.cm; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; /** * * Errors that indicate issues with the function. * * * <p>Java class for FunctionError complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="FunctionError"> * &lt;complexContent> * &lt;extension base="{https://adwords.google.com/api/adwords/cm/v201809}ApiError"> * &lt;sequence> * &lt;element name="reason" type="{https://adwords.google.com/api/adwords/cm/v201809}FunctionError.Reason" minOccurs="0"/> * &lt;/sequence> * &lt;/extension> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "FunctionError", propOrder = { "reason" }) public class FunctionError extends ApiError { @XmlSchemaType(name = "string") protected FunctionErrorReason reason; /** * Gets the value of the reason property. * * @return * possible object is * {@link FunctionErrorReason } * */ public FunctionErrorReason getReason() { return reason; } /** * Sets the value of the reason property. * * @param value * allowed object is * {@link FunctionErrorReason } * */ public void setReason(FunctionErrorReason value) { this.reason = value; } }
[ "jradcliff@users.noreply.github.com" ]
jradcliff@users.noreply.github.com
f7b8edabe0a8b7829a4ce1892ec333c96eaa6f6a
b05338e3a11d6b41e74ea10f97a2b6555a237ac0
/src/com/amazonaws/services/rds/model/transform/SignalCreateDBSnapshotRequestUnmarshaller.java
17509e281f898d2b2338ec56d4f421af8653fb36
[ "Apache-2.0" ]
permissive
TranscendComputing/TopStackRDS
95ee4cb995e4845facad54a5a920ae22c6aba72c
a6a635b3ee2c1ef0ef1b0d864a38f7a5ea5c05f6
refs/heads/master
2021-01-18T17:25:22.085909
2013-11-21T19:27:56
2013-11-21T19:27:56
12,228,558
0
0
null
null
null
null
UTF-8
Java
false
false
1,605
java
package com.amazonaws.services.rds.model.transform; import java.util.Map; import org.slf4j.Logger; import com.transcend.rds.message.SignalCreateDBSnapshotMessage.SignalCreateDBSnapshotRequestMessage; import com.amazonaws.transform.Unmarshaller; import com.msi.tough.core.Appctx; import com.msi.tough.query.QueryUtil; public class SignalCreateDBSnapshotRequestUnmarshaller implements Unmarshaller<SignalCreateDBSnapshotRequestMessage, Map<String, String[]>> { private static Logger logger = Appctx .getLogger(SignalCreateDBSnapshotRequestUnmarshaller.class.getName()); private static SignalCreateDBSnapshotRequestUnmarshaller instance; public static SignalCreateDBSnapshotRequestUnmarshaller getInstance() { if (instance == null) { instance = new SignalCreateDBSnapshotRequestUnmarshaller(); } return instance; } /* * (non-Javadoc) * @see com.amazonaws.transform.Unmarshaller#unmarshall(java.lang.Object) */ @Override public SignalCreateDBSnapshotRequestMessage unmarshall(Map<String, String[]> in) { final SignalCreateDBSnapshotRequestMessage.Builder req = SignalCreateDBSnapshotRequestMessage.newBuilder(); logger.debug("Unmarshalling (inbound) SignalCreateDBSnapshotRequestMessage"); req.setDbInstanceIdentifier(QueryUtil.requiredString(in, "DBInstanceIdentifier")); req.setOriginalDBInstanceIdentifier(QueryUtil.getString(in, "OriginalDBInstanceIdentifier")); req.setDbSnapshotIdentifier(QueryUtil.requiredString(in, "DBSnapshotIdentifier")); req.setAccountIdentifier(QueryUtil.getInt(in, "AccountIdentifier")); return req.buildPartial(); } }
[ "jgardner@transcendcomputing.com" ]
jgardner@transcendcomputing.com
afb481aca37c17998ce58a96bfd977bdaca03903
256ab881258a4d53a121aafe7eda3ce20af0e9ae
/pyy-projects/pyy-system-generate/pyy-system-generate-server/src/main/java/com/thtf/generate/server/controller/DataSourceController.java
617148beac24103051984273d37a3f3856b63e3e
[]
no_license
pyygithub/pyy-admin
a3bfc94433080235c5ddf03fc971e8b449f38062
dfcf52edd6fb2ac133e67bb6cb99734bbb8a323b
refs/heads/master
2022-07-11T19:30:13.526342
2020-01-07T09:09:47
2020-01-07T09:09:47
230,237,975
0
0
null
2022-06-17T02:48:49
2019-12-26T09:46:58
Java
UTF-8
Java
false
false
2,101
java
package com.thtf.generate.server.controller; import com.thtf.common.core.response.Pager; import com.thtf.common.core.response.ResponseResult; import com.thtf.common.log.annotation.Log; import com.thtf.generate.api.DataSourceControllerApi; import com.thtf.generate.api.model.DataSource; import com.thtf.generate.api.vo.DataSourceQueryConditionVO; import com.thtf.generate.server.service.DataSourceService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RestController; import java.util.List; /** * --------------------------- * 代码自动生成数据源管理Controller * --------------------------- * 作者: pyy * 时间: 2019-12-13 14:30:05 * 版本: v1.0 * --------------------------- */ @RestController public class DataSourceController implements DataSourceControllerApi { @Autowired private DataSourceService dataSourceService; @Override public ResponseResult<List<DataSource>> findList(DataSourceQueryConditionVO conditionVO) { return ResponseResult.SUCCESS(dataSourceService.findList(conditionVO)); } @Override public ResponseResult<Pager<DataSource>> findList(int page, int size, DataSourceQueryConditionVO conditionVO) { return ResponseResult.SUCCESS(dataSourceService.findList(page, size, conditionVO)); } @Override @Log(desc = "添加数据源") public ResponseResult<DataSource> add(DataSource dataSource) { return ResponseResult.SUCCESS(dataSourceService.add(dataSource)); } @Override public ResponseResult<DataSource> findById(String id) { return ResponseResult.SUCCESS(dataSourceService.findById(id)); } @Override @Log(desc = "修改数据源") public ResponseResult<DataSource> edit(String id, DataSource dataSource) { return ResponseResult.SUCCESS(dataSourceService.update(id, dataSource)); } @Override @Log(desc = "删除数据源") public ResponseResult delete(String id) { dataSourceService.delete(id); return ResponseResult.SUCCESS(); } }
[ "panyangyang@thtf.com.cn" ]
panyangyang@thtf.com.cn
e69ff34c1ee0eaf203983ced57743625a9d23939
d2984ba2b5ff607687aac9c65ccefa1bd6e41ede
/metamodel/net/datenwerke/rs/base/service/reportengines/table/entities/TableReportVariant__.java
b81ae37500cc4bb8b469cde12827ba692e799274
[]
no_license
bireports/ReportServer
da979eaf472b3e199e6fbd52b3031f0e819bff14
0f9b9dca75136c2bfc20aa611ebbc7dc24cfde62
refs/heads/master
2020-04-18T10:18:56.181123
2019-01-25T00:45:14
2019-01-25T00:45:14
167,463,795
0
0
null
null
null
null
UTF-8
Java
false
false
1,435
java
/* * ReportServer * Copyright (c) 2018 InfoFabrik GmbH * http://reportserver.net/ * * * This file is part of ReportServer. * * ReportServer is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package net.datenwerke.rs.base.service.reportengines.table.entities; import net.datenwerke.dtoservices.dtogenerator.annotations.GeneratedType; /** * This file was automatically created by DtoAnnotationProcessor, version 0.1 */ @GeneratedType("net.datenwerke.entityservices.metadatagenerator.EntityMetadataProcessor") public class TableReportVariant__ extends net.datenwerke.rs.base.service.reportengines.table.entities.TableReport__ implements net.datenwerke.entityservices.metadatagenerator.interfaces.EntityMetadataProvider { public static final String serialVersionUID = "serialVersionUID"; }
[ "srbala@gmail.com" ]
srbala@gmail.com
185bef2dc37db803914c269fc97f74c54f766d87
3729763ddb479b21c7f3a5f1e0a9954500850b52
/Sources/com/workday/sources/AcademicAppointmentIdentifierObjectIDType.java
05bf31a63ab970c0eab3fb39141c6007c47bbc28
[]
no_license
SANDEEPERUMALLA/workdayscanner
fe0816e9a95de73a598d6e29be5b20aeeca6cb60
8a4c3660cc588402aa49f948afe2168c4faa9df5
refs/heads/master
2020-03-18T22:30:21.218489
2018-05-29T20:24:36
2018-05-29T20:24:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,150
java
package com.workday.sources; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlValue; /** * Contains a unique identifier for an instance of an object. * * <p>Java class for Academic_Appointment_IdentifierObjectIDType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="Academic_Appointment_IdentifierObjectIDType"> * &lt;simpleContent> * &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string"> * &lt;attribute name="type" use="required" type="{urn:com.workday/bsvc}Academic_Appointment_IdentifierReferenceEnumeration" /> * &lt;/extension> * &lt;/simpleContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "Academic_Appointment_IdentifierObjectIDType", propOrder = { "value" }) public class AcademicAppointmentIdentifierObjectIDType { @XmlValue protected String value; @XmlAttribute(name = "type", namespace = "urn:com.workday/bsvc", required = true) protected String type; /** * Gets the value of the value property. * * @return * possible object is * {@link String } * */ public String getValue() { return value; } /** * Sets the value of the value property. * * @param value * allowed object is * {@link String } * */ public void setValue(String value) { this.value = value; } /** * Gets the value of the type property. * * @return * possible object is * {@link String } * */ public String getType() { return type; } /** * Sets the value of the type property. * * @param value * allowed object is * {@link String } * */ public void setType(String value) { this.type = value; } }
[ "p.sandeepkumargupta@gmail.com" ]
p.sandeepkumargupta@gmail.com
b7c212fd50b81ff8af9082f87dee34319e6483cc
ac27a137dd027f2be80b68585d49254a7e42ead1
/app/src/main/java/com/amsu/test/other/QuickTransferActivity.java
f5d15db65dfae6823dc5b12609d075aa605a70a1
[]
no_license
1812507678/Test
142af271948fce85c4ef2fb2236736fa49c579bc
e5a3073a184868fdc2270bc0279a5707280e59bf
refs/heads/master
2021-01-20T01:57:03.078992
2018-04-18T10:10:59
2018-04-18T10:10:59
89,349,148
0
0
null
null
null
null
UTF-8
Java
false
false
7,773
java
/* *@author Dawin,2015-3-5 * * * */ package com.amsu.test.other; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.net.Socket; import java.net.UnknownHostException; import java.text.SimpleDateFormat; import java.util.Date; import android.app.Activity; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.net.DhcpInfo; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; import com.amsu.test.R; /*测试需要两部安卓手机A,B。A手机创建WIFI热点作为服务器,B手机连接A手机WIFI热点,作为客户端。*/ //A手机服务器 接收数据步骤:1点击创建Wifi热点2点击"turn_on_receiver"接收数据 //B手机客户端 发送数据步骤:1点击连接Wifi2点击"turn_on_send"发送数据 public class QuickTransferActivity extends Activity { /** Called when the activity is first created. */ TextView content; // 接收到的内容 TextView reciverTv; Button mBtn3, mBtn4; WifiAdmin mWifiAdmin; WifiApAdmin wifiAp; Context context; final static String TAG = "WifiConnection"; private TextView serviceInfo; private PrintWriter out; private BufferedReader bufferedReader; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); content = (TextView) this.findViewById(R.id.content); reciverTv = (TextView) this.findViewById(R.id.reciver); mBtn3 = (Button) findViewById(R.id.button3); mBtn4 = (Button) findViewById(R.id.button4); mBtn3.setText("点击连接Wifi"); mBtn4.setText("点击创建Wifi热点"); serviceInfo = (TextView) findViewById(R.id.service); context = this; // 连接Wifi mBtn3.setOnClickListener(new Button.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub mWifiAdmin = new WifiAdmin(context) { @Override public void myUnregisterReceiver(BroadcastReceiver receiver) { // TODO Auto-generated method stub unregisterReceiver(receiver); } @Override public Intent myRegisterReceiver(BroadcastReceiver receiver, IntentFilter filter) { // TODO Auto-generated method stub registerReceiver(receiver, filter); return null; } @Override public void onNotifyWifiConnected() { // TODO Auto-generated method stub Log.v(TAG, "have connected success!"); Log.v(TAG, "###############################"); } @Override public void onNotifyWifiConnectFailed() { // TODO Auto-generated method stub Log.v(TAG, "have connected failed!"); Log.v(TAG, "###############################"); } }; mWifiAdmin.openWifi(); // 连的WIFI热点是用WPA方式保护 mWifiAdmin.addNetwork(mWifiAdmin.createWifiInfo(Constant.HOST_SPOT_SSID, Constant.HOST_SPOT_PASS_WORD, WifiAdmin.TYPE_WPA)); } }); // 创建WIFI热点 mBtn4.setOnClickListener(new Button.OnClickListener() { @Override public void onClick(View v) { wifiAp = new WifiApAdmin(context); wifiAp.startWifiAp(Constant.HOST_SPOT_SSID, Constant.HOST_SPOT_PASS_WORD); } }); } public void onClick(View view) { // 发送数据 if (view.getId() == R.id.button1) { WifiManager wifiManage = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE); DhcpInfo info = wifiManage.getDhcpInfo(); WifiInfo wifiinfo = wifiManage.getConnectionInfo(); String ip = intToIp(wifiinfo.getIpAddress()); String serverAddress = intToIp(info.serverAddress); SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");// 设置日期格式 // new Date()为获取当前系统时间 String message = "Hello this is dawin ! send time:" + df.format(new Date()); new Sender(serverAddress, message).start(); String msg = "ip:" + ip + "serverAddress:" + serverAddress + info; serviceInfo.setText(msg); Log.w(TAG, msg); } // 接收数据 else if (view.getId() == R.id.button2) { Toast.makeText(QuickTransferActivity.this,"接收数据",Toast.LENGTH_SHORT).show(); /*if (service != null) { service.close(); service = null; //service.close(); } service = new Receiver(); service.start();*/ //test(); } } StringBuffer strBuffer = new StringBuffer(); /** 将获取的int转为真正的ip地址,参考的网上的,修改了下 */ private String intToIp(int i) { return (i & 0xFF) + "." + ((i >> 8) & 0xFF) + "." + ((i >> 16) & 0xFF) + "." + ((i >> 24) & 0xFF); } WifiManager mWifiManager; // 打开WIFI public void openWifi() { if (mWifiAdmin != null) { mWifiAdmin.openWifi(); return; } if (mWifiManager == null) { mWifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); } if (!mWifiManager.isWifiEnabled()) { mWifiManager.setWifiEnabled(true); } } // 关闭WIFI public void closeWifi() { if (mWifiAdmin != null) { mWifiAdmin.closeWifi(); return; } if (mWifiManager == null) { mWifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); } if (mWifiManager.isWifiEnabled()) { mWifiManager.setWifiEnabled(false); } } public void sendData(View view) { String message = "sendData"; if (out!=null){ out.write(message); Log.i(TAG,"我说:" + message); out.flush(); } } /* 客户端发送数据 */ class Sender extends Thread { String serverIp; String message; Sender(String serverAddress, String message) { super(); serverIp = serverAddress; this.message = message; } public void run() { Socket sock = null; try { // 声明sock,其中参数为服务端的IP地址与自定义端口 Log.i(TAG,"serverIp:" + serverIp); sock = new Socket(serverIp, 8080); Log.w("WifiConnection", "I am try to writer" + sock); } catch (UnknownHostException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } try { // 向服务器端发送消息 out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(sock.getOutputStream())), true); //out.println(message); //Log.i(TAG,"我说:" + message); // 接收来自服务器端的消息 /*BufferedReader br = new BufferedReader(new InputStreamReader(sock.getInputStream())); String msg = br.readLine(); Log.i(TAG,"服务器msg:" + msg);*/ bufferedReader = new BufferedReader(new InputStreamReader(sock.getInputStream())); String msg; Log.i(TAG,"socket.isClosed():" + sock.isClosed()); Log.i(TAG,"socket.isConnected():" + sock.isConnected()); Log.i(TAG,"socket.isInputShutdown():" + sock.isInputShutdown()); char[] bytes = new char[1024]; int length; while ((length = bufferedReader.read(bytes))!=-1) { //length = bufferedReader.read(bytes); Log.i(TAG,"length:" + length); String s = String.valueOf(bytes,0,length); Log.i(TAG,"服务器msg:" + s); //output.append("服务器说:" + msg + "\n"); } // 关闭流 /*out.close(); out.flush(); bufferedReader.close();*/ // 关闭Socket //sock.close(); } catch (Exception e) { LogUtil.e("发送错误:[Sender]run()" + e.getMessage()); } } } }
[ "1812507678@qq.com" ]
1812507678@qq.com
1e3ab5613b302e431088d4ce0cc46369bf947706
e71b8f0836caefde47b5b5ddfb094d610eb26be6
/src/test/java/com/smlnskgmail/jaman/codewarsjava/kyu7/Ch4113ng3Test.java
7210fc7be60d20735e236aa72b15a9425ccf2c0a
[]
no_license
fartem/codewars-java
5f8735045d04d89eb2b0d7deab8e4981eda40347
e6ab446eb683382e00610ed2308b20f140e908d3
refs/heads/master
2023-03-08T23:14:30.691003
2021-02-28T14:07:28
2021-02-28T14:07:28
273,966,071
5
1
null
2021-01-20T10:14:32
2020-06-21T18:58:44
Java
UTF-8
Java
false
false
677
java
package com.smlnskgmail.jaman.codewarsjava.kyu7; import org.junit.Test; import static org.junit.Assert.assertEquals; public class Ch4113ng3Test { @Test public void testSomething() { assertEquals( "Fund4m3nt41s", new Ch4113ng3("Fund4m3nt41s").solution() ); assertEquals( "S3v3n", new Ch4113ng3("Seven").solution() ); assertEquals( "Los 4ng313s", new Ch4113ng3("Los Angeles").solution() ); assertEquals( "S3oijs314wuu3", new Ch4113ng3("Seoijselawuue").solution() ); } }
[ "jaman.smlnsk@gmail.com" ]
jaman.smlnsk@gmail.com
746358c5f59374c881ceadb5300f3642b6a25c9b
73f62e55b5963d5a6e7a825ae9d1bcc43801e6a4
/refactoring-to-patterns/src/main/java/com/uj/study/replaceImplicitLanguagewithInterpreter/NotSpec.java
3f9a5859a4f2511318049791605f98007b0b3437
[]
no_license
unclejet/design-patterns
e68fa75871b7ec94b1535b5351984c97a3d07415
f3e84145f8b968ea58fb4b5c210fcd9ac19e3498
refs/heads/master
2022-12-28T02:00:01.982248
2020-10-13T23:31:11
2020-10-13T23:31:11
289,127,943
0
0
null
null
null
null
UTF-8
Java
false
false
473
java
package com.uj.study.replaceImplicitLanguagewithInterpreter; /** * @author :unclejet * @date :Created in 2020/10/14 上午7:24 * @description: * @modified By: * @version: */ public class NotSpec extends Spec { private Spec specToNegate; public NotSpec(Spec specToNegate) { this.specToNegate = specToNegate; } @Override public boolean isSatisfiedBy(Product product) { return !specToNegate.isSatisfiedBy(product); } }
[ "unclejet@126.com" ]
unclejet@126.com
cc3da01f7993511638e609013782496e8f3702a2
de3694f1be420e12ad228fbaa72d17344b15b427
/s40-ci-backend-ejb/src/main/java/com/nokia/ci/ejb/model/BuildEventPhase.java
30204b8633616c828e6d78f26e9a109ae989b177
[]
no_license
slimsymphony/ci-backend
05a760611af610637fafccec5313e2dfac840309
7517d497464dd44e3ee951bddf102eaca26b029a
refs/heads/master
2016-09-06T04:18:48.652987
2014-07-24T08:21:07
2014-07-24T08:21:07
22,204,436
1
0
null
null
null
null
UTF-8
Java
false
false
152
java
/* * Phase for build event entity. */ package com.nokia.ci.ejb.model; /** * * @author jajuutin */ public enum BuildEventPhase { START, END; }
[ "slimsymphony@gmail.com" ]
slimsymphony@gmail.com
8667d058d6f750a13516e985e7070beb0dbd9fb4
6219c8db01dc6dc2ade8c6d0b2942cb901689015
/springmvccas1.1/src/com/cyb/security/MyInvocationSecurityMetadataSourceService.java
2e6d89306036e897ff0cf94a57cd5676c8d3f493
[]
no_license
iechenyb/casstudy
e0c271449ae88964ff9a98e7ecee53aaf532a608
d078640f699d792e9a4916338777351c65ec04c1
refs/heads/master
2021-09-23T09:48:30.616844
2018-09-21T08:22:50
2018-09-21T08:22:50
114,849,640
1
0
null
null
null
null
UTF-8
Java
false
false
5,594
java
package com.cyb.security; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import javax.annotation.PostConstruct; import javax.servlet.http.HttpServletRequest; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.security.access.ConfigAttribute; import org.springframework.security.access.SecurityConfig; import org.springframework.security.web.FilterInvocation; import org.springframework.security.web.access.intercept.FilterInvocationSecurityMetadataSource; import org.springframework.util.AntPathMatcher; import org.springframework.util.CollectionUtils; /** * 作者 : iechenyb<br> * 类描述: 如何在当前环境下知道用户的相关信息?<br> * 创建时间: 2017年12月22日 */ //@Service 手动创建FilterInvocationSecurityMetadataSource public class MyInvocationSecurityMetadataSourceService implements FilterInvocationSecurityMetadataSource { Log log = LogFactory.getLog(MyInvocationSecurityMetadataSourceService.class); UserAuthDao userAuthDao = new MemAuthDaoImpl(); /*//手动注入 public void setUserAuthDao(UserAuthDao userAuthDao) { this.userAuthDao = userAuthDao; } private Map<String, Collection<ConfigAttribute>> resourceMap = new HashMap<>(); @PostConstruct// 被@PostConstruct修饰的方法会在服务器加载Servle的时候运行,并且只会被服务器执行一次。PostConstruct在构造函数之后执行,init()方法之前执行。 private void loadResourceDefine() { resourceMap.clear();//清空旧数据 //读取所有的url-role信息 并不是以人为单位! Map<String,String> urlRolesData = userAuthDao.roleResources(); for(String url:urlRolesData.keySet()){ Collection<ConfigAttribute> configAttributes = new ArrayList<ConfigAttribute>(); configAttributes.add(new SecurityConfig(urlRolesData.get(url)));//只用一个地址 resourceMap.put(url, configAttributes);//同一个url 可以有多个角色访问 } } *//** * 查找url对应的角色 如何获取当前用户的权限信息 *//* public void loadResourceDefine(String url_) { System.out.println("根据url查找加载权限资源文件!"); if (resourceMap == null) { loadResourceDefine(); } } @Override public Collection<ConfigAttribute> getAttributes(Object object) throws IllegalArgumentException { if (CollectionUtils.isEmpty(resourceMap)) loadResourceDefine();//加载所有 HttpServletRequest request = ((FilterInvocation) object).getHttpRequest(); String url = request.getRequestURI(); url = url.replaceFirst(request.getContextPath(), ""); log.info("url:"+url+",access="+resourceMap.containsKey(url)); return resourceMap.get(url);//返回空,说明不受限制,放行,可以访问。不为空,则进行权限过滤,必须存在指定的角色才能访问。 } public Collection<ConfigAttribute> getAllConfigAttributes() { return new ArrayList<ConfigAttribute>(); } public boolean supports(Class<?> aClass) { return true; }*/ private AntPathMatcher urlMatcher = new AntPathMatcher();; public static Map<String, List<ConfigAttribute>> resourceMap = null; public MyInvocationSecurityMetadataSourceService() { // loadResourceDefine(); } private void loadResourceDefine() { resourceMap = new HashMap<String, List<ConfigAttribute>>(); /* Map<String, List<String>> hash = moduleAuthService.getAllModuleAuthRef(); for(String url : hash.keySet()) { List<ConfigAttribute> list = new ArrayList<ConfigAttribute>(); List<String> authList = hash.get(url); for(String auth : authList) { list.add(new SecurityConfig(auth)); } resourceMap.put(url, list); }*/ Map<String,String> urlRolesData = userAuthDao.roleResources(); for(String url:urlRolesData.keySet()){ List<ConfigAttribute> configAttributes = new ArrayList<ConfigAttribute>(); configAttributes.add(new SecurityConfig(urlRolesData.get(url)));//只用一个地址 resourceMap.put(url, configAttributes);//同一个url 可以有多个角色访问 } } // According to a URL, Find out permission configuration of this URL. @Override public List<ConfigAttribute> getAttributes(Object object) throws IllegalArgumentException { if(resourceMap == null) { loadResourceDefine(); } // guess object is a URL. String url = ((FilterInvocation) object).getRequestUrl(); if(url.indexOf("?") != -1) { url = url.substring(0, url.indexOf("?")); } List<ConfigAttribute> result = null; Iterator<String> ite = resourceMap.keySet().iterator(); while (ite.hasNext()) { String resURL = ite.next(); System.out.println("requrl="+url+",resourceURL="+resURL); if (urlMatcher.match(resURL, url)) { result = resourceMap.get(resURL); System.out.println("resURL : " + resURL + " , result : " + result); return result; } } return null; } public boolean supports(Class<?> clazz) { return true; } public Collection<ConfigAttribute> getAllConfigAttributes() { return null; } }
[ "zzuchenyb@sina.com" ]
zzuchenyb@sina.com
72866a01021a04f063ada492bd27c913d420aea6
39c9f292f46e0866c46e2b3310f4db9ec98890db
/DevLibUtils/src/main/java/dev/utils/app/info/KeyValueBean.java
05cf0e3c69e693d46f1a424a22d915df09a99e43
[ "Apache-2.0" ]
permissive
szn0212/DevUtils
20ca48406d4177a831628f1403b3355d92a90fa1
708dc4b4080a8ce17e6bd6f85b94fc16a9563b65
refs/heads/master
2020-05-29T14:42:41.129952
2019-05-28T21:33:40
2019-05-28T21:33:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,206
java
package dev.utils.app.info; import android.support.annotation.Keep; import android.support.annotation.StringRes; import dev.DevUtils; /** * detail: 键对值 实体类 * @author Ttt */ public class KeyValueBean { @Keep // 键 - 提示 protected String key = ""; @Keep // 值 - 参数值 protected String value = ""; /** * 构造函数 * @param key key * @param value value */ public KeyValueBean(final String key, final String value) { this.key = key; this.value = value; } /** * 获取 key * @return key */ public String getKey() { return key; } /** * 获取 value * @return value */ public String getValue() { return value; } @Override public String toString() { return key + ": " + value; } /** * 通过 resId 设置 key, 并且初始化 KeyValueBean * @param resId R.string.id * @param value value * @return {@link KeyValueBean} */ public static KeyValueBean get(@StringRes final int resId, final String value) { return new KeyValueBean(DevUtils.getContext().getString(resId), value); } }
[ "13798405957@163.com" ]
13798405957@163.com
dd5bcb5d0ca7c9c9e07c4240ef7ccb1a8d04ff19
4e4279e4c43890d105c7dbe7dc96c3c623c1ec0b
/afiliados-tests/test-affiliated-event-persistence/src/test/java/uol/test/step/persistence/PersistenceGivenSteps.java
8208510b774adc322928c86f376eb8ab381efd24
[]
no_license
proctiger/automation
d7550988bb9528dab9af08867a22d6c8e295df18
8a2d8169d21ec6ae9a52c89b27164b05a76ce7b6
refs/heads/master
2016-09-15T22:25:05.094858
2013-11-27T13:50:43
2013-11-27T13:50:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,196
java
package uol.test.step.persistence; import java.io.PrintWriter; import uol.affiliated.commons.test.CucumberTestUtil; import uol.affiliated.commons.test.TestStep; import uol.affiliated.commons.test.DAO.AeEventLogDAOImpl; import uol.affiliated.commons.test.exception.StepException; import cucumber.api.java.pt.Dado; public class PersistenceGivenSteps extends AbstractPersistenceSteps { @Dado("^que nao exista um evento de <(.*)> para o afiliado <(.+)> na tabela de eventos$") public void cleanEventLog(final String eventType , final String namLogin) throws StepException { CucumberTestUtil.given(new TestStep() { public void execute(PrintWriter printer) throws StepException { AeEventLogDAOImpl aeeventlogdaoimpl = new AeEventLogDAOImpl(dbUtil); try { aeeventlogdaoimpl.deleteEventByNamLoginAndDesName(namLogin, eventType); } catch(Exception e) { throw new StepException(e); } printer.println(String.format("Eventos de %s do afiliado %s deletados.", eventType ,namLogin)); } }); } }
[ "willians.romera@gmail.com" ]
willians.romera@gmail.com
2543ff3c3eb5fc4af2e6fd67e42ac9591318935e
89972779259818d76e3d249a52153e4f42dd9501
/old/vnm-selfcare-webapps-mega2-master/vnm-selfcare-core-2.0/src/main/java/com/gnv/vnm/selfcare/core/fault/TokenExpiredException.java
f38f0e350648a618a336b0d13547bcfccf0b0dfa
[]
no_license
SM-Tiwari/Spring-Security
5514149eb7e082e04f04dab0cbcbf9fb1df5d84e
f0676d3a96748d476c226ba7e724896eab77fa71
refs/heads/master
2022-12-28T18:07:32.056655
2020-01-31T03:31:13
2020-01-31T03:31:13
237,351,143
0
0
null
2022-12-10T01:04:42
2020-01-31T03:10:35
Java
UTF-8
Java
false
false
927
java
/** * PasswordMismatchException.java */ package com.gnv.vnm.selfcare.core.fault; /** * @author nandipinto * */ public class TokenExpiredException extends InvalidTokenException { private static final long serialVersionUID = 6708531960977655790L; public TokenExpiredException() { } /** * @param message * @param cause * @param enableSuppression * @param writableStackTrace */ public TokenExpiredException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { super(message, cause, enableSuppression, writableStackTrace); } /** * @param message * @param cause */ public TokenExpiredException(String message, Throwable cause) { super(message, cause); } /** * @param message */ public TokenExpiredException(String message) { super(message); } /** * @param cause */ public TokenExpiredException(Throwable cause) { super(cause); } }
[ "siddhesh.mani@infotelgroup.in" ]
siddhesh.mani@infotelgroup.in
b137e5b7ede79b14f91e58650d52cca1182dd37d
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_74b7a938e0b8de3fe8122f985502498efb258877/TaxTransactionSyncType/2_74b7a938e0b8de3fe8122f985502498efb258877_TaxTransactionSyncType_s.java
eeb05728852e490a211a558d5bd3b7cd5069ee69
[]
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,016
java
/** * Mule Vertex Connector * * Copyright (c) MuleSoft, Inc. All rights reserved. http://www.mulesoft.com * * The software in this package is published under the terms of the CPAL v1.0 * license, a copy of which has been included with this distribution in the * LICENSE.txt file. */ package org.mule.modules.vertex; import org.apache.commons.lang.StringUtils; /** * @author Pablo Diez * @since 14/03/2012 */ public enum TaxTransactionSyncType { REVERSAL_TYPE(), TRANSACTION_EXISTS_TYPE(), ACCRUAL_SYNC_TYPE(), AP_INVOICE_TYPE("getAPInvoiceSync"), AR_BILLING_TYPE("getARBilling"), DELETE_TYPE(), ROLLBACK_TYPE(); private String customAttributeName = null; private TaxTransactionSyncType(String responseGetter) { this.customAttributeName = responseGetter; } private TaxTransactionSyncType() { } public String getRequestGetter() { String res = "get" + StringUtils.capitalize(getCammelType()) + "Request"; return this.customAttributeName == null ? res : this.customAttributeName + "Request"; } public String getResponseGetter() { String res = "get" + StringUtils.capitalize(getCammelType()) + "Response"; return this.customAttributeName == null ? res : this.customAttributeName + "Response"; } public String getCammelType() { String[] split = StringUtils.split(this.toString(), '_'); final StringBuilder cammel = new StringBuilder(); cammel.append(split[0].toLowerCase()); for (int i = 1; i < split.length - 1; i++) { cammel.append(StringUtils.capitalize(StringUtils.lowerCase(split[i]))); } return cammel.toString(); } public String getRequestAttr() { return this.customAttributeName == null ? getCammelType() + "Request" : StringUtils.removeStart( customAttributeName, "get") + "Request"; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
aadef64412089db813a1c00a626c3fe7aa5c19f6
3a99f2a3a7d368641592e41806bae1a882c6263b
/KalturaClient/src/main/java/com/kaltura/client/types/AttUverseDistributionProfileBaseFilter.java
2fdd778eb4bdfe65655b12f6dd06f3a4871bed30
[ "MIT" ]
permissive
fahadnasrullah109/KalturaClient-Android
762934a818ecdd0527ff7275594beb6e60724354
f753b968023e55b7629ccefce845e2482d2f6dae
refs/heads/master
2020-04-04T18:50:15.830303
2018-11-05T10:56:19
2018-11-05T10:56:19
156,181,417
0
0
null
null
null
null
UTF-8
Java
false
false
2,438
java
// =================================================================================================== // _ __ _ _ // | |/ /__ _| | |_ _ _ _ _ __ _ // | ' </ _` | | _| || | '_/ _` | // |_|\_\__,_|_|\__|\_,_|_| \__,_| // // This file is part of the Kaltura Collaborative Media Suite which allows users // to do with audio, video, and animation what Wiki platfroms allow them to do with // text. // // Copyright (C) 2006-2018 Kaltura Inc. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the // License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. // // @ignore // =================================================================================================== package com.kaltura.client.types; import android.os.Parcel; import com.google.gson.JsonObject; import com.kaltura.client.Params; import com.kaltura.client.utils.request.MultiRequestBuilder; /** * This class was generated using exec.php * against an XML schema provided by Kaltura. * * MANUAL CHANGES TO THIS CLASS WILL BE OVERWRITTEN. */ @SuppressWarnings("serial") @MultiRequestBuilder.Tokenizer(AttUverseDistributionProfileBaseFilter.Tokenizer.class) public abstract class AttUverseDistributionProfileBaseFilter extends ConfigurableDistributionProfileFilter { public interface Tokenizer extends ConfigurableDistributionProfileFilter.Tokenizer { } public AttUverseDistributionProfileBaseFilter() { super(); } public AttUverseDistributionProfileBaseFilter(JsonObject jsonObject) throws APIException { super(jsonObject); } public Params toParams() { Params kparams = super.toParams(); kparams.add("objectType", "KalturaAttUverseDistributionProfileBaseFilter"); return kparams; } public AttUverseDistributionProfileBaseFilter(Parcel in) { super(in); } }
[ "fahad.nasrullah@sofodynamix.com" ]
fahad.nasrullah@sofodynamix.com
2544442cbded9ca7d7a0916f0bd7e5a65531ee86
3e2a5dee1989d504d21ad626b28461b8e92c482a
/appC/CalculatorService/src/mjg/calc/service/jaxws/Multiply.java
7f08e841c7cacbc0470b8177e36151cce99f294c
[ "MIT", "Apache-2.0" ]
permissive
kousen/Making-Java-Groovy
3275e08f70cf3f94a290daae79293ec870452fb0
8d7e95b90155da0b1bd4a395230c11bd6672ff9c
refs/heads/master
2023-07-19T22:43:27.972523
2023-07-08T01:59:47
2023-07-08T01:59:47
2,806,990
92
66
MIT
2023-07-08T01:59:48
2011-11-19T02:32:04
Groovy
UTF-8
Java
false
false
1,876
java
/* =================================================== * Copyright 2012 Kousen IT, 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 mjg.calc.service.jaxws; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; @XmlRootElement(name = "multiply", namespace = "http://service.calc.mjg/") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "multiply", namespace = "http://service.calc.mjg/", propOrder = { "x", "y" }) public class Multiply { @XmlElement(name = "x", namespace = "") private double x; @XmlElement(name = "y", namespace = "") private double y; /** * * @return * returns double */ public double getX() { return this.x; } /** * * @param x * the value for the x property */ public void setX(double x) { this.x = x; } /** * * @return * returns double */ public double getY() { return this.y; } /** * * @param y * the value for the y property */ public void setY(double y) { this.y = y; } }
[ "ken.kousen@kousenit.com" ]
ken.kousen@kousenit.com
12521352b0d6482e8dc23e74d5ea887a9aa8b108
eef372565ca7a8ed8a9a0faeb79338a4edc8f094
/PTN_Client(2015)/src/com/nms/service/impl/base/OperationBase.java
7951920c95590107e570d7d61e9a2bd09f50b608
[]
no_license
ptn2017/ptn2017
f42db27fc54c1fe5938407467b395e6b0a8721f7
7090e2c64b2ea7f38e530d58247dfba4b2906b9a
refs/heads/master
2021-09-04T08:12:08.639049
2018-01-17T07:24:44
2018-01-17T07:24:44
112,810,000
0
0
null
null
null
null
UTF-8
Java
false
false
1,636
java
package com.nms.service.impl.base; import java.util.Date; import com.nms.db.bean.equipment.shelf.SiteInst; import com.nms.model.equipment.shlef.SiteService_MB; import com.nms.model.util.Services; import com.nms.ui.manager.ConstantUtil; import com.nms.ui.manager.ExceptionManage; import com.nms.ui.manager.UiUtil; public class OperationBase { /** 超时时间 秒 */ private int timeout = 30000; /** * 是否超时 * * @return */ public boolean isTimeOut(Date date) { long nowDate = new Date().getTime(); long timeoutDate = date.getTime() + this.timeout; if (nowDate >= timeoutDate) { return true; } else { return false; } } public boolean isTimeOut(Date date,int time) { long nowDate = new Date().getTime(); long timeoutDate = date.getTime() + time; if (nowDate >= timeoutDate) { return true; } else { return false; } } /** * 根据网元ID获取网元厂商 * @param siteId 网元主键 * @return 厂商 * @throws Exception */ public int getManufacturer(int siteId) throws Exception{ int manufacturer=0; SiteService_MB siteService= null; SiteInst siteInst=null; try { siteService=(SiteService_MB) ConstantUtil.serviceFactory.newService_MB(Services.SITE); siteInst=siteService.select(siteId); if(siteInst == null){ throw new Exception("根据ID查询网元出错"); } manufacturer=Integer.parseInt(UiUtil.getCodeById(Integer.parseInt(siteInst.getCellEditon())).getCodeValue()); } catch (Exception e) { ExceptionManage.dispose(e,DispatchBase.class); }finally{ UiUtil.closeService_MB(siteService); } return manufacturer; } }
[ "a18759149@qq.com" ]
a18759149@qq.com
6569d89ef6ad51d67ff50e750f4ff8a08be4074b
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/apereo--cas/f9ddd8541e5853333157c3847bd31bdd43a84dbd/before/JRadiusServerImpl.java
8f191662ecfff44f687a3c558e892cb8fd017a6a
[]
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
3,973
java
/* * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig 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 the following location: * * 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.jasig.cas.adaptors.radius; import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; import net.jradius.client.RadiusClient; import net.jradius.dictionary.Attr_UserName; import net.jradius.dictionary.Attr_UserPassword; import net.jradius.exception.RadiusException; import net.jradius.exception.UnknownAttributeException; import net.jradius.packet.AccessAccept; import net.jradius.packet.AccessRequest; import net.jradius.packet.RadiusPacket; import net.jradius.packet.attribute.AttributeFactory; import net.jradius.packet.attribute.AttributeList; import org.jasig.cas.authentication.PreventedException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Implementation of a RadiusServer that utilizes the JRadius packages available * at <a href="http://jradius.sf.net">http://jradius.sf.net</a>. * * @author Scott Battaglia * @author Marvin S. Addison * @since 3.1 */ public final class JRadiusServerImpl implements RadiusServer { /** Default retry count, {@value}. */ public static final int DEFAULT_RETRY_COUNT = 3; /** Logger instance. */ private static final Logger LOGGER = LoggerFactory.getLogger(JRadiusServerImpl.class); /** RADIUS protocol. */ @NotNull private final RadiusProtocol protocol; /** Produces RADIUS client instances for authentication. */ @NotNull private final RadiusClientFactory radiusClientFactory; /** Number of times to retry authentication when no response is received. */ @Min(0) private int retries = DEFAULT_RETRY_COUNT; /** Load the dictionary implementation. */ static { AttributeFactory .loadAttributeDictionary("net.jradius.dictionary.AttributeDictionaryImpl"); } public JRadiusServerImpl(final RadiusProtocol protocol, final RadiusClientFactory clientFactory) { this.protocol = protocol; this.radiusClientFactory = clientFactory; } @Override public boolean authenticate(final String username, final String password) throws PreventedException { final AttributeList attributeList = new AttributeList(); attributeList.add(new Attr_UserName(username)); attributeList.add(new Attr_UserPassword(password)); final RadiusClient client = this.radiusClientFactory.newInstance(); try { final AccessRequest request = new AccessRequest(client, attributeList); final RadiusPacket response = client.authenticate( request, RadiusClient.getAuthProtocol(this.protocol.getName()), this.retries); LOGGER.debug("RADIUS response from {}: {}", client.getRemoteInetAddress().getCanonicalHostName(), response.getClass().getName()); if (response instanceof AccessAccept) { return true; } } catch (final UnknownAttributeException e) { throw new PreventedException(e); } catch (final RadiusException e) { throw new PreventedException(e); } finally { client.close(); } return false; } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
b57dc2fc0cae3305c758f63aa7210bb4d9f2a675
198b414444851f724d4294055925ee2260f0477a
/module_permission/src/main/java/com/karashok/library/module_permission/ui/activity/PermissionAty.java
9be1a4090325bf0fbf8658603b25b25e4a832d54
[ "Apache-2.0" ]
permissive
KaraShok/MVVM-Android-For-Java
39f0f453a95f5bd800e18742d9d8eacd6a238bf5
e5d625717606f354be5b95f7eb43d22fd9aa56c1
refs/heads/master
2020-12-13T02:56:31.880807
2020-04-14T10:22:25
2020-04-14T10:22:25
234,293,009
2
0
null
null
null
null
UTF-8
Java
false
false
6,317
java
package com.karashok.library.module_permission.ui.activity; import android.Manifest; import android.annotation.SuppressLint; import android.content.DialogInterface; import android.os.Bundle; import androidx.annotation.NonNull; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import com.alibaba.android.arouter.facade.Postcard; import com.alibaba.android.arouter.facade.annotation.Autowired; import com.alibaba.android.arouter.facade.callback.NavigationCallback; import com.alibaba.android.arouter.launcher.ARouter; import com.karashok.library.module_permission.R; import com.karashok.library.module_util.utilcode.utils.base_util.LogUtils; import permissions.dispatcher.NeedsPermission; import permissions.dispatcher.OnNeverAskAgain; import permissions.dispatcher.OnPermissionDenied; import permissions.dispatcher.OnShowRationale; import permissions.dispatcher.PermissionRequest; import permissions.dispatcher.RuntimePermissions; @RuntimePermissions public class PermissionAty extends AppCompatActivity { @Autowired(name = "routerPath") String mRouterPath; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.aty_permission); ARouter.getInstance().inject(PermissionAty.this); // PermissionAtyPermissionsDispatcher.requestAllPermWithPermissionCheck(PermissionAty.this); } @Override protected void onResume() { super.onResume(); // Fresco.initialize(this); // OpenFileUtils.init(this); //PermissionUtils.init(this.getApplication()); } /** * 申请权限 * * 拿到全部授权后会调用此方法 */ @NeedsPermission({ Manifest.permission.INTERNET, Manifest.permission.ACCESS_NETWORK_STATE, Manifest.permission.ACCESS_WIFI_STATE, Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.CAMERA, Manifest.permission.READ_PHONE_STATE, Manifest.permission.REQUEST_INSTALL_PACKAGES }) protected void requestAllPerm(){ ARouter.getInstance() .build("/Doc_SAMPLE/MainAty") .navigation(PermissionAty.this, new NavigationCallback() { @Override public void onFound(Postcard postcard) { } @Override public void onLost(Postcard postcard) { } @Override public void onArrival(Postcard postcard) { PermissionAty.this.finish(); } @Override public void onInterrupt(Postcard postcard) { } }); } /** * 权限说明 * * 当有权限被禁止但可以再次询问时,下次会调用此方法展示说明,可以继续申请权限 * @param request */ @OnShowRationale({ Manifest.permission.INTERNET, Manifest.permission.ACCESS_NETWORK_STATE, Manifest.permission.ACCESS_WIFI_STATE, Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.CAMERA, Manifest.permission.READ_PHONE_STATE, Manifest.permission.REQUEST_INSTALL_PACKAGES }) protected void rationaleAllPerm(PermissionRequest request){ showRationaleDialog(request); } /** * 权限被禁止 * * 有权限此次授权被禁止会调用此方法 */ @OnPermissionDenied({ Manifest.permission.INTERNET, Manifest.permission.ACCESS_NETWORK_STATE, Manifest.permission.ACCESS_WIFI_STATE, Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.CAMERA, Manifest.permission.READ_PHONE_STATE, Manifest.permission.REQUEST_INSTALL_PACKAGES }) protected void deniedPerm(){ } /** * 权限被禁止并不再询问 * * 如果有被禁止的权限就会调用此方法 */ @OnNeverAskAgain({ Manifest.permission.INTERNET, Manifest.permission.ACCESS_NETWORK_STATE, Manifest.permission.ACCESS_WIFI_STATE, Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.CAMERA, Manifest.permission.READ_PHONE_STATE, Manifest.permission.REQUEST_INSTALL_PACKAGES }) protected void neverAskiAgain(){ } @SuppressLint("NeedOnRequestPermissionsResult") @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); // PermissionAtyPermissionsDispatcher.onRequestPermissionsResult(PermissionAty.this, requestCode, grantResults); LogUtils.dTag("PermissionAty", "onRequestPermissionsResult: "); // for (int i = 0, size = grantResults.length; i < size; i++){ // if (grantResults[i] == -1){ // mPermissions.add(permissions[i]); // } // } } private void showRationaleDialog(final PermissionRequest request) { new AlertDialog.Builder(this) .setPositiveButton("Allow", new DialogInterface.OnClickListener() { @Override public void onClick(@NonNull DialogInterface dialog, int which) { request.proceed(); } }) .setNegativeButton("Deny", new DialogInterface.OnClickListener() { @Override public void onClick(@NonNull DialogInterface dialog, int which) { request.cancel(); } }) .setCancelable(false) .setMessage("权限说明!") .show(); } }
[ "user@example.com" ]
user@example.com
89c14c43e8b0901916c13851854b822f962bb23b
73e025f36b9cfb73275a4b1a5e84a14147edf014
/hazelcast/src/main/java/com/hazelcast/monitor/impl/LocalOperationStatsImpl.java
13951b23cb3afe3fcfe51dca6a2245e54e0eda28
[ "Apache-2.0" ]
permissive
brunolellis/hazelcast
5aa68a203156e5ecec9bb05e7eac6d7a51ca6522
43faf901c25e059d3fa3eb1d07e5bcba415cada2
refs/heads/master
2021-01-18T07:52:40.743604
2015-03-07T10:29:52
2015-03-07T10:29:52
7,037,107
0
0
null
null
null
null
UTF-8
Java
false
false
4,136
java
/* * Copyright (c) 2008-2015, Hazelcast, 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.hazelcast.monitor.impl; import com.eclipsesource.json.JsonArray; import com.eclipsesource.json.JsonObject; import com.hazelcast.instance.Node; import com.hazelcast.monitor.LocalOperationStats; import com.hazelcast.spi.impl.InternalOperationService; import com.hazelcast.spi.impl.SlowOperationLog; import java.util.Collection; import java.util.concurrent.ConcurrentLinkedQueue; import static com.hazelcast.util.JsonUtil.getLong; /** * Hazelcast statistic implementations for local operations. */ public class LocalOperationStatsImpl implements LocalOperationStats { private long creationTime; private Collection<SlowOperationLog> logs; private long maxVisibleSlowOperationCount; public LocalOperationStatsImpl() { this.logs = new ConcurrentLinkedQueue<SlowOperationLog>(); this.maxVisibleSlowOperationCount = Long.MAX_VALUE; } public LocalOperationStatsImpl(Node node) { this.logs = ((InternalOperationService) node.nodeEngine.getOperationService()).getSlowOperationLogs(); this.maxVisibleSlowOperationCount = node.groupProperties.MC_MAX_SLOW_OPERATION_COUNT.getInteger(); } @Override public long getCreationTime() { return creationTime; } @Override public JsonObject toJson() { JsonObject root = new JsonObject(); root.add("creationTime", creationTime); root.add("maxVisibleSlowOperationCount", maxVisibleSlowOperationCount); JsonArray slowOperationLogs = new JsonArray(); int logCount = 0; for (SlowOperationLog log : logs) { if (logCount++ < maxVisibleSlowOperationCount) { slowOperationLogs.add(log.toJson()); } } root.add("slowOperationLogs", slowOperationLogs); return root; } @Override public void fromJson(JsonObject json) { creationTime = getLong(json, "creationTime", -1L); maxVisibleSlowOperationCount = getLong(json, "maxVisibleSlowOperationCount", Long.MAX_VALUE); } @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof LocalOperationStatsImpl)) { return false; } LocalOperationStatsImpl that = (LocalOperationStatsImpl) o; if (creationTime != that.creationTime) { return false; } if (maxVisibleSlowOperationCount != that.maxVisibleSlowOperationCount) { return false; } if (logs != null ? !isEqualLogs(that.logs) : that.logs != null) { return false; } return true; } private boolean isEqualLogs(Collection<SlowOperationLog> thatLogs) { if (logs.size() != thatLogs.size()) { return false; } if (!logs.containsAll(thatLogs)) { return false; } return true; } @Override public int hashCode() { int result = logs != null ? logs.hashCode() : 0; result = 31 * result + (int) (creationTime ^ (creationTime >>> 32)); result = 31 * result + (int) (maxVisibleSlowOperationCount ^ (maxVisibleSlowOperationCount >>> 32)); return result; } @Override public String toString() { return "LocalOperationStatsImpl{" + "creationTime=" + creationTime + ", logs=" + logs + ", maxVisibleSlowOperationCount=" + maxVisibleSlowOperationCount + '}'; } }
[ "github@thunderphreak.de" ]
github@thunderphreak.de
d349c7ada4ffebcea6dd39fbaac11153c131524f
334a169ae95e2320f3ba6670974f5bde75168195
/app/src/main/java/com/example/demosocialuserapitest/Activity/PostsActivity.java
c3e7d4309c9575defeb1a93571266e7e4477c518
[]
no_license
SadakatulShakil/DemoSocialUserApiTest
ba339114c0fb53c4438ae7b8ba6a84ef63a57dbd
378ec0909fb3c5b28fc5ede89325fc2f1a7f6f83
refs/heads/master
2022-11-18T04:23:32.927990
2020-07-14T13:32:03
2020-07-14T13:32:03
279,249,913
1
0
null
null
null
null
UTF-8
Java
false
false
3,731
java
package com.example.demosocialuserapitest.Activity; import androidx.appcompat.app.AppCompatActivity; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.widget.TextView; import android.widget.Toast; import com.example.demosocialuserapitest.Adapters.PostAdapter; import com.example.demosocialuserapitest.Adapters.UserAdapter; import com.example.demosocialuserapitest.Api.ApiInterface; import com.example.demosocialuserapitest.Api.RetrofitClient; import com.example.demosocialuserapitest.PostUtils.UserPost; import com.example.demosocialuserapitest.R; import com.example.demosocialuserapitest.UserUtils.User; import java.util.ArrayList; import java.util.List; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; import retrofit2.Retrofit; public class PostsActivity extends AppCompatActivity { private TextView tvUserName; private RecyclerView pRecyclerView; private PostAdapter postAdapter; private RecyclerView.LayoutManager layoutManager; private ArrayList<UserPost> postInfoList = new ArrayList<>(); private ArrayList<UserPost> speceficPostInfoList = new ArrayList<>(); private User userInfo = new User(); private static final String TAG = "PostsActivity"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_posts); init(); final Intent intent = getIntent(); userInfo = (User) intent.getSerializableExtra("userInfo"); if (userInfo != null) { String name = userInfo.getUsername(); tvUserName.setText("Posts of " + name + ":"); } postAdapter = new PostAdapter(PostsActivity.this, speceficPostInfoList); layoutManager = new LinearLayoutManager(PostsActivity.this); pRecyclerView.setLayoutManager(layoutManager); pRecyclerView.setAdapter(postAdapter); loadPostData(); } private void loadPostData() { String strUrl = RetrofitClient.BASE_URL + "posts"; Retrofit retrofit = RetrofitClient.getRetrofitClient(); ApiInterface api = retrofit.create(ApiInterface.class); Call<List<UserPost>> call = api.getByPostUrl(strUrl); call.enqueue(new Callback<List<UserPost>>() { @Override public void onResponse(Call<List<UserPost>> call, Response<List<UserPost>> response) { if (response.code() == 200) { Log.d(TAG, "onResponse: " + response.code()); postInfoList.addAll(response.body()); /* for(int i = 0; i<postInfoList.size();i++){ if(userInfo.getId().equals(postInfoList.get(i).getUserId())){ speceficPostInfoList. } }*/ for(UserPost userPost : postInfoList){ if(userInfo.getId().equals(userPost.getUserId())) speceficPostInfoList.add(userPost); } postAdapter.notifyDataSetChanged(); } } @Override public void onFailure(Call<List<UserPost>> call, Throwable t) { Toast.makeText(PostsActivity.this, "errorCode-" + t.getLocalizedMessage(), Toast.LENGTH_LONG).show(); } }); } private void init() { pRecyclerView = findViewById(R.id.postInfoRecycleView); tvUserName = findViewById(R.id.userInfo); } }
[ "sadakatulshakil94@gmail.com" ]
sadakatulshakil94@gmail.com
8a32dcadb8fa7f5d28307a0138771e7489ffdc14
14746c4b8511abe301fd470a152de627327fe720
/soroush-android-1.10.0_source_from_JADX/org/jivesoftware/smackx/iot/discovery/provider/IoTRemovedProvider.java
773429a46d35f5010e24837a07f60dac1bd0ccf9
[]
no_license
maasalan/soroush-messenger-apis
3005c4a43123c6543dbcca3dd9084f95e934a6f4
29867bf53a113a30b1aa36719b1c7899b991d0a8
refs/heads/master
2020-03-21T21:23:20.693794
2018-06-28T19:57:01
2018-06-28T19:57:01
139,060,676
3
2
null
null
null
null
UTF-8
Java
false
false
476
java
package org.jivesoftware.smackx.iot.discovery.provider; import org.jivesoftware.smack.provider.IQProvider; import org.jivesoftware.smackx.iot.discovery.element.IoTRemoved; import org.jivesoftware.smackx.iot.parser.NodeInfoParser; import org.xmlpull.v1.XmlPullParser; public class IoTRemovedProvider extends IQProvider<IoTRemoved> { public IoTRemoved parse(XmlPullParser xmlPullParser, int i) { return new IoTRemoved(NodeInfoParser.parse(xmlPullParser)); } }
[ "Maasalan@riseup.net" ]
Maasalan@riseup.net
e00bd0122e1ca6e290ad370d16e0db8c248c77fd
4455593fd0c6f0c06615f32e5756932537a930fa
/rl4j/src/main/java/cn/sibat/rl4j/java/Cartpole.java
2d02ed423209ca2959e2087f0b6b7a911bb7288b
[]
no_license
konvish/dlModel
faa34ccb3b51d0268fdd4e66f119ff46c95ffeaa
e2d420305c452d813c2204d98d36fcd220b780ba
refs/heads/master
2021-05-01T09:51:20.724594
2018-08-17T07:10:58
2018-08-17T07:10:58
121,100,131
0
1
null
null
null
null
UTF-8
Java
false
false
3,488
java
package cn.sibat.rl4j.java; import org.deeplearning4j.rl4j.learning.sync.qlearning.QLearning; import org.deeplearning4j.rl4j.learning.sync.qlearning.discrete.QLearningDiscreteDense; import org.deeplearning4j.rl4j.mdp.gym.GymEnv; import org.deeplearning4j.rl4j.network.dqn.DQNFactoryStdDense; import org.deeplearning4j.rl4j.policy.DQNPolicy; import org.deeplearning4j.rl4j.space.Box; import org.deeplearning4j.rl4j.space.DiscreteSpace; import org.deeplearning4j.rl4j.util.DataManager; import org.nd4j.linalg.learning.config.Adam; import java.io.IOException; import java.util.logging.Logger; /** * @author rubenfiszel (ruben.fiszel@epfl.ch) on 8/11/16. * * Main example for Cartpole DQN * * **/ public class Cartpole { public static QLearning.QLConfiguration CARTPOLE_QL = new QLearning.QLConfiguration( 123, //Random seed 200, //Max step By epoch 150000, //Max step 150000, //Max size of experience replay 32, //size of batches 500, //target update (hard) 10, //num step noop warmup 0.01, //reward scaling 0.99, //gamma 1.0, //td-error clipping 0.1f, //min epsilon 1000, //num step for eps greedy anneal true //double DQN ); public static DQNFactoryStdDense.Configuration CARTPOLE_NET = DQNFactoryStdDense.Configuration.builder() .l2(0.001).updater(new Adam(0.0005)).numHiddenNodes(16).numLayer(3).build(); public static void main(String[] args) throws IOException { cartPole(); loadCartpole(); } public static void cartPole() throws IOException { //record the training data in rl4j-data in a new folder (save) DataManager manager = new DataManager(true); //define the mdp from gym (name, render) GymEnv<Box, Integer, DiscreteSpace> mdp = null; try { mdp = new GymEnv("CartPole-v0", false, false); } catch (RuntimeException e){ System.out.print("To run this example, download and start the gym-http-api repo found at https://github.com/openai/gym-http-api."); } //define the training QLearningDiscreteDense<Box> dql = new QLearningDiscreteDense(mdp, CARTPOLE_NET, CARTPOLE_QL, manager); //train dql.train(); //get the final policy DQNPolicy<Box> pol = dql.getPolicy(); //serialize and save (serialization showcase, but not required) pol.save("/tmp/pol1"); //close the mdp (close http) mdp.close(); } public static void loadCartpole() throws IOException { //showcase serialization by using the trained agent on a new similar mdp (but render it this time) //define the mdp from gym (name, render) GymEnv mdp2 = new GymEnv("CartPole-v0", true, false); //load the previous agent DQNPolicy<Box> pol2 = DQNPolicy.load("/tmp/pol1"); //evaluate the agent double rewards = 0; for (int i = 0; i < 1000; i++) { mdp2.reset(); double reward = pol2.play(mdp2); rewards += reward; Logger.getAnonymousLogger().info("Reward: " + reward); } Logger.getAnonymousLogger().info("average: " + rewards/1000); } }
[ "konvish@163.com" ]
konvish@163.com
a06abfa727c844b58a040b4e5347446f62c61cec
95c49f466673952b465e19a5ee3ae6eff76bee00
/src/main/java/com/zhihu/android/api/model/InboxImageParcelablePlease.java
fdbf9f29e4f13effc9cd7ed7da72b9c7357a1b2f
[]
no_license
Phantoms007/zhihuAPK
58889c399ae56b16a9160a5f48b807e02c87797e
dcdbd103436a187f9c8b4be8f71bdf7813b6d201
refs/heads/main
2023-01-24T01:34:18.716323
2020-11-25T17:14:55
2020-11-25T17:14:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
663
java
package com.zhihu.android.api.model; import android.os.Parcel; class InboxImageParcelablePlease { InboxImageParcelablePlease() { } static void writeToParcel(InboxImage inboxImage, Parcel parcel, int i) { parcel.writeString(inboxImage.url); parcel.writeInt(inboxImage.height); parcel.writeInt(inboxImage.width); parcel.writeString(inboxImage.uri); } static void readFromParcel(InboxImage inboxImage, Parcel parcel) { inboxImage.url = parcel.readString(); inboxImage.height = parcel.readInt(); inboxImage.width = parcel.readInt(); inboxImage.uri = parcel.readString(); } }
[ "seasonpplp@qq.com" ]
seasonpplp@qq.com
034e69e1d0d170adf67bcbcd560a1aa34fb45f29
d5173fca20ddbaef947ef10885a63260d762249a
/camunda-cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/PlanFragmentTest.java
7af2669064aff4f7f638d00c053280dbf4214387
[ "Apache-2.0" ]
permissive
cenbow/bpm
70b8c000cade96ea5fa64ebe61647da960a91a02
888439665b327836bc2168fbf69a86010b85fe18
refs/heads/master
2020-03-20T00:24:28.168124
2018-06-12T02:19:59
2018-06-12T02:19:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,198
java
/* 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.camunda.bpm.model.cmmn.instance; import java.util.Arrays; import java.util.Collection; /** * @author Roman Smirnov * */ public class PlanFragmentTest extends CmmnModelElementInstanceTest { public TypeAssumption getTypeAssumption() { return new TypeAssumption(PlanItemDefinition.class, false); } public Collection<ChildElementAssumption> getChildElementAssumptions() { return Arrays.asList( new ChildElementAssumption(PlanItem.class), new ChildElementAssumption(Sentry.class) ); } public Collection<AttributeAssumption> getAttributesAssumptions() { return null; } }
[ "frank.x.li@gmail.com" ]
frank.x.li@gmail.com
cba782731a0f9d491aa93e4a20952f9cd6ff0191
eb4f19f82eb7f7324e28a3530d2377166321d122
/src/test/java/com/alibaba/json/test/FNV32_CollisionTest.java
0e71b152555b81da41b7bbe1d5019c05234319bb
[ "Apache-2.0" ]
permissive
alphafoobar/fastjson
3f413012dfb131e8f6f2d5f0bf8262f08652ad7f
1dd308a740383758aae70980eafdf2cb30ed44c9
refs/heads/master
2021-01-11T22:29:42.330344
2017-01-14T15:57:03
2017-01-14T15:57:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,806
java
package com.alibaba.json.test; import junit.framework.TestCase; import org.omg.CosNaming.NamingContextExtPackage.StringNameHelper; import java.text.NumberFormat; import java.util.Random; /** * Created by wenshao on 08/01/2017. */ public class FNV32_CollisionTest extends TestCase { char[] digLetters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_".toCharArray(); //char[] digLetters = "0123456789".toCharArray(); Random r = new Random(); int[] powers = new int[10]; { for (int i = 0; i < powers.length; ++i) { powers[i] = (int) Math.pow(digLetters.length, i); } } public void test_fnv_hash() throws Exception { int COUNT = 1000 * 1000 * 1000; long id_hash_64 = fnv_hash("name".toCharArray()); int id_hash_32 = (int) id_hash_64; System.out.println("name : " + id_hash_32 + ", " + id_hash_64); long v = 0; long time = System.currentTimeMillis(); NumberFormat format = NumberFormat.getInstance(); for (int len = 1; len <= 7; ++len){ char[] chars = new char[len]; long n = (long) Math.pow(digLetters.length, chars.length); for (; v < n; ++v) { long hash = 0x811c9dc5; for (int i = 0; i < chars.length; ++i) { int power = powers[chars.length - i - 1]; int d = (int) ((v / power) % digLetters.length); char c = digLetters[d]; hash ^= c; hash *= 0x1000193; } if (hash == id_hash_64) { int hash_32 = (int) hash; System.out.println("collision : " + build(v, len) + ", hash64 : " + hash + ", hash 32 " + hash_32); break; } if (v != 0 && v % (1000 * 1000 * 100) == 0) { long now = System.currentTimeMillis(); long millis = now - time; time = now; System.out.println("millis : " + millis + ", " + format.format(v)); } } System.out.println("end : " + len); } } String build(long v, int len) { char[] chars = new char[len]; for (int i = 0; i < chars.length; ++i) { int power = powers[chars.length - i - 1]; int d = (int) ((v / power) % digLetters.length); chars[i] = digLetters[d]; } return new String(chars); } static long fnv_hash(char[] chars) { long hash = 0x811c9dc5; for (int i = 0; i < chars.length; ++i) { char c = chars[i]; hash ^= c; hash *= 0x1000193; } return hash; } }
[ "szujobs@hotmail.com" ]
szujobs@hotmail.com
329c442b8960ce4913bc09f6f2cfca2d0c3c49c7
180e78725121de49801e34de358c32cf7148b0a2
/dataset/protocol1/java-design-patterns/learning/7942/NazgulTest.java
15e92cf91ffae1f8ef527395deaa908ff428fee1
[]
no_license
ASSERT-KTH/synthetic-checkstyle-error-dataset
40e8d1e0a7ebe7f7711def96a390891a6922f7bd
40c057e1669584bfc6fecf789b5b2854660222f3
refs/heads/master
2023-03-18T12:50:55.410343
2019-01-25T09:54:39
2019-01-25T09:54:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,896
java
/** * The MIT License * Copyright (c) 2014-2016 Ilkka Seppälä * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package com.iluwatar.multiton; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit .jupiter.api.Assertions.assertSame; /** * Date: 12/22/15 - 22:28 AM * * @author Jeroen Meulemeester */ public class NazgulTest { /** * Verify if {@link Nazgul#getInstance(NazgulName)} returns the correct Nazgul multiton instance */ @Test public void testGetInstance() { for (final NazgulName name : NazgulName.values()) { final Nazgul nazgul = Nazgul.getInstance(name); assertNotNull(nazgul); assertSame(nazgul, Nazgul.getInstance(name)); assertEquals(name, nazgul.getName()); } } }
[ "bloriot97@gmail.com" ]
bloriot97@gmail.com
61d20af75a98f6c97027cde542a1c830c21ed08e
abfa686278125cec79d8c73969eca35a7aa86102
/multithreading/src/lesson14_interrupting_threads/App.java
cdfb46c08f091449703f0d7002ea2363f6a5d863
[]
no_license
rzuniga64/java
abddb21137dedff89588bc825d5fb7fc6a947a50
66df9ea67440055fbc250697b1c4d53cf514e7ca
refs/heads/master
2021-01-17T01:30:28.858025
2019-04-23T18:12:08
2019-04-23T18:12:08
15,201,033
0
0
null
null
null
null
UTF-8
Java
false
false
1,503
java
package lesson14_interrupting_threads; import java.util.Random; public class App { public static void main(String[] args) throws InterruptedException { System.out.println("Starting."); Thread t1 = new Thread(new Runnable() { public void run() { Random ran = new Random(); for (int i = 0; i < 1E8; i++) { /* if(Thread.currentThread().isInterrupted() { System.out.println("Interrupted!"); break; } */ try { // Thread.sleep throws an InterruptedException. // After half a second Thread.sleep(1) will detect // t1.interrupt() and will throw an Interrupted Exception // which is caught and a break is executed. Thread.sleep(1); } catch (InterruptedException ie) { System.out.println("Interrupted!"); break; } Math.sin(ran.nextDouble()); } } }); t1.start(); // give thread plenty of time to start running Thread.sleep(500); // t1.interrupt() doesn't actually stop the thread. // It sets a flag that tells that its been interrupted. t1.interrupt(); t1.join(); System.out.println("Finished"); } }
[ "rzuniga64@gmail.com" ]
rzuniga64@gmail.com
66ba14d8fdc69b1bf1ac098b2e8909cc140a8eed
db69ca20406f52244c1cc1f77df27701dedebc53
/rdf-patch/src/main/java/org/seaborne/patch/RDF2Patch.java
3bb7cd29d97cef3c0aa1859930ad9a17b5992d40
[ "Apache-2.0" ]
permissive
juanlongo/rdf-delta
145a2461301337e016e0711b45ab2efd3f94eb48
51410d163b085f214f3de34fa4000276c65b9c6e
refs/heads/master
2020-03-28T17:50:09.315923
2018-08-19T15:10:49
2018-08-19T15:10:49
148,827,079
0
0
Apache-2.0
2018-09-14T18:27:09
2018-09-14T18:27:09
null
UTF-8
Java
false
false
2,027
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.seaborne.patch; import org.apache.jena.graph.Triple; import org.apache.jena.riot.system.StreamRDF; import org.apache.jena.sparql.core.Quad; import org.seaborne.patch.changes.RDFChangesCollector; // DRY with StreamPatch. /** An {@link StreamRDF} that converts to patch format. */ public class RDF2Patch implements StreamRDF { RDFChangesCollector x = new RDFChangesCollector(); private final RDFChanges changes; // public RDFPatch getRDFPatch() { return x.getRDFPatch(); } public RDF2Patch(RDFChanges changes) { this.changes = changes; } @Override public void start() { changes.txnBegin(); } @Override public void triple(Triple triple) { changes.add(null, triple.getSubject(), triple.getPredicate(), triple.getObject()); } @Override public void quad(Quad quad) { changes.add(quad.getGraph(), quad.getSubject(), quad.getPredicate(), quad.getObject()); } @Override public void base(String base) {} @Override public void prefix(String prefix, String iri) { changes.addPrefix(null, prefix, iri); } @Override public void finish() { changes.txnCommit(); } }
[ "andy@seaborne.org" ]
andy@seaborne.org
5979e9c5a4158d76c2fee16480b941b209dfe33c
c8b8e02396a0fe19ced67f369930f6712e44487d
/app/src/main/java/com/example/hassannaqvi/mccp2/MapsActivity.java
630515228adadde3d7768ac2136703e831bb1919
[]
no_license
arhaima/MCCP2
edaaca8ae2abf0b2f07f23e9df5204a5ee5265c5
7a443669ac1a69a01aaf75564d9ac7390b8b00f4
refs/heads/master
2021-05-14T01:07:59.049175
2016-06-28T07:02:14
2016-06-28T07:02:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,977
java
package com.example.hassannaqvi.mccp2; import android.content.Context; import android.content.SharedPreferences; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.util.Log; import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.OnMapReadyCallback; import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.MarkerOptions; import java.util.ArrayList; import java.util.List; public class MapsActivity extends FragmentActivity implements OnMapReadyCallback { private GoogleMap mMap; private boolean Todays; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); boolean Todays = getIntent().getStringExtra("today").equals("true"); setContentView(R.layout.activity_maps); // Obtain the SupportMapFragment and get notified when the map is ready to be used. SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager() .findFragmentById(R.id.map); mapFragment.getMapAsync(this); } /** * Manipulates the map once available. * This callback is triggered when the map is ready to be used. * This is where we can add markers or lines, add listeners or move the camera. In this case, * we just add a marker near Sydney, Australia. * If Google Play services is not installed on the device, the user will be prompted to install * it inside the SupportMapFragment. This method will only be triggered once the user has * installed Google Play services and returned to the app. */ @Override public void onMapReady(GoogleMap googleMap) { mMap = googleMap; FormsDbHelper db = new FormsDbHelper(this); List<FormsContract> gpsList = new ArrayList<FormsContract>(); if (Todays) { gpsList = db.getTodaysGPS(); } else { gpsList = db.getAllGPS(); } SharedPreferences sharedPref = getSharedPreferences("MC_" + FillFormActivity.FORM_ID, Context.MODE_PRIVATE); Double mLat = Double.valueOf(sharedPref.getString("spGPSLat", "0")); Double mLong = Double.valueOf(sharedPref.getString("spGPSLng", "0")); // Add a marker in Karachi and move the camera for (FormsContract gps : gpsList) { LatLng karachi = new LatLng(Double.valueOf(gps.getGPSLat()), Double.valueOf(gps.getGPSLng())); mMap.addMarker(new MarkerOptions().position(karachi).title("Form Submission for HH:" + gps.get106() + " at (LAT:" + gps.getGPSLat() + " LNG: " + gps.getGPSLng())); Log.d("MAP", "Form Submission here! LAT:" + gps.getGPSLat() + " LNG: " + gps.getGPSLng()); mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(karachi, 15)); } } }
[ "shznaqvi@gmail.com" ]
shznaqvi@gmail.com
7022c1a3c556e67301f40bc0051f7cf6b50328f1
8933c7f19c7c46b9a03fc5f3d8c1bf85ce775413
/ejbca_ce_6_3_1_1/modules/systemtests/src-test/org/ejbca/ui/cli/roles/AddRoleCommandTest.java
762d9eb611071604786412eb33d1e28112df35ba
[]
no_license
erikfournier/ejbca-pki
61a006c1c3bc59df68b1f80c1dc2d6dbcd4a228c
9974d77f6ec39bc9e60eaa3d8a3bbe08d723a06a
refs/heads/master
2021-12-25T01:48:15.229843
2017-12-23T01:29:04
2017-12-23T01:29:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,532
java
/************************************************************************* * * * EJBCA Community: The OpenSource Certificate Authority * * * * This software is free software; you can redistribute it and/or * * modify it under the terms of the GNU Lesser General Public * * License as published by the Free Software Foundation; either * * version 2.1 of the License, or any later version. * * * * See terms of license at gnu.org. * * * *************************************************************************/ package org.ejbca.ui.cli.roles; import static org.junit.Assert.assertNotNull; import org.cesecore.authentication.tokens.AuthenticationToken; import org.cesecore.mock.authentication.tokens.TestAlwaysAllowLocalAuthenticationToken; import org.cesecore.roles.RoleData; import org.cesecore.roles.access.RoleAccessSessionRemote; import org.cesecore.roles.management.RoleManagementSessionRemote; import org.cesecore.util.EjbRemoteHelper; import org.junit.After; import org.junit.Test; /** * @version $Id: AddRoleCommandTest.java 19902 2014-09-30 14:32:24Z anatom $ * */ public class AddRoleCommandTest { private final String TESTCLASS_NAME = AddRoleCommandTest.class.getSimpleName(); private final RoleAccessSessionRemote roleAccessSession = EjbRemoteHelper.INSTANCE.getRemoteSession(RoleAccessSessionRemote.class); private final RoleManagementSessionRemote roleManagementSession = EjbRemoteHelper.INSTANCE.getRemoteSession(RoleManagementSessionRemote.class); private AddRoleCommand command = new AddRoleCommand(); private final AuthenticationToken authenticationToken = new TestAlwaysAllowLocalAuthenticationToken(TESTCLASS_NAME); @After public void teardown() throws Exception { RoleData role = roleAccessSession.findRole(TESTCLASS_NAME); if (role != null) { roleManagementSession.remove(authenticationToken, role); } } @Test public void testAddRoleCommand() { String[] args = new String[] { TESTCLASS_NAME }; command.execute(args); assertNotNull("Role was not added.", roleAccessSession.findRole(TESTCLASS_NAME)); } }
[ "arunkumarpatange@arunkumars-MacBook-Pro.local" ]
arunkumarpatange@arunkumars-MacBook-Pro.local
4eb1774caeeb11b7f54204601067eb07895e8bdb
2649c3ebb221f091d79ae4c020a1ccce560add7f
/src/br/com/systemsgs/enums/Permissao.java
0f9cb35a7998a665822b28ae43389225174f030b
[]
no_license
GuilhermeJWT/JSF-SpringMvc-PrimeFaces-SpringSecurity
19cbab4b53e33f4c5c0dc374ca2a81f2fd58baa4
9666de10c848c2610686eadabbfbde2eac0a07c2
refs/heads/main
2023-06-26T02:12:44.451709
2021-07-19T18:56:18
2021-07-19T18:56:18
383,815,857
0
0
null
null
null
null
ISO-8859-1
Java
false
false
1,375
java
package br.com.systemsgs.enums; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; public enum Permissao { ADMIN("ADMIN", "Administrador"), USER("USER", "Usuário Padrão"), CADASTRO_ACESSAR("CADASTRO_ACESSAR", "Cadastro - Acessar"), FINANCEIRO_ACESSAR("FINANCEIRO_ACESSAR", "Financeiro - Acessar"), MENSAGEM_ACESSAR("MENSAGEM_ACESSAR", "Mensagem Recebida - Acessar"); private String valor = ""; private String descricao; private Permissao(String name, String descricao) { this.valor = name; this.descricao = descricao; } public static List<Permissao> getListPermissao() { List<Permissao> permissoes = new ArrayList<Permissao>(); for (Permissao permissao : Permissao.values()) { permissoes.add(permissao); } Collections.sort(permissoes, new Comparator<Permissao>() { @Override public int compare(Permissao o1, Permissao o2) { return new Integer(o1.ordinal()).compareTo(new Integer(o2.ordinal())); } }); return permissoes; } private Permissao() { } public String getValor() { return valor; } public void setValor(String valor) { this.valor = valor; } public String getDescricao() { return descricao; } public void setDescricao(String descricao) { this.descricao = descricao; } @Override public String toString() { return getValor(); } }
[ "guiromanno@gmail.com" ]
guiromanno@gmail.com
9ce6dd89ed89bc700b8a0d11c228c830250534b3
3c9c00bdf254c2714e63900fc4998160177cc928
/api/src/main/java/global/namespace/fun/io/api/function/XSupplier.java
0d396ad35412ebb0e80bab610e405fa1c9120b41
[ "Apache-2.0" ]
permissive
christian-schlichtherle/fun-io
3559e56d3874f3c64aecd7c3c1540e916e5dc7cf
7587695a728803462b616965fc6efde811d81e70
refs/heads/master
2022-12-08T00:51:05.995442
2020-12-07T12:35:54
2020-12-07T12:35:54
111,214,198
8
3
Apache-2.0
2022-12-02T02:35:43
2017-11-18T14:58:14
Java
UTF-8
Java
false
false
874
java
/* * Copyright © 2017 Schlichtherle IT Services * * 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 * * https://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 global.namespace.fun.io.api.function; /** * Like {@link java.util.function.Supplier}, but may throw any type of exception. * * @author Christian Schlichtherle */ @FunctionalInterface public interface XSupplier<T> { T get() throws Exception; }
[ "christian@schlichtherle.de" ]
christian@schlichtherle.de
e73bc70727d9f1dee87275e83525631b95ed2346
6635387159b685ab34f9c927b878734bd6040e7e
/src/wm.java
b31e6a7db5c35bf22ef03102f06c07d6d40ce523
[]
no_license
RepoForks/com.snapchat.android
987dd3d4a72c2f43bc52f5dea9d55bfb190966e2
6e28a32ad495cf14f87e512dd0be700f5186b4c6
refs/heads/master
2021-05-05T10:36:16.396377
2015-07-16T16:46:26
2015-07-16T16:46:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,031
java
import android.content.Context; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; import android.content.res.Resources; import android.hardware.Camera; import android.preference.PreferenceManager; import android.util.DisplayMetrics; import android.view.MotionEvent; import android.widget.RelativeLayout; import com.snapchat.android.camera.cameradecor.CameraDecor; import com.snapchat.android.camera.cameradecor.CameraDecor.CameraDecorInterface; import com.snapchat.android.camera.cameradecor.CameraDecor.CameraDecorInterface.TakeSnapButtonAction; import com.snapchat.android.camera.model.CameraModel.CameraType; import com.snapchat.android.database.SharedPreferenceKey; import com.snapchat.android.ui.QuickSnapOnboardingOverlay; import com.snapchat.android.ui.QuickSnapOnboardingOverlay.OverlayMode; public final class wm extends CameraDecor { private final float b; private final QuickSnapOnboardingOverlay c; public wm(Context paramContext, RelativeLayout paramRelativeLayout, CameraDecor.CameraDecorInterface paramCameraDecorInterface) { super(paramCameraDecorInterface); paramRelativeLayout.removeAllViews(); b = a(paramContext); c = new QuickSnapOnboardingOverlay(paramContext); paramRelativeLayout.addView(c); c.setHeightThreshold((int)b); paramContext = PreferenceManager.getDefaultSharedPreferences(paramContext); int i = paramContext.getInt(SharedPreferenceKey.QUICKSNAP_ONBOARDING_REPEATS.getKey(), 0); if (Camera.getNumberOfCameras() <= 1) { c.setVisibility(8); return; } if (i < 5) { paramContext = paramContext.edit(); paramContext.putInt(SharedPreferenceKey.QUICKSNAP_ONBOARDING_REPEATS.getKey(), i + 1); paramContext.apply(); c.setOverlayMode(QuickSnapOnboardingOverlay.OverlayMode.MODE_SOLID); return; } c.setOverlayMode(QuickSnapOnboardingOverlay.OverlayMode.MODE_BLINK); } public static float a(Context paramContext) { if (paramContext == null) { throw new NullPointerException(); } int i = PreferenceManager.getDefaultSharedPreferences(paramContext).getInt(SharedPreferenceKey.KEYBOARD_HEIGHT_PORTRAIT.getKey(), -1); if (i == -1) { return getResourcesgetDisplayMetricsheightPixels * 0.5F; } return i - paramContext.getResources().getDimensionPixelSize(2131296281); } public final boolean a(MotionEvent paramMotionEvent) { switch (paramMotionEvent.getActionMasked()) { default: return true; case 1: case 3: a.a(CameraDecor.CameraDecorInterface.TakeSnapButtonAction.FINGER_UP); return true; } if (paramMotionEvent.getY() > b) { c.setUpperRegionHighlight(false); a.a(CameraModel.CameraType.FRONT_FACING); return true; } c.setUpperRegionHighlight(true); a.a(CameraModel.CameraType.BACK_FACING); return true; } } /* Location: * Qualified Name: wm * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "reverseengineeringer@hackeradmin.com" ]
reverseengineeringer@hackeradmin.com
e4e76ad6242826ea8976cf0e92f8e440165c4928
81585a7a706d7a6534a1baf03a4379358bdd168a
/TR_201718/src/mgf/tr/entity/EntityType.java
2062186de7be86aac9980347ad4736a2a32f6140
[]
no_license
fernandosanzcasado/TR_201718
98e7a7a647517bf943c0501e56000c0ecef7e5ca
a19015ee6dbe4fa107a91bbea335b6bf712652c9
refs/heads/master
2022-05-29T23:39:01.235712
2018-12-08T13:55:27
2018-12-08T13:55:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
295
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package mgf.tr.entity; /** * * @author Asus */ public enum EntityType { SHIP, ENEMY, BLOCK; }
[ "marc.pascual@tmtfactory.com" ]
marc.pascual@tmtfactory.com
0063f60384a23420e2c2a3b2859d230aa67ddbad
e0b6551f88d12a68dd1eb6811aa5abb7ba3fce37
/draw-models/src/main/java/com/wyc/draw/vo/RewardVo.java
84d0b1d2d2b60ff30c76c2a3ac1d78e769c5c70d
[]
no_license
wangyuchuan12/luck-draw
ecef2eccb757fbf95eb74244f179498d9e0d04a8
a8f4e45c5690e80cdfc3e1ffe3879eba9a66599f
refs/heads/master
2021-01-12T05:03:40.772785
2017-08-21T09:28:14
2017-08-21T09:28:14
77,839,368
0
1
null
null
null
null
UTF-8
Java
false
false
2,178
java
package com.wyc.draw.vo; import java.math.BigDecimal; import com.wyc.annotation.IdAnnotation; import com.wyc.annotation.ParamAnnotation; import com.wyc.annotation.ParamEntityAnnotation; @ParamEntityAnnotation public class RewardVo { @IdAnnotation private String id; @ParamAnnotation private Long addWisdomNum; @ParamAnnotation private Long subWisdomNum; @ParamAnnotation private Long addIntegralNum; @ParamAnnotation private Long addLoveLifeNum; @ParamAnnotation private Long subLoveLifeNum; @ParamAnnotation private BigDecimal addAmount; @ParamAnnotation private BigDecimal subAmount; @ParamAnnotation private Integer subMasonry; @ParamAnnotation private Integer addMasonry; public String getId() { return id; } public void setId(String id) { this.id = id; } public Long getAddWisdomNum() { return addWisdomNum; } public void setAddWisdomNum(Long addWisdomNum) { this.addWisdomNum = addWisdomNum; } public Long getSubWisdomNum() { return subWisdomNum; } public void setSubWisdomNum(Long subWisdomNum) { this.subWisdomNum = subWisdomNum; } public Long getAddIntegralNum() { return addIntegralNum; } public void setAddIntegralNum(Long addIntegralNum) { this.addIntegralNum = addIntegralNum; } public Long getAddLoveLifeNum() { return addLoveLifeNum; } public void setAddLoveLifeNum(Long addLoveLifeNum) { this.addLoveLifeNum = addLoveLifeNum; } public Long getSubLoveLifeNum() { return subLoveLifeNum; } public void setSubLoveLifeNum(Long subLoveLifeNum) { this.subLoveLifeNum = subLoveLifeNum; } public BigDecimal getAddAmount() { return addAmount; } public void setAddAmount(BigDecimal addAmount) { this.addAmount = addAmount; } public BigDecimal getSubAmount() { return subAmount; } public void setSubAmount(BigDecimal subAmount) { this.subAmount = subAmount; } public Integer getSubMasonry() { return subMasonry; } public void setSubMasonry(Integer subMasonry) { this.subMasonry = subMasonry; } public Integer getAddMasonry() { return addMasonry; } public void setAddMasonry(Integer addMasonry) { this.addMasonry = addMasonry; } }
[ "root@dawang.local" ]
root@dawang.local
ebbc06cba4e12257dc9ac26fb3891b5ea26deca4
16b23a68d47f2af7e084e079d29682869f82a734
/app/src/main/java/com/ronak/viral/adda/billing/TransactionDetails.java
c46b94f0751ea6a8637c1e6589eeaaddb1d7f712
[]
no_license
anish1665/ViralAdda
665aab059d4c44dcfd95f5603d65e34bc95ce58b
7436070a545983abc955f13f4c93d65a6774c801
refs/heads/master
2021-04-06T01:59:51.743344
2018-03-16T11:42:13
2018-03-16T11:42:13
124,538,734
1
0
null
null
null
null
UTF-8
Java
false
false
1,542
java
/** * Copyright 2014 AnjLab * * 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.ronak.viral.adda.billing; import org.json.JSONException; import org.json.JSONObject; import java.util.Date; public class TransactionDetails { public final String productId; public final String orderId; public final String purchaseToken; public final Date purchaseTime; public final PurchaseInfo purchaseInfo; public TransactionDetails(PurchaseInfo info) throws JSONException { JSONObject source = new JSONObject(info.responseData); purchaseInfo = info; productId = source.getString(Constants.RESPONSE_PRODUCT_ID); orderId = source.optString(Constants.RESPONSE_ORDER_ID); purchaseToken = source.getString(Constants.RESPONSE_PURCHASE_TOKEN); purchaseTime = new Date(source.getLong(Constants.RESPONSE_PURCHASE_TIME)); } @Override public String toString() { return String.format("%s purchased at %s(%s). Token: %s, Signature: %s", productId, purchaseTime, orderId, purchaseToken, purchaseInfo.signature); } }
[ "anish.vahora5@gmail.com" ]
anish.vahora5@gmail.com
034f4ab318cc9912e1ec54fdfd86ddbd1de17ade
e3fc537400ab7656e9e8be85a83993d075f53392
/src/test/java/org/jboss/classfilewriter/test/bytecode/i/IfnotnullTest.java
c5b4358c9c4026b056c11118cc9508b1988d22ef
[]
no_license
alesj/jboss-classfilewriter
83c9a1b97eebbe7b98fc35924cf0d61121d0a4c7
d8d6782f1c191ace9de3181d1f1d19427608afd1
refs/heads/master
2020-12-30T17:44:51.447056
2011-03-21T07:21:25
2011-03-21T07:21:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,904
java
/* * JBoss, Home of Professional Open Source * Copyright 2010, Red Hat Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.classfilewriter.test.bytecode.i; import junit.framework.Assert; import org.jboss.classfilewriter.code.BranchEnd; import org.jboss.classfilewriter.code.CodeAttribute; import org.jboss.classfilewriter.test.bytecode.MethodTester; import org.junit.Test; public class IfnotnullTest { public static Integer value = null; @Test public void testIfNull() { MethodTester<Integer> mt = new MethodTester<Integer>(int.class); CodeAttribute ca = mt.getCodeAttribute(); ca.getstatic(getClass().getName(), "value", "Ljava/lang/Integer;"); BranchEnd end = ca.ifnotnull(); ca.iconst(10); ca.returnInstruction(); ca.branchEnd(end); ca.iconst(0); ca.returnInstruction(); Assert.assertEquals(10, (int) mt.invoke()); value = 1; Assert.assertEquals(0, (int) mt.invoke()); } }
[ "stuart.w.douglas@gmail.com" ]
stuart.w.douglas@gmail.com
014014ac475f4b41632c0c5b3b62efe0853eae7e
352163a8f69f64bc87a9e14471c947e51bd6b27d
/bin/ext-integration/sap/synchronousOM/sapordermgmtcfgfacades/src/de/hybris/platform/sap/sapordermgmtcfgfacades/constants/SapordermgmtcfgfacadesConstants.java
7721306a4c1bbd760791083a46c8a09cc9578ef8
[]
no_license
GTNDYanagisawa/merchandise
2ad5209480d5dc7d946a442479cfd60649137109
e9773338d63d4f053954d396835ac25ef71039d3
refs/heads/master
2021-01-22T20:45:31.217238
2015-05-20T06:23:45
2015-05-20T06:23:45
35,868,211
3
5
null
null
null
null
UTF-8
Java
false
false
935
java
/* * [y] hybris Platform * * Copyright (c) 2000-2013 hybris AG * All rights reserved. * * This software is the confidential and proprietary information of hybris * ("Confidential Information"). You shall not disclose such Confidential * Information and shall use it only in accordance with the terms of the * license agreement you entered into with hybris. * * */ package de.hybris.platform.sap.sapordermgmtcfgfacades.constants; /** * Global class for all Sapordermgmtcfgfacades constants. You can add global constants for your extension into this class. */ public final class SapordermgmtcfgfacadesConstants extends GeneratedSapordermgmtcfgfacadesConstants { public static final String EXTENSIONNAME = "sapordermgmtcfgfacades"; private SapordermgmtcfgfacadesConstants() { //empty to avoid instantiating this constant class } // implement here constants used by this extension }
[ "yanagisawa@gotandadenshi.jp" ]
yanagisawa@gotandadenshi.jp
e579bbad85e3fe10b792a8c32bc5646322b2d238
007168289c41156f62cd57b7ca750fda562835a4
/src/main/java/com/newo/app24/web/rest/errors/ExceptionTranslator.java
0ff450f20077ea57bf13c6f930f9b6cc59f410e4
[]
no_license
eter98/NewoApp-24
cc3b9d120ec87c8afc6250c28a0528d8d9d5ba85
5a288d20eced05465dd6a79a23cfdb419fc397d5
refs/heads/master
2022-12-26T02:36:38.644012
2019-12-03T20:26:16
2019-12-03T20:26:16
225,708,943
0
0
null
2022-12-16T04:42:07
2019-12-03T20:26:07
Java
UTF-8
Java
false
false
6,417
java
package com.newo.app24.web.rest.errors; import io.github.jhipster.web.util.HeaderUtil; import org.springframework.beans.factory.annotation.Value; import org.springframework.dao.ConcurrencyFailureException; import org.springframework.http.ResponseEntity; import org.springframework.validation.BindingResult; import org.springframework.web.bind.MethodArgumentNotValidException; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.context.request.NativeWebRequest; import org.zalando.problem.DefaultProblem; import org.zalando.problem.Problem; import org.zalando.problem.ProblemBuilder; import org.zalando.problem.Status; import org.zalando.problem.spring.web.advice.ProblemHandling; import org.zalando.problem.spring.web.advice.security.SecurityAdviceTrait; import org.zalando.problem.violations.ConstraintViolationProblem; import javax.annotation.Nonnull; import javax.annotation.Nullable; import javax.servlet.http.HttpServletRequest; import java.util.List; import java.util.NoSuchElementException; import java.util.stream.Collectors; /** * Controller advice to translate the server side exceptions to client-friendly json structures. * The error response follows RFC7807 - Problem Details for HTTP APIs (https://tools.ietf.org/html/rfc7807). */ @ControllerAdvice public class ExceptionTranslator implements ProblemHandling, SecurityAdviceTrait { private static final String FIELD_ERRORS_KEY = "fieldErrors"; private static final String MESSAGE_KEY = "message"; private static final String PATH_KEY = "path"; private static final String VIOLATIONS_KEY = "violations"; @Value("${jhipster.clientApp.name}") private String applicationName; /** * Post-process the Problem payload to add the message key for the front-end if needed. */ @Override public ResponseEntity<Problem> process(@Nullable ResponseEntity<Problem> entity, NativeWebRequest request) { if (entity == null) { return entity; } Problem problem = entity.getBody(); if (!(problem instanceof ConstraintViolationProblem || problem instanceof DefaultProblem)) { return entity; } ProblemBuilder builder = Problem.builder() .withType(Problem.DEFAULT_TYPE.equals(problem.getType()) ? ErrorConstants.DEFAULT_TYPE : problem.getType()) .withStatus(problem.getStatus()) .withTitle(problem.getTitle()) .with(PATH_KEY, request.getNativeRequest(HttpServletRequest.class).getRequestURI()); if (problem instanceof ConstraintViolationProblem) { builder .with(VIOLATIONS_KEY, ((ConstraintViolationProblem) problem).getViolations()) .with(MESSAGE_KEY, ErrorConstants.ERR_VALIDATION); } else { builder .withCause(((DefaultProblem) problem).getCause()) .withDetail(problem.getDetail()) .withInstance(problem.getInstance()); problem.getParameters().forEach(builder::with); if (!problem.getParameters().containsKey(MESSAGE_KEY) && problem.getStatus() != null) { builder.with(MESSAGE_KEY, "error.http." + problem.getStatus().getStatusCode()); } } return new ResponseEntity<>(builder.build(), entity.getHeaders(), entity.getStatusCode()); } @Override public ResponseEntity<Problem> handleMethodArgumentNotValid(MethodArgumentNotValidException ex, @Nonnull NativeWebRequest request) { BindingResult result = ex.getBindingResult(); List<FieldErrorVM> fieldErrors = result.getFieldErrors().stream() .map(f -> new FieldErrorVM(f.getObjectName().replaceFirst("DTO$", ""), f.getField(), f.getCode())) .collect(Collectors.toList()); Problem problem = Problem.builder() .withType(ErrorConstants.CONSTRAINT_VIOLATION_TYPE) .withTitle("Method argument not valid") .withStatus(defaultConstraintViolationStatus()) .with(MESSAGE_KEY, ErrorConstants.ERR_VALIDATION) .with(FIELD_ERRORS_KEY, fieldErrors) .build(); return create(ex, problem, request); } @ExceptionHandler public ResponseEntity<Problem> handleNoSuchElementException(NoSuchElementException ex, NativeWebRequest request) { Problem problem = Problem.builder() .withStatus(Status.NOT_FOUND) .with(MESSAGE_KEY, ErrorConstants.ENTITY_NOT_FOUND_TYPE) .build(); return create(ex, problem, request); } @ExceptionHandler public ResponseEntity<Problem> handleEmailAlreadyUsedException(com.newo.app24.service.EmailAlreadyUsedException ex, NativeWebRequest request) { EmailAlreadyUsedException problem = new EmailAlreadyUsedException(); return create(problem, request, HeaderUtil.createFailureAlert(applicationName, true, problem.getEntityName(), problem.getErrorKey(), problem.getMessage())); } @ExceptionHandler public ResponseEntity<Problem> handleUsernameAlreadyUsedException(com.newo.app24.service.UsernameAlreadyUsedException ex, NativeWebRequest request) { LoginAlreadyUsedException problem = new LoginAlreadyUsedException(); return create(problem, request, HeaderUtil.createFailureAlert(applicationName, true, problem.getEntityName(), problem.getErrorKey(), problem.getMessage())); } @ExceptionHandler public ResponseEntity<Problem> handleInvalidPasswordException(com.newo.app24.service.InvalidPasswordException ex, NativeWebRequest request) { return create(new InvalidPasswordException(), request); } @ExceptionHandler public ResponseEntity<Problem> handleBadRequestAlertException(BadRequestAlertException ex, NativeWebRequest request) { return create(ex, request, HeaderUtil.createFailureAlert(applicationName, true, ex.getEntityName(), ex.getErrorKey(), ex.getMessage())); } @ExceptionHandler public ResponseEntity<Problem> handleConcurrencyFailure(ConcurrencyFailureException ex, NativeWebRequest request) { Problem problem = Problem.builder() .withStatus(Status.CONFLICT) .with(MESSAGE_KEY, ErrorConstants.ERR_CONCURRENCY_FAILURE) .build(); return create(ex, problem, request); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
922f069eb9f2d5282e238fdb6d50f495308441a0
0b0cc171457f32b5259ac2e0891d617abdfc0e47
/src/org/lwjgl/opengl/EXTBlendSubtract.java
811ed0724abfff9458c90fa85961d73eb9b849a4
[]
no_license
bobolicener/star-rod
24b403447b4bd82af1bca734c63ac38785748824
59235901ab024c5af267daebf92344b20538251a
refs/heads/master
2020-07-01T20:12:10.960817
2019-08-08T14:54:46
2019-08-08T14:54:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
222
java
package org.lwjgl.opengl; public final class EXTBlendSubtract { public static final int GL_FUNC_SUBTRACT_EXT = 32778; public static final int GL_FUNC_REVERSE_SUBTRACT_EXT = 32779; private EXTBlendSubtract() {} }
[ "gregory.degruy@gmail.com" ]
gregory.degruy@gmail.com
2b243be04158f69ef5bdec6afff9cd960a757e34
ca919a160f4752059abd913c194846a428f8470c
/设计模式之禅v2/DesignPattern/src/cn/part03/ch32/commandVSstrategy/command/ZipUncompressCmd.java
bbbcf069a36408a10f500d3072013846f303af2c
[]
no_license
CoderDream/learnJava
24b5e7ff0afbf76c44be4c1d33eee109727576ed
a86d2a436a3a74f0f9575d0e5e1dc65e9754c788
refs/heads/master
2022-12-02T14:57:18.206180
2020-08-14T18:24:46
2020-08-14T18:24:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
252
java
package cn.part03.ch32.commandVSstrategy.command; //代码清单32-8 zip解压缩命令 public class ZipUncompressCmd extends AbstractCmd { public boolean execute(String source, String to) { return super.zip.uncompress(source, to); } }
[ "nick_aisong@163.com" ]
nick_aisong@163.com
be528bff7fb7410ee96f3c9fd4e58834e2de9a93
3f5d19ac4afb5ce1d38df0aa6638e18103f468e0
/com.revolsys.open.core/src/main/java/com/revolsys/gis/wms/capabilities/ScaleHint.java
36be87ecd57892cdef6c0bd0b5c7c5c325c11a54
[ "Apache-2.0" ]
permissive
lequynhnhu/com.revolsys.open
e94a25a8a127f5315a10aad32da6776407857e60
d660384b05a402fb4b62d30d1592563c74ae8df5
refs/heads/master
2020-12-25T03:39:55.125381
2015-02-21T01:18:19
2015-02-21T01:18:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
355
java
package com.revolsys.gis.wms.capabilities; public class ScaleHint { private double min; private double max; public double getMax() { return this.max; } public double getMin() { return this.min; } public void setMax(final double max) { this.max = max; } public void setMin(final double min) { this.min = min; } }
[ "paul.austin@revolsys.com" ]
paul.austin@revolsys.com