hexsha
stringlengths
40
40
size
int64
3
1.05M
ext
stringclasses
1 value
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
5
1.02k
max_stars_repo_name
stringlengths
4
126
max_stars_repo_head_hexsha
stringlengths
40
78
max_stars_repo_licenses
list
max_stars_count
float64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
5
1.02k
max_issues_repo_name
stringlengths
4
114
max_issues_repo_head_hexsha
stringlengths
40
78
max_issues_repo_licenses
list
max_issues_count
float64
1
92.2k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
5
1.02k
max_forks_repo_name
stringlengths
4
136
max_forks_repo_head_hexsha
stringlengths
40
78
max_forks_repo_licenses
list
max_forks_count
float64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
avg_line_length
float64
2.55
99.9
max_line_length
int64
3
1k
alphanum_fraction
float64
0.25
1
index
int64
0
1M
content
stringlengths
3
1.05M
3e05c1d43a4e6982003844e6489117fcb8ffb4b5
4,566
java
Java
WEB-INF/src/com/krishagni/catissueplus/core/de/services/FormService.java
jxchin/openspecimen
35e729f418adb04b579d2694f0a47dc60934a46f
[ "BSD-3-Clause" ]
null
null
null
WEB-INF/src/com/krishagni/catissueplus/core/de/services/FormService.java
jxchin/openspecimen
35e729f418adb04b579d2694f0a47dc60934a46f
[ "BSD-3-Clause" ]
null
null
null
WEB-INF/src/com/krishagni/catissueplus/core/de/services/FormService.java
jxchin/openspecimen
35e729f418adb04b579d2694f0a47dc60934a46f
[ "BSD-3-Clause" ]
null
null
null
44.764706
106
0.840999
2,415
package com.krishagni.catissueplus.core.de.services; import java.util.List; import java.util.Map; import org.springframework.web.multipart.MultipartFile; import com.krishagni.catissueplus.core.administrative.repository.FormListCriteria; import com.krishagni.catissueplus.core.common.events.BulkDeleteEntityOp; import com.krishagni.catissueplus.core.common.events.DependentEntityDetail; import com.krishagni.catissueplus.core.common.events.RequestEvent; import com.krishagni.catissueplus.core.common.events.ResponseEvent; import com.krishagni.catissueplus.core.de.events.AddRecordEntryOp; import com.krishagni.catissueplus.core.de.events.EntityFormRecords; import com.krishagni.catissueplus.core.de.events.FileDetail; import com.krishagni.catissueplus.core.de.events.FormContextDetail; import com.krishagni.catissueplus.core.de.events.FormCtxtSummary; import com.krishagni.catissueplus.core.de.events.FormDataDetail; import com.krishagni.catissueplus.core.de.events.FormFieldSummary; import com.krishagni.catissueplus.core.de.events.FormRecordCriteria; import com.krishagni.catissueplus.core.de.events.FormRecordsList; import com.krishagni.catissueplus.core.de.events.FormSummary; import com.krishagni.catissueplus.core.de.events.GetEntityFormRecordsOp; import com.krishagni.catissueplus.core.de.events.GetFileDetailOp; import com.krishagni.catissueplus.core.de.events.GetFormFieldPvsOp; import com.krishagni.catissueplus.core.de.events.GetFormRecordsListOp; import com.krishagni.catissueplus.core.de.events.ListEntityFormsOp; import com.krishagni.catissueplus.core.de.events.ListFormFields; import com.krishagni.catissueplus.core.de.events.MoveFormRecordsOp; import com.krishagni.catissueplus.core.de.events.RemoveFormContextOp; import edu.common.dynamicextensions.domain.nui.Container; import edu.common.dynamicextensions.domain.nui.PermissibleValue; import edu.common.dynamicextensions.napi.FormData; public interface FormService { public ResponseEvent<List<FormSummary>> getForms(RequestEvent<FormListCriteria> req); public ResponseEvent<Long> getFormsCount(RequestEvent<FormListCriteria> req); public ResponseEvent<Container> getFormDefinition(RequestEvent<Long> req); public ResponseEvent<Boolean> deleteForms(RequestEvent<BulkDeleteEntityOp> req); public ResponseEvent<List<FormFieldSummary>> getFormFields(RequestEvent<ListFormFields> req); public ResponseEvent<List<FormContextDetail>> getFormContexts(RequestEvent<Long> req); public ResponseEvent<List<FormContextDetail>> addFormContexts(RequestEvent<List<FormContextDetail>> req); public ResponseEvent<Boolean> removeFormContext(RequestEvent<RemoveFormContextOp> req); public ResponseEvent<List<FormCtxtSummary>> getEntityForms(RequestEvent<ListEntityFormsOp> req); public ResponseEvent<EntityFormRecords> getEntityFormRecords(RequestEvent<GetEntityFormRecordsOp> req); public ResponseEvent<FormDataDetail> getFormData(RequestEvent<FormRecordCriteria> req); public ResponseEvent<List<FormDataDetail>> getLatestRecords(RequestEvent<FormRecordCriteria> req); public ResponseEvent<FormDataDetail> saveFormData(RequestEvent<FormDataDetail> req); public ResponseEvent<List<FormData>> saveBulkFormData(RequestEvent<List<FormData>> req); public ResponseEvent<FileDetail> getFileDetail(RequestEvent<GetFileDetailOp> req); public ResponseEvent<FileDetail> uploadFile(RequestEvent<MultipartFile> req); ResponseEvent<FileDetail> uploadImage(RequestEvent<String> req); public ResponseEvent<Long> deleteRecord(RequestEvent<FormRecordCriteria> req); public ResponseEvent<Long> addRecordEntry(RequestEvent<AddRecordEntryOp> req); public ResponseEvent<List<FormRecordsList>> getFormRecords(RequestEvent<GetFormRecordsListOp> req); public ResponseEvent<List<DependentEntityDetail>> getDependentEntities(RequestEvent<Long> req); ResponseEvent<Integer> moveRecords(RequestEvent<MoveFormRecordsOp> req); /** * Internal usage */ List<FormData> getSummaryRecords(Long formId, List<Long> recordIds); FormData getRecord(Container form, Long recordId); List<FormData> getRecords(Container form, List<Long> recordIds); ResponseEvent<List<PermissibleValue>> getPvs(RequestEvent<GetFormFieldPvsOp> req); void addFormContextProc(String entity, FormContextProcessor proc); Map<String, Object> getExtensionInfo(Long cpId, String entityType); Map<String, Object> getExtensionInfo(boolean cpBased, String entityType, Long entityId); List<FormSummary> getEntityForms(Long cpId, String[] entityTypes); void anonymizeRecord(Container form, Long recordId); }
3e05c25a064e6a9c59619d860bcc5622eb0490ba
401
java
Java
FinalProjectDemo/src/lm44_xw47/model/dataType/RemoveUserGame.java
git-malu/OOP-Projects
8a44e4acf60111acdc946dc8bcd39478cfa20621
[ "MIT" ]
null
null
null
FinalProjectDemo/src/lm44_xw47/model/dataType/RemoveUserGame.java
git-malu/OOP-Projects
8a44e4acf60111acdc946dc8bcd39478cfa20621
[ "MIT" ]
null
null
null
FinalProjectDemo/src/lm44_xw47/model/dataType/RemoveUserGame.java
git-malu/OOP-Projects
8a44e4acf60111acdc946dc8bcd39478cfa20621
[ "MIT" ]
null
null
null
18.227273
67
0.750623
2,416
package lm44_xw47.model.dataType; import common.IUser; import common.IUserMessageType; public class RemoveUserGame implements IUserMessageType{ /** * An auto-generated id for serialization. */ private static final long serialVersionUID = 3008598978712539215L; private IUser user; public RemoveUserGame(IUser user) { this.user = user; } public IUser getUser() { return user; } }
3e05c2cd619ce482ec21683b802a15f74f4ebeac
10,904
java
Java
binance-trader-bot-backend/src/main/java/co/lucz/binancetraderbot/exceptions/GlobalExceptionHandler.java
luczsoma/binance-trader-bot
3b504a7a26a379479bc33fc1839e7d962322b01d
[ "MIT" ]
null
null
null
binance-trader-bot-backend/src/main/java/co/lucz/binancetraderbot/exceptions/GlobalExceptionHandler.java
luczsoma/binance-trader-bot
3b504a7a26a379479bc33fc1839e7d962322b01d
[ "MIT" ]
null
null
null
binance-trader-bot-backend/src/main/java/co/lucz/binancetraderbot/exceptions/GlobalExceptionHandler.java
luczsoma/binance-trader-bot
3b504a7a26a379479bc33fc1839e7d962322b01d
[ "MIT" ]
1
2022-03-28T06:44:59.000Z
2022-03-28T06:44:59.000Z
35.986799
130
0.690664
2,417
package co.lucz.binancetraderbot.exceptions; import co.lucz.binancetraderbot.exceptions.internal.BadRequestException; import co.lucz.binancetraderbot.exceptions.internal.ClockDiscrepancyException; import co.lucz.binancetraderbot.exceptions.internal.MethodNotAllowedException; import co.lucz.binancetraderbot.exceptions.internal.SymbolAlreadyExistsException; import co.lucz.binancetraderbot.exceptions.internal.UnauthorizedException; import co.lucz.binancetraderbot.services.ErrorLoggerService; import org.springframework.beans.ConversionNotSupportedException; import org.springframework.beans.TypeMismatchException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.http.converter.HttpMessageNotReadableException; import org.springframework.http.converter.HttpMessageNotWritableException; import org.springframework.validation.BindException; import org.springframework.web.HttpMediaTypeNotAcceptableException; import org.springframework.web.HttpMediaTypeNotSupportedException; import org.springframework.web.HttpRequestMethodNotSupportedException; import org.springframework.web.bind.MethodArgumentNotValidException; import org.springframework.web.bind.MissingPathVariableException; import org.springframework.web.bind.MissingServletRequestParameterException; import org.springframework.web.bind.ServletRequestBindingException; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.context.request.WebRequest; import org.springframework.web.context.request.async.AsyncRequestTimeoutException; import org.springframework.web.multipart.support.MissingServletRequestPartException; import org.springframework.web.servlet.NoHandlerFoundException; import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler; @ControllerAdvice public class GlobalExceptionHandler extends ResponseEntityExceptionHandler { @Autowired private ErrorLoggerService errorLoggerService; @ExceptionHandler({BadRequestException.class}) public ResponseEntity<Object> handleBadRequestException( BadRequestException exception, WebRequest request ) { ApiError apiError = new ApiError( ApiError.ApiErrorCode.BadRequest, exception ); return handleApiError(apiError); } @ExceptionHandler({ClockDiscrepancyException.class}) public ResponseEntity<Object> handleClockDiscrepancyException( ClockDiscrepancyException exception, WebRequest request ) { ApiError apiError = new ApiError( ApiError.ApiErrorCode.ClockDiscrepancy, exception ); return handleApiError(apiError); } @ExceptionHandler({MethodNotAllowedException.class}) public ResponseEntity<Object> handleMethodNotAllowedException( MethodNotAllowedException exception, WebRequest request ) { ApiError apiError = new ApiError( ApiError.ApiErrorCode.MethodNotAllowed, exception ); return handleApiError(apiError); } @ExceptionHandler({SymbolAlreadyExistsException.class}) public ResponseEntity<Object> handleSymbolAlreadyExistsException(SymbolAlreadyExistsException exception, WebRequest request) { ApiError apiError = new ApiError( ApiError.ApiErrorCode.SymbolAlreadyExists, exception ); return handleApiError(apiError); } @ExceptionHandler({UnauthorizedException.class}) public ResponseEntity<Object> handleUnauthorizedException(UnauthorizedException exception, WebRequest request) { ApiError apiError = new ApiError( ApiError.ApiErrorCode.Unauthorized, exception ); return handleApiError(apiError); } @ExceptionHandler({Exception.class}) public ResponseEntity<Object> handleUnknownException(Exception exception, WebRequest request) { ApiError apiError = new ApiError( ApiError.ApiErrorCode.InternalServerError, exception ); return handleApiError(apiError); } @Override protected ResponseEntity<Object> handleHttpRequestMethodNotSupported( HttpRequestMethodNotSupportedException exception, HttpHeaders headers, HttpStatus status, WebRequest request ) { ApiError apiError = new ApiError( ApiError.ApiErrorCode.MethodNotAllowed, exception ); return handleApiError(apiError); } @Override protected ResponseEntity<Object> handleHttpMediaTypeNotSupported( HttpMediaTypeNotSupportedException exception, HttpHeaders headers, HttpStatus status, WebRequest request ) { ApiError apiError = new ApiError( ApiError.ApiErrorCode.UnsupportedMediaType, exception ); return handleApiError(apiError); } @Override protected ResponseEntity<Object> handleHttpMediaTypeNotAcceptable( HttpMediaTypeNotAcceptableException exception, HttpHeaders headers, HttpStatus status, WebRequest request ) { ApiError apiError = new ApiError( ApiError.ApiErrorCode.NotAcceptable, exception ); return handleApiError(apiError); } @Override protected ResponseEntity<Object> handleMissingPathVariable( MissingPathVariableException exception, HttpHeaders headers, HttpStatus status, WebRequest request ) { ApiError apiError = new ApiError( ApiError.ApiErrorCode.BadRequest, exception ); return handleApiError(apiError); } @Override protected ResponseEntity<Object> handleMissingServletRequestParameter( MissingServletRequestParameterException exception, HttpHeaders headers, HttpStatus status, WebRequest request ) { ApiError apiError = new ApiError( ApiError.ApiErrorCode.BadRequest, exception ); return handleApiError(apiError); } @Override protected ResponseEntity<Object> handleServletRequestBindingException( ServletRequestBindingException exception, HttpHeaders headers, HttpStatus status, WebRequest request ) { ApiError apiError = new ApiError( ApiError.ApiErrorCode.BadRequest, exception ); return handleApiError(apiError); } @Override protected ResponseEntity<Object> handleConversionNotSupported( ConversionNotSupportedException exception, HttpHeaders headers, HttpStatus status, WebRequest request ) { ApiError apiError = new ApiError( ApiError.ApiErrorCode.InternalServerError, exception ); return handleApiError(apiError); } @Override protected ResponseEntity<Object> handleTypeMismatch( TypeMismatchException exception, HttpHeaders headers, HttpStatus status, WebRequest request ) { ApiError apiError = new ApiError( ApiError.ApiErrorCode.BadRequest, exception ); return handleApiError(apiError); } @Override protected ResponseEntity<Object> handleHttpMessageNotReadable( HttpMessageNotReadableException exception, HttpHeaders headers, HttpStatus status, WebRequest request ) { ApiError apiError = new ApiError( ApiError.ApiErrorCode.BadRequest, exception ); return handleApiError(apiError); } @Override protected ResponseEntity<Object> handleHttpMessageNotWritable( HttpMessageNotWritableException exception, HttpHeaders headers, HttpStatus status, WebRequest request ) { ApiError apiError = new ApiError( ApiError.ApiErrorCode.InternalServerError, exception ); return handleApiError(apiError); } @Override protected ResponseEntity<Object> handleMethodArgumentNotValid( MethodArgumentNotValidException exception, HttpHeaders headers, HttpStatus status, WebRequest request ) { ApiError apiError = new ApiError( ApiError.ApiErrorCode.BadRequest, exception ); return handleApiError(apiError); } @Override protected ResponseEntity<Object> handleMissingServletRequestPart( MissingServletRequestPartException exception, HttpHeaders headers, HttpStatus status, WebRequest request ) { ApiError apiError = new ApiError( ApiError.ApiErrorCode.BadRequest, exception ); return handleApiError(apiError); } @Override protected ResponseEntity<Object> handleBindException( BindException exception, HttpHeaders headers, HttpStatus status, WebRequest request ) { ApiError apiError = new ApiError( ApiError.ApiErrorCode.BadRequest, exception ); return handleApiError(apiError); } @Override protected ResponseEntity<Object> handleNoHandlerFoundException( NoHandlerFoundException exception, HttpHeaders headers, HttpStatus status, WebRequest request ) { ApiError apiError = new ApiError(ApiError.ApiErrorCode.NotFound, exception); return handleApiError(apiError); } @Override protected ResponseEntity<Object> handleAsyncRequestTimeoutException( AsyncRequestTimeoutException exception, HttpHeaders headers, HttpStatus status, WebRequest request ) { ApiError apiError = new ApiError( ApiError.ApiErrorCode.InternalServerError, exception ); return handleApiError(apiError); } protected ResponseEntity<Object> handleApiError(ApiError apiError) { logger.warn(apiError.getErrorCode(), apiError.getCause()); this.errorLoggerService.logThrowable(apiError.getCause()); HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_JSON); return new ResponseEntity<>(apiError, headers, ApiError.API_ERROR_STATUS_CODE); } }
3e05c52b97c0c7f95b0e994c01bead796a875be1
2,914
java
Java
src/main/java/com/samton/erp/api/print/controller/PrintController.java
aaiyusi/base
a2396f6534b84d76901605051d9d0f3c843262ce
[ "Apache-2.0" ]
null
null
null
src/main/java/com/samton/erp/api/print/controller/PrintController.java
aaiyusi/base
a2396f6534b84d76901605051d9d0f3c843262ce
[ "Apache-2.0" ]
1
2019-12-26T11:07:40.000Z
2019-12-26T11:07:40.000Z
src/main/java/com/samton/erp/api/print/controller/PrintController.java
aaiyusi/base
a2396f6534b84d76901605051d9d0f3c843262ce
[ "Apache-2.0" ]
1
2022-01-08T11:33:12.000Z
2022-01-08T11:33:12.000Z
28.019231
106
0.686685
2,418
package com.samton.erp.api.print.controller; import java.util.ArrayList; import java.util.List; import java.util.Map; import javax.annotation.Resource; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import com.samton.erp.api.print.bean.entity.TErpPrintTemplate; import com.samton.erp.api.print.service.IPrintService; import com.samton.erp.common.util.ChangeString; import com.samton.platform.common.bean.param.JqParamBean; import com.samton.platform.framework.base.SdkBaseController; import com.samton.platform.framework.mybatis.pagination.Pagination; /** * * * @Description:标签打印中心Controller * @author: Alex * @date: 2016年4月20日 下午4:17:14 * Copyright (c) 2016, Samton. All rights reserved */ @Controller @RequestMapping("/api/print") public class PrintController extends SdkBaseController { @Resource private IPrintService printService; /** * * @Title: getTempList * @Description: 根据标签类型,获得标签模板 * @param: @param tempType 标签类型 * @param: @param type 0:默认模板 1:企业模板 * @param: @param tempModel 0:全部规格 1:10cm x 10cm 2:8cm x 3cm 3:5cm x 2cm * @param: @return * @return: Map<String,Object> * @author Alex * @Date 2016年4月20日 下午4:23:16 */ @RequestMapping(value = "/getTempList") @ResponseBody public Map<String, Object> getTempList(Short tempType, int type, Integer tempModel){ List<TErpPrintTemplate> list =printService.getTempList(tempType, type, tempModel); return this.getResultMap(list.size() > 0, list); } /** * * @Title: queryTempByPage * @Description: 获得标签模板数据(分页) * @param: @param param * @param: @param temp * @param: @param tempModel 0:全部规格 1:10cm x 10cm 2:8cm x 3cm 3:5cm x 2cm * @param: @return * @return: Map<String,Object> * @author Alex * @Date 2016年4月25日 上午9:49:01 */ @RequestMapping(value = "/queryTempByPage") @ResponseBody public Map<String, Object> queryTempByPage(JqParamBean param, TErpPrintTemplate temp, Integer tempModel){ //判断标签模板规格 if(tempModel != null){ switch (tempModel) { case 1: temp.settLength(10); temp.settWidth(10); break; case 2: temp.settLength(8); temp.settWidth(3); break; case 3: temp.settLength(5); temp.settWidth(2); break; } } //获得当前登陆信息 // UserCacheBean userCacheBean = CurrentUtil.getCurrentUser(); // temp.setCreateUserId(userCacheBean.getUserId()); // temp.setEnterpriseId(userCacheBean.getEnterpriseId()); param.setSidx(ChangeString.changeString(param.getSidx(), 0)); //设置查询信息 param.setSearch(temp); //查询数据 Pagination<TErpPrintTemplate> list = printService.queryTempByPage(param); return this.getResultMap(list != null, list); } }
3e05c697bc918e9fffdf16b65db23aa730ae001f
890
java
Java
src/main/java/no/espenwaaga/model/Book.java
espenwaaga/Asynchronous-RESTful-Services
b291d9ff20471242c05856fad17fe9b3746495e8
[ "MIT" ]
null
null
null
src/main/java/no/espenwaaga/model/Book.java
espenwaaga/Asynchronous-RESTful-Services
b291d9ff20471242c05856fad17fe9b3746495e8
[ "MIT" ]
null
null
null
src/main/java/no/espenwaaga/model/Book.java
espenwaaga/Asynchronous-RESTful-Services
b291d9ff20471242c05856fad17fe9b3746495e8
[ "MIT" ]
null
null
null
16.181818
46
0.582022
2,419
package no.espenwaaga.model; import java.util.Date; public class Book { private String title; private String author; private String isbn; private Date published; private String id; public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getAuthor() { return author; } public void setAuthor(String author) { this.author = author; } public String getIsbn() { return isbn; } public void setIsbn(String isbn) { this.isbn = isbn; } public Date getPublished() { return published; } public void setPublished(Date published) { this.published = published; } public String getId() { return id; } public void setId(String id) { this.id = id; } }
3e05c6bb1b68964082aa8770ce1509cf40b28eae
5,348
java
Java
src/test/java/org/culturegraph/mf/iso2709/DirectoryEntryTest.java
zazi/metafacture-core
31131450928bf976becced7a915ef127d473dff2
[ "Apache-2.0" ]
null
null
null
src/test/java/org/culturegraph/mf/iso2709/DirectoryEntryTest.java
zazi/metafacture-core
31131450928bf976becced7a915ef127d473dff2
[ "Apache-2.0" ]
null
null
null
src/test/java/org/culturegraph/mf/iso2709/DirectoryEntryTest.java
zazi/metafacture-core
31131450928bf976becced7a915ef127d473dff2
[ "Apache-2.0" ]
null
null
null
32.216867
94
0.777113
2,420
/* * Copyright 2016 Christoph Böhme * * 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.culturegraph.mf.iso2709; import static junit.framework.TestCase.assertTrue; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.mockito.Mockito.when; import java.nio.charset.Charset; import org.culturegraph.mf.exceptions.FormatException; import org.culturegraph.mf.util.StringUtil; import org.junit.Before; import org.junit.Test; import org.mockito.Mock; import org.mockito.MockitoAnnotations; /** * Tests for class {@link DirectoryEntry}. * * @author Christoph Böhme */ public class DirectoryEntryTest { private static final String DUMMY_LABEL = StringUtil.repeatChars(' ', 24); private static final byte[] RECORD = asBytes(DUMMY_LABEL + "001234IMP" + "002567LEM" + Iso646Characters.IS2 + Iso646Characters.IS3); @Mock private Label label; private Iso646ByteBuffer buffer; private DirectoryEntry directoryEntry; @Before public void initMocksAndCreateSystemUnderTest() { MockitoAnnotations.initMocks(this); when(label.getFieldLengthLength()).thenReturn(1); when(label.getFieldStartLength()).thenReturn(2); when(label.getImplDefinedPartLength()).thenReturn(3); when(label.getBaseAddress()).thenReturn(RECORD.length - 1); buffer = new Iso646ByteBuffer(RECORD); directoryEntry = new DirectoryEntry(buffer, label); } @Test public void constructor_shouldCreateDirectoryEntryInstance() { final byte[] record = asBytes(DUMMY_LABEL + "001234IMP" + Iso646Characters.IS2 + Iso646Characters.IS3); when(label.getBaseAddress()).thenReturn(record.length - 1); buffer = new Iso646ByteBuffer(record); directoryEntry = new DirectoryEntry(buffer, label); assertNotNull(directoryEntry); } @Test(expected = FormatException.class) public void constructor_shouldThrowFormatExceptionIfBufferIsTooShort() { buffer = new Iso646ByteBuffer(asBytes("00005")); directoryEntry = new DirectoryEntry(buffer, label); // Exception expected } @Test(expected = FormatException.class) public void constructor_shouldThrowFormatExceptionIfDirectoryDoesNotEndWithFieldSeparator() { final byte[] record = asBytes(DUMMY_LABEL + 'F' + Iso646Characters.IS3); when(label.getBaseAddress()).thenReturn(record.length - 1); buffer = new Iso646ByteBuffer(record); directoryEntry = new DirectoryEntry(buffer, label); // Exception expected } @Test(expected = FormatException.class) public void constructor_shouldThrowFormatExceptionIfDirectoryIsNotMultipleOfEntryLength() { final byte[] record = asBytes(DUMMY_LABEL + "001234IM" + Iso646Characters.IS2 + Iso646Characters.IS3); when(label.getBaseAddress()).thenReturn(record.length - 1); buffer = new Iso646ByteBuffer(record); directoryEntry = new DirectoryEntry(buffer, label); // Exception expected } @Test public void constructor_shouldSetFirstEntryAsCurrentEntry() { assertArrayEquals("001".toCharArray(), directoryEntry.getTag()); } @Test public void gotoNext_shouldSetNextEntryAsCurrentEntry() { directoryEntry.gotoNext(); assertArrayEquals("002".toCharArray(), directoryEntry.getTag()); } @Test public void reset_shouldSetFirstEntryAsCurrentEntry() { directoryEntry.gotoNext(); directoryEntry.reset(); assertArrayEquals("001".toCharArray(), directoryEntry.getTag()); } @Test public void endOfDirectoryReached_shouldReturnFalseIfNotAtEndOFDirectory() { assertFalse(directoryEntry.endOfDirectoryReached()); } @Test public void endOfDirectoryReached_shouldReturnTrueIfAtEndOFDirectory() { directoryEntry.gotoNext(); directoryEntry.gotoNext(); assertTrue(directoryEntry.endOfDirectoryReached()); } @Test public void getTag_shouldReturnTagFromCurrentEntry() { assertArrayEquals("001".toCharArray(), directoryEntry.getTag()); directoryEntry.gotoNext(); assertArrayEquals("002".toCharArray(), directoryEntry.getTag()); } @Test public void getFieldLength_shouldReturnFieldLengthFromCurrentEntry() { assertEquals(2, directoryEntry.getFieldLength()); directoryEntry.gotoNext(); assertEquals(5, directoryEntry.getFieldLength()); } @Test public void getFieldStart_shouldReturnFieldStartFromCurrentEntry() { assertEquals(34, directoryEntry.getFieldStart()); directoryEntry.gotoNext(); assertEquals(67, directoryEntry.getFieldStart()); } @Test public void getImplDefinedPart_shouldReturnImplDefinedPartFromCurrentEntry() { assertArrayEquals("IMP".toCharArray(), directoryEntry.getImplDefinedPart()); directoryEntry.gotoNext(); assertArrayEquals("LEM".toCharArray(), directoryEntry.getImplDefinedPart()); } private static byte[] asBytes(final String str) { return str.getBytes(Charset.forName("UTF-8")); } }
3e05c7a2c41fd6ffa408a42a2e6feef81999dbd6
7,083
java
Java
springfox-data-rest/src/main/java/springfox/documentation/spring/data/rest/schema/EmbeddedCollectionModelProvider.java
sigand/springfox
cbb17fb8a4ef0c37f287cdfb9bed79260aa634bf
[ "Apache-2.0" ]
5,703
2015-03-24T16:01:38.000Z
2022-03-30T14:20:12.000Z
springfox-data-rest/src/main/java/springfox/documentation/spring/data/rest/schema/EmbeddedCollectionModelProvider.java
sigand/springfox
cbb17fb8a4ef0c37f287cdfb9bed79260aa634bf
[ "Apache-2.0" ]
3,445
2015-03-24T05:11:02.000Z
2022-03-31T09:55:29.000Z
springfox-data-rest/src/main/java/springfox/documentation/spring/data/rest/schema/EmbeddedCollectionModelProvider.java
sigand/springfox
cbb17fb8a4ef0c37f287cdfb9bed79260aa634bf
[ "Apache-2.0" ]
1,689
2015-03-24T03:37:02.000Z
2022-03-31T09:05:39.000Z
40.942197
97
0.71721
2,421
/* * * Copyright 2017-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * */ package springfox.documentation.spring.data.rest.schema; import com.fasterxml.classmate.ResolvedType; import com.fasterxml.classmate.TypeResolver; import org.springframework.hateoas.CollectionModel; import org.springframework.hateoas.server.LinkRelationProvider; import springfox.documentation.builders.ModelPropertyBuilder; import springfox.documentation.builders.ModelSpecificationBuilder; import springfox.documentation.builders.PropertySpecificationBuilder; import springfox.documentation.schema.CollectionType; import springfox.documentation.schema.ModelSpecification; import springfox.documentation.schema.PropertySpecification; import springfox.documentation.schema.TypeNameExtractor; import springfox.documentation.schema.Xml; import springfox.documentation.schema.property.ModelSpecificationFactory; import springfox.documentation.spi.DocumentationType; import springfox.documentation.spi.schema.EnumTypeDeterminer; import springfox.documentation.spi.schema.SyntheticModelProviderPlugin; import springfox.documentation.spi.schema.contexts.ModelContext; import java.util.List; import java.util.Set; import static java.util.Collections.*; import static java.util.function.Function.*; import static java.util.stream.Collectors.*; import static springfox.documentation.schema.ResolvedTypes.*; class EmbeddedCollectionModelProvider implements SyntheticModelProviderPlugin { private final TypeResolver resolver; private final LinkRelationProvider relProvider; private final TypeNameExtractor typeNameExtractor; private final EnumTypeDeterminer enumTypeDeterminer; private final ModelSpecificationFactory modelSpecifications; EmbeddedCollectionModelProvider( TypeResolver resolver, LinkRelationProvider relProvider, TypeNameExtractor typeNameExtractor, EnumTypeDeterminer enumTypeDeterminer, ModelSpecificationFactory modelSpecifications) { this.resolver = resolver; this.relProvider = relProvider; this.typeNameExtractor = typeNameExtractor; this.enumTypeDeterminer = enumTypeDeterminer; this.modelSpecifications = modelSpecifications; } @SuppressWarnings("deprecation") @Override public springfox.documentation.schema.Model create(ModelContext context) { ResolvedType resourceType = resolver.resolve(context.getType()); List<ResolvedType> typeParameters = resourceType.getTypeParameters(); Class<?> type = typeParameters.get(0).getErasedType(); String name = typeNameExtractor.typeName(context); return context.getBuilder() .description(String.format( "Embedded collection of %s", type.getSimpleName())) .name(name) .qualifiedType(type.getName()) .type(typeParameters.get(0)) .properties(properties(context).stream() .collect(toMap(springfox.documentation.schema.ModelProperty::getName, identity()))) .xml(new Xml() .wrapped(true) .name("content") ) .build(); } @Override @SuppressWarnings("deprecation") public List<springfox.documentation.schema.ModelProperty> properties(ModelContext context) { ResolvedType resourceType = resolver.resolve(context.getType()); List<ResolvedType> typeParameters = resourceType.getTypeParameters(); Class<?> type = typeParameters.get(0).getErasedType(); return singletonList( new ModelPropertyBuilder() .name(relProvider.getCollectionResourceRelFor(type).value()) .type(resolver.resolve(List.class, type)) .qualifiedType(CollectionModel.class.getName()) .position(0) .required(true) .isHidden(false) .description("Resource collection") .build() .updateModelRef(modelRefFactory(context, enumTypeDeterminer, typeNameExtractor))); } @Override public ModelSpecification createModelSpecification(ModelContext context) { ResolvedType resourceType = resolver.resolve(context.getType()); List<ResolvedType> typeParameters = resourceType.getTypeParameters(); Class<?> type = typeParameters.get(0).getErasedType(); String name = typeNameExtractor.typeName(context); return context.getModelSpecificationBuilder() .name(name) .facets(f -> f.description(String.format( "Embedded collection of %s", type.getSimpleName())) .xml(new Xml() .wrapped(true) .name("content"))) .compoundModel(cm -> cm.properties(propertySpecifications(context)) .modelKey(m -> m.isResponse(context.isReturnType()) .qualifiedModelName(q -> q.namespace("springfox.documentation.spring.data.rest.schema") .name(name)) .build())) .build(); } @Override public List<PropertySpecification> propertySpecifications(ModelContext context) { ResolvedType resourceType = resolver.resolve(context.getType()); List<ResolvedType> typeParameters = resourceType.getTypeParameters(); Class<?> type = typeParameters.get(0).getErasedType(); ModelSpecification modelSpecification = new ModelSpecificationBuilder() .collectionModel(c -> c.model(m -> m.copyOf(modelSpecifications.create(context, typeParameters.get(0)))) .collectionType(CollectionType.LIST)) .build(); return singletonList( new PropertySpecificationBuilder(relProvider.getCollectionResourceRelFor(type).value()) .type(modelSpecification) .position(0) .required(true) .isHidden(false) .description("Resource collection") .build()); } @Override public Set<ResolvedType> dependencies(ModelContext context) { ResolvedType resourceType = resolver.resolve(context.getType()); List<ResolvedType> typeParameters = resourceType.getTypeParameters(); Class<?> type = typeParameters.get(0).getErasedType(); return singleton(resolver.resolve(type)); } @Override public boolean supports(ModelContext delimiter) { return EmbeddedCollection.class.equals(resolver.resolve(delimiter.getType()).getErasedType()) && (delimiter.getDocumentationType() == DocumentationType.SWAGGER_2 || delimiter.getDocumentationType() == DocumentationType.OAS_30); } }
3e05c7a8a6d2968d53531b62e407bb6f53e40f5b
2,357
java
Java
konker.registry.web/src/main/java/com/konkerlabs/platform/registry/security/TenantUserDetailsService.java
sonecabr/konker-platform
12f6307cb5125ab58788972957e1e6fee29ff0c4
[ "Apache-2.0" ]
34
2017-02-06T12:31:29.000Z
2021-11-03T18:39:50.000Z
konker.registry.web/src/main/java/com/konkerlabs/platform/registry/security/TenantUserDetailsService.java
sonecabr/konker-platform
12f6307cb5125ab58788972957e1e6fee29ff0c4
[ "Apache-2.0" ]
15
2017-02-07T12:10:00.000Z
2021-11-10T13:28:45.000Z
konker.registry.web/src/main/java/com/konkerlabs/platform/registry/security/TenantUserDetailsService.java
sonecabr/konker-platform
12f6307cb5125ab58788972957e1e6fee29ff0c4
[ "Apache-2.0" ]
11
2017-02-16T08:50:03.000Z
2021-06-22T23:57:45.000Z
36.828125
97
0.730165
2,422
package com.konkerlabs.platform.registry.security; import com.konkerlabs.platform.registry.business.model.Tenant; import com.konkerlabs.platform.registry.business.model.User; import com.konkerlabs.platform.registry.business.repositories.UserRepository; import com.konkerlabs.platform.registry.config.EmailConfig; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.stereotype.Service; import java.util.Optional; import java.util.Random; @Service("tenantUserDetails") public class TenantUserDetailsService implements UserDetailsService { private static final Logger LOGGER = LoggerFactory.getLogger(TenantUserDetailsService.class); private static final int MIN_DELAY_TIME = 100; private static final int MAX_DELAY_TIME = 250; @Autowired private UserRepository userRepository; @Autowired private EmailConfig emailConfig; @Override public UserDetails loadUserByUsername(String email) throws UsernameNotFoundException { // Delay time introduced to prevent user enumeration attack Random random = new Random(); int delayTime = random.nextInt(MAX_DELAY_TIME - MIN_DELAY_TIME) + MIN_DELAY_TIME; try { Thread.sleep(delayTime); } catch (InterruptedException e) { e.printStackTrace(); } User user = userRepository.findOne(Optional.of(email).orElse("").trim().toLowerCase()); if(user == null){ invalidCredentials(email); } else if (Optional.ofNullable(user).isPresent() && emailConfig.isEnabled() && !user.isActive()) { invalidCredentials(email); } return user; } private void invalidCredentials(String email) { User noUser = User.builder().email(email).tenant( Tenant.builder().name("NOT_FOUND").domainName("NOT_FOUND").build() ).build(); LOGGER.debug("User not found", noUser.toURI(), noUser.getTenant().getLogLevel()); throw new UsernameNotFoundException("authentication.credentials.invalid"); } }
3e05c7d2076f924b541935fc3c9ea88439805768
1,371
java
Java
src/main/java/net/teamhollow/soulstriders/init/SSBlocks.java
teamhollow/soulstriders
0b4aa866fd3d7da227cb33d4d6bcd8805c85b6d8
[ "MIT" ]
null
null
null
src/main/java/net/teamhollow/soulstriders/init/SSBlocks.java
teamhollow/soulstriders
0b4aa866fd3d7da227cb33d4d6bcd8805c85b6d8
[ "MIT" ]
2
2020-09-18T18:49:05.000Z
2020-11-22T11:15:00.000Z
src/main/java/net/teamhollow/soulstriders/init/SSBlocks.java
teamhollow/soulstriders
0b4aa866fd3d7da227cb33d4d6bcd8805c85b6d8
[ "MIT" ]
null
null
null
42.84375
244
0.78337
2,423
package net.teamhollow.soulstriders.init; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.minecraft.block.Block; import net.minecraft.block.Material; import net.minecraft.block.MaterialColor; import net.minecraft.item.BlockItem; import net.minecraft.item.Item; import net.minecraft.sound.BlockSoundGroup; import net.minecraft.util.Identifier; import net.minecraft.util.registry.Registry; import net.teamhollow.soulstriders.SoulStriders; import net.teamhollow.soulstriders.block.SoulStriderBulbBlock; public class SSBlocks { public static final Block SOUL_STRIDER_BULB = register(SoulStriderBulbBlock.id, new SoulStriderBulbBlock(FabricBlockSettings.of(Material.STONE, MaterialColor.STONE).ticksRandomly().strength(0.5F).nonOpaque().sounds(BlockSoundGroup.STONE))); public SSBlocks() {} public static Block register(String id, Block block, boolean registerItem) { Identifier identifier = new Identifier(SoulStriders.MOD_ID, id); Block registeredBlock = Registry.register(Registry.BLOCK, identifier, block); if (registerItem) SSItems.register(id, new BlockItem(registeredBlock, new Item.Settings().maxCount(64).group(SoulStriders.ITEM_GROUP))); return registeredBlock; } public static Block register(String id, Block block) { return register(id, block, true); } }
3e05c7fa881a808c15e2cd83bf3088d9c1ad573b
458
java
Java
ucar-java-common/src/test/java/me/zhangchunsheng/ucar/common/config/UcarConfigTest.java
Ride-Group/UcarJava
265eb152d216afdf39f7e2134bca005909bc414c
[ "Apache-2.0" ]
null
null
null
ucar-java-common/src/test/java/me/zhangchunsheng/ucar/common/config/UcarConfigTest.java
Ride-Group/UcarJava
265eb152d216afdf39f7e2134bca005909bc414c
[ "Apache-2.0" ]
null
null
null
ucar-java-common/src/test/java/me/zhangchunsheng/ucar/common/config/UcarConfigTest.java
Ride-Group/UcarJava
265eb152d216afdf39f7e2134bca005909bc414c
[ "Apache-2.0" ]
null
null
null
21.809524
74
0.672489
2,424
package me.zhangchunsheng.ucar.common.config; import org.testng.annotations.Test; /** * <pre> * Created by Chunsheng Zhang on 2020/7/17. * </pre> * * @author <a href="https://github.com/zhangchunsheng">Chunsheng Zhang</a> */ public class UcarConfigTest { private UcarConfig ucarConfig = new UcarConfig(); @Test public void test1() throws Exception { ucarConfig.setClientId("1"); ucarConfig.setClientSecret("1"); } }
3e05c8611b5af96fb58dba5db32fc31506c21b64
2,751
java
Java
skycloud-base-consul/src/main/java/com/skycloud/base/config/health/ConsulhealthController.java
woyaofuwu/skycloud-base
950bf6f240f38c2d495c387bfb80de2784414be7
[ "MIT" ]
79
2019-08-31T14:11:44.000Z
2022-01-13T00:17:42.000Z
skycloud-base-consul/src/main/java/com/skycloud/base/config/health/ConsulhealthController.java
woyaofuwu/skycloud-base
950bf6f240f38c2d495c387bfb80de2784414be7
[ "MIT" ]
1
2020-07-22T06:28:25.000Z
2020-07-22T06:28:25.000Z
skycloud-base-consul/src/main/java/com/skycloud/base/config/health/ConsulhealthController.java
woyaofuwu/skycloud-base
950bf6f240f38c2d495c387bfb80de2784414be7
[ "MIT" ]
42
2019-11-25T15:56:00.000Z
2022-03-30T01:09:00.000Z
43.666667
82
0.733551
2,425
/* * The MIT License (MIT) * Copyright © 2019 <sky> * * 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. */ ///* // * The MIT License (MIT) // * Copyright © 2019 <sky> // * // * 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.skycloud.base.config.health; // //import org.springframework.web.bind.annotation.RequestMapping; //import org.springframework.web.bind.annotation.RestController; // ///** // * config custom health check // * @author // */ //@RestController //@RequestMapping("/consulhealth") //public class ConsulhealthController { // // @RequestMapping("/healthCheck") // public String healthCheck() { // return "ok"; // } //}
3e05c8853809246ea2532f9815128196476718d5
5,269
java
Java
src/main/java/com/mazentop/entity/SysExchangeRate.java
chanwaikit/fulin-test
e31ef03596b724ba48d72ca8021492e6f251ec20
[ "0BSD" ]
null
null
null
src/main/java/com/mazentop/entity/SysExchangeRate.java
chanwaikit/fulin-test
e31ef03596b724ba48d72ca8021492e6f251ec20
[ "0BSD" ]
null
null
null
src/main/java/com/mazentop/entity/SysExchangeRate.java
chanwaikit/fulin-test
e31ef03596b724ba48d72ca8021492e6f251ec20
[ "0BSD" ]
null
null
null
24.630841
88
0.609182
2,426
package com.mazentop.entity; import com.alibaba.fastjson.annotation.JSONField; import java.util.function.Supplier; import java.util.Map; import java.sql.ResultSet; import java.sql.SQLException; import com.mztframework.commons.Utils; import com.mztframework.dao.jdbc.BaseBean; import org.springframework.jdbc.core.RowMapper; import java.math.BigDecimal; /** * Author: zhaoqt * Mail: [email protected] * Date: 16:21 2020/04/13 * Company: 美赞拓 * Version: 1.0 * Description: SysExchangeRate实体 */ @SuppressWarnings("all") public class SysExchangeRate extends BaseBean<SysExchangeRate> { /** * 表名 */ public static final String TABLE_NAME = "sys_exchange_rate"; /** * */ public static final String F_ID = "id"; /** * 换算币种 */ public static final String F_SCUR = "scur"; /** * 被换算币种 */ public static final String F_TCUR = "tcur"; /** * 换算比率 */ public static final String F_RATIO = "ratio"; /** * 手动录入比率 */ public static final String F_TAG_RATIO = "tag_ratio"; /** * 换算更新时间 */ public static final String F_EDIT_TIME = "edit_time"; @Override protected void initBeanValues(){ put(F_ID, null); put(F_SCUR, null); put(F_TCUR, null); put(F_RATIO, null); put(F_TAG_RATIO, null); put(F_EDIT_TIME, null); } public SysExchangeRate() { super(); } public SysExchangeRate(Map<String, Object> map) { super(map); } public SysExchangeRate(String id) { super(); setId(id); } /** * @return id to id <BR/> */ public String getId() { return getTypedValue(F_ID, String.class); } /** * @param id to id set */ public SysExchangeRate setId(String id) { set(F_ID, id); return this; } /** * @return scur to scur 换算币种<BR/> */ public String getScur() { return getTypedValue(F_SCUR, String.class); } /** * @param scur to scur 换算币种 set */ public SysExchangeRate setScur(String scur) { set(F_SCUR, scur); return this; } /** * @return tcur to tcur 被换算币种<BR/> */ public String getTcur() { return getTypedValue(F_TCUR, String.class); } /** * @param tcur to tcur 被换算币种 set */ public SysExchangeRate setTcur(String tcur) { set(F_TCUR, tcur); return this; } /** * @return ratio to ratio 换算比率<BR/> */ public BigDecimal getRatio() { return getTypedValue(F_RATIO, BigDecimal.class); } /** * @param ratio to ratio 换算比率 set */ public SysExchangeRate setRatio(BigDecimal ratio) { set(F_RATIO, ratio); return this; } /** * @return tag_ratio to tagRatio 手动录入比率<BR/> */ public BigDecimal getTagRatio() { return getTypedValue(F_TAG_RATIO, BigDecimal.class); } /** * @param tagRatio to tag_ratio 手动录入比率 set */ public SysExchangeRate setTagRatio(BigDecimal tagRatio) { set(F_TAG_RATIO, tagRatio); return this; } /** * @return edit_time to editTime 换算更新时间<BR/> */ public Long getEditTime() { return getTypedValue(F_EDIT_TIME, Long.class); } /** * @param editTime to edit_time 换算更新时间 set */ public SysExchangeRate setEditTime(Long editTime) { set(F_EDIT_TIME, editTime); return this; } @JSONField(serialize = false) @Override public Object getPrimaryKey() { return getId(); } @Override public SysExchangeRate setPrimaryKey(Object key) { setId(Utils.toCast(key, String.class)); return this; } @JSONField(serialize = false) @Override public String getTableName() { return TABLE_NAME; } public static SysExchangeRate me(){ return new SysExchangeRate(); } private static class Mapper implements RowMapper<SysExchangeRate> { private Supplier<SysExchangeRate> supplier; public Mapper(Supplier supplier) { this.supplier = supplier; } @Override public SysExchangeRate mapRow(ResultSet rs, int rownum) throws SQLException { SysExchangeRate bean = supplier.get(); bean.setId(Utils.toCast(rs.getObject(F_ID), String.class)); bean.setScur(Utils.toCast(rs.getObject(F_SCUR), String.class)); bean.setTcur(Utils.toCast(rs.getObject(F_TCUR), String.class)); bean.setRatio(Utils.toCast(rs.getObject(F_RATIO), BigDecimal.class)); bean.setTagRatio(Utils.toCast(rs.getObject(F_TAG_RATIO), BigDecimal.class)); bean.setEditTime(Utils.toCast(rs.getObject(F_EDIT_TIME), Long.class)); bean.clearModifyKeys(); return bean; } } @Override public RowMapper<SysExchangeRate> newMapper(){ return newMapper(SysExchangeRate::new); } public RowMapper<SysExchangeRate> newMapper(Supplier<SysExchangeRate> supplier){ return new Mapper(supplier); } public static abstract class Sub extends SysExchangeRate { @Override public abstract RowMapper<SysExchangeRate> newMapper(); } }
3e05c88953aeddec29b0cba303bcc4b258e84d3e
8,785
java
Java
x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/ssl/SSLReloadIntegTests.java
lipsill/elasticsearch
b55b079a90c271e7a51eaffa1adb04cac4b642e3
[ "Apache-2.0" ]
2
2019-07-22T16:36:57.000Z
2021-06-21T14:27:38.000Z
x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/ssl/SSLReloadIntegTests.java
lipsill/elasticsearch
b55b079a90c271e7a51eaffa1adb04cac4b642e3
[ "Apache-2.0" ]
null
null
null
x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/ssl/SSLReloadIntegTests.java
lipsill/elasticsearch
b55b079a90c271e7a51eaffa1adb04cac4b642e3
[ "Apache-2.0" ]
null
null
null
47.486486
139
0.699715
2,427
/* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ package org.elasticsearch.xpack.ssl; import org.bouncycastle.asn1.x500.X500Name; import org.bouncycastle.asn1.x509.Extension; import org.bouncycastle.asn1.x509.Time; import org.bouncycastle.cert.X509CertificateHolder; import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter; import org.bouncycastle.cert.jcajce.JcaX509ExtensionUtils; import org.bouncycastle.cert.jcajce.JcaX509v3CertificateBuilder; import org.bouncycastle.operator.ContentSigner; import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.network.InetAddressHelper; import org.elasticsearch.common.settings.MockSecureSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.common.util.set.Sets; import org.elasticsearch.env.TestEnvironment; import org.elasticsearch.test.SecurityIntegTestCase; import org.elasticsearch.test.SecuritySettingsSource; import org.elasticsearch.test.SecuritySettingsSourceField; import org.elasticsearch.transport.Transport; import org.elasticsearch.xpack.core.ssl.CertUtils; import org.elasticsearch.xpack.core.ssl.SSLService; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; import javax.net.ssl.SSLHandshakeException; import javax.net.ssl.SSLSocket; import javax.net.ssl.SSLSocketFactory; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.SocketException; import java.nio.file.AtomicMoveNotSupportedException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardCopyOption; import java.security.KeyPair; import java.security.KeyStore; import java.security.cert.Certificate; import java.security.cert.X509Certificate; import java.util.Locale; import java.util.concurrent.CountDownLatch; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.is; /** * Integration tests for SSL reloading support */ public class SSLReloadIntegTests extends SecurityIntegTestCase { private Path nodeStorePath; @Override public Settings nodeSettings(int nodeOrdinal) { if (nodeStorePath == null) { Path origPath = getDataPath("/org/elasticsearch/xpack/security/transport/ssl/certs/simple/testnode.jks"); Path tempDir = createTempDir(); nodeStorePath = tempDir.resolve("testnode.jks"); try { Files.copy(origPath, nodeStorePath); } catch (IOException e) { throw new ElasticsearchException("failed to copy keystore"); } } Settings settings = super.nodeSettings(nodeOrdinal); Settings.Builder builder = Settings.builder() .put(settings.filter((s) -> s.startsWith("xpack.ssl.") == false)); SecuritySettingsSource.addSSLSettingsForStore(builder, "/org/elasticsearch/xpack/security/transport/ssl/certs/simple/testnode.jks", "testnode"); builder.put("resource.reload.interval.high", "1s") .put("xpack.ssl.keystore.path", nodeStorePath); if (builder.get("xpack.ssl.truststore.path") != null) { builder.put("xpack.ssl.truststore.path", nodeStorePath); } return builder.build(); } @Override protected boolean transportSSLEnabled() { return true; } public void testThatSSLConfigurationReloadsOnModification() throws Exception { KeyPair keyPair = CertUtils.generateKeyPair(randomFrom(1024, 2048)); X509Certificate certificate = getCertificate(keyPair); KeyStore keyStore = KeyStore.getInstance("jks"); keyStore.load(null, null); keyStore.setKeyEntry("key", keyPair.getPrivate(), SecuritySettingsSourceField.TEST_PASSWORD.toCharArray(), new Certificate[] { certificate }); Path keystorePath = createTempDir().resolve("newcert.jks"); try (OutputStream out = Files.newOutputStream(keystorePath)) { keyStore.store(out, SecuritySettingsSourceField.TEST_PASSWORD.toCharArray()); } MockSecureSettings secureSettings = new MockSecureSettings(); secureSettings.setString("xpack.ssl.keystore.secure_password", SecuritySettingsSourceField.TEST_PASSWORD); secureSettings.setString("xpack.ssl.truststore.secure_password", "testnode"); Settings settings = Settings.builder() .put("path.home", createTempDir()) .put("xpack.ssl.keystore.path", keystorePath) .put("xpack.ssl.truststore.path", nodeStorePath) .setSecureSettings(secureSettings) .build(); String node = randomFrom(internalCluster().getNodeNames()); SSLService sslService = new SSLService(settings, TestEnvironment.newEnvironment(settings)); SSLSocketFactory sslSocketFactory = sslService.sslSocketFactory(settings); TransportAddress address = internalCluster() .getInstance(Transport.class, node).boundAddress().publishAddress(); try (SSLSocket socket = (SSLSocket) sslSocketFactory.createSocket(address.getAddress(), address.getPort())) { assertThat(socket.isConnected(), is(true)); socket.startHandshake(); fail("handshake should not have been successful!"); } catch (SSLHandshakeException | SocketException expected) { logger.trace("expected exception", expected); } KeyStore nodeStore = KeyStore.getInstance("jks"); try (InputStream in = Files.newInputStream(nodeStorePath)) { nodeStore.load(in, "testnode".toCharArray()); } nodeStore.setCertificateEntry("newcert", certificate); Path path = nodeStorePath.getParent().resolve("updated.jks"); try (OutputStream out = Files.newOutputStream(path)) { nodeStore.store(out, "testnode".toCharArray()); } try { Files.move(path, nodeStorePath, StandardCopyOption.REPLACE_EXISTING, StandardCopyOption.ATOMIC_MOVE); } catch (AtomicMoveNotSupportedException e) { Files.move(path, nodeStorePath, StandardCopyOption.REPLACE_EXISTING); } CountDownLatch latch = new CountDownLatch(1); assertBusy(() -> { try (SSLSocket socket = (SSLSocket) sslSocketFactory.createSocket(address.getAddress(), address.getPort())) { logger.info("opened socket for reloading [{}]", socket); socket.addHandshakeCompletedListener(event -> { try { assertThat(event.getPeerPrincipal().getName(), containsString("Test Node")); logger.info("ssl handshake completed on port [{}]", event.getSocket().getLocalPort()); latch.countDown(); } catch (Exception e) { fail("caught exception in listener " + e.getMessage()); } }); socket.startHandshake(); } catch (Exception e) { fail("caught exception " + e.getMessage()); } }); latch.await(); } private X509Certificate getCertificate(KeyPair keyPair) throws Exception { final DateTime notBefore = new DateTime(DateTimeZone.UTC); final DateTime notAfter = notBefore.plusYears(1); X500Name subject = new X500Name("CN=random cert"); JcaX509v3CertificateBuilder builder = new JcaX509v3CertificateBuilder(subject, CertUtils.getSerial(), new Time(notBefore.toDate(), Locale.ROOT), new Time(notAfter.toDate(), Locale.ROOT), subject, keyPair.getPublic()); JcaX509ExtensionUtils extUtils = new JcaX509ExtensionUtils(); builder.addExtension(Extension.subjectKeyIdentifier, false, extUtils.createSubjectKeyIdentifier(keyPair.getPublic())); builder.addExtension(Extension.authorityKeyIdentifier, false, extUtils.createAuthorityKeyIdentifier(keyPair.getPublic())); builder.addExtension(Extension.subjectAlternativeName, false, CertUtils.getSubjectAlternativeNames(true, Sets.newHashSet(InetAddressHelper.getAllAddresses()))); ContentSigner signer = new JcaContentSignerBuilder("SHA256withRSA").build(keyPair.getPrivate()); X509CertificateHolder certificateHolder = builder.build(signer); return new JcaX509CertificateConverter().getCertificate(certificateHolder); } }
3e05c8e8ca4d6ee9b04bcbd934983ba95f9bd66f
274
java
Java
app/src/main/java/com/sony/dpt/drawing/strokes/StrokesContainer.java
DPT-RP1/dpt-manga
58b846448ceee8ac0bf55409337cc10800818132
[ "MIT" ]
null
null
null
app/src/main/java/com/sony/dpt/drawing/strokes/StrokesContainer.java
DPT-RP1/dpt-manga
58b846448ceee8ac0bf55409337cc10800818132
[ "MIT" ]
null
null
null
app/src/main/java/com/sony/dpt/drawing/strokes/StrokesContainer.java
DPT-RP1/dpt-manga
58b846448ceee8ac0bf55409337cc10800818132
[ "MIT" ]
null
null
null
18.266667
54
0.748175
2,428
package com.sony.dpt.drawing.strokes; import java.util.Collection; public interface StrokesContainer { void setDrawingStroke(final Stroke stroke); void persistDrawing(); void addStrokes(final Collection<Stroke> strokes); Collection<Stroke> getAll(); }
3e05c905a2ccd12cdf5be5ec7061dde76550c284
2,376
java
Java
nsi/src/main/java/net/es/nsi/lib/soap/gen/nsi_2_0/connection/types/ChildRecursiveListType.java
StackV/oscars
23725dfdf42f2eda93799ec3dc9c16fcc9abf3e0
[ "MIT" ]
10
2015-03-17T19:11:30.000Z
2018-03-16T13:52:14.000Z
nsi/src/main/java/net/es/nsi/lib/soap/gen/nsi_2_0/connection/types/ChildRecursiveListType.java
esnet/oscars
2dbc6b484dc537c6fd18bd7c43df31386d82195b
[ "MIT" ]
41
2016-05-17T20:15:36.000Z
2022-02-26T10:05:08.000Z
nsi/src/main/java/net/es/nsi/lib/soap/gen/nsi_2_0/connection/types/ChildRecursiveListType.java
StackV/oscars
23725dfdf42f2eda93799ec3dc9c16fcc9abf3e0
[ "MIT" ]
4
2016-01-19T14:35:28.000Z
2021-07-22T15:53:31.000Z
29.7
155
0.612374
2,429
package net.es.nsi.lib.soap.gen.nsi_2_0.connection.types; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; /** * * A holder element providing an envelope that will contain the * list of child NSA and associated detailed connection * information. * * Elements: * * child - Detailed path information for a child NSA. Each * child element is ordered and contains a connection segment in * the overall path. * * * <p>Java class for ChildRecursiveListType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="ChildRecursiveListType"&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="child" type="{http://schemas.ogf.org/nsi/2013/12/connection/types}ChildRecursiveType" maxOccurs="unbounded" minOccurs="0"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ChildRecursiveListType", propOrder = { "child" }) public class ChildRecursiveListType { protected List<ChildRecursiveType> child; /** * Gets the value of the child property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the child property. * * <p> * For example, to add a new item, do as follows: * <pre> * getChild().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link ChildRecursiveType } * * */ public List<ChildRecursiveType> getChild() { if (child == null) { child = new ArrayList<ChildRecursiveType>(); } return this.child; } }
3e05cb04d78eec5e104252abf58bfe856b58b51d
2,746
java
Java
BopZZ/src/com/bop/zz/refresh/loadingviewfinal/style/indicator/BallZigZagIndicator.java
xmutzlq/ZZ
5ac74f815790884686cdc750748187a2288bd0eb
[ "Apache-2.0" ]
2
2018-12-12T08:37:03.000Z
2019-03-22T13:12:00.000Z
BopZZ/src/com/bop/zz/refresh/loadingviewfinal/style/indicator/BallZigZagIndicator.java
xmutzlq/ZZ
5ac74f815790884686cdc750748187a2288bd0eb
[ "Apache-2.0" ]
null
null
null
BopZZ/src/com/bop/zz/refresh/loadingviewfinal/style/indicator/BallZigZagIndicator.java
xmutzlq/ZZ
5ac74f815790884686cdc750748187a2288bd0eb
[ "Apache-2.0" ]
null
null
null
37.108108
125
0.61799
2,430
package com.bop.zz.refresh.loadingviewfinal.style.indicator; import android.graphics.Canvas; import android.graphics.Paint; import android.view.animation.LinearInterpolator; import com.nineoldandroids.animation.Animator; import com.nineoldandroids.animation.ValueAnimator; import java.util.ArrayList; import java.util.List; public class BallZigZagIndicator extends BaseIndicatorController { float[] translateX=new float[2],translateY=new float[2]; @Override public void draw(Canvas canvas, Paint paint) { for (int i = 0; i < 2; i++) { canvas.save(); canvas.translate(translateX[i], translateY[i]); canvas.drawCircle(0, 0, getWidth() / 10, paint); canvas.restore(); } } @Override public List<Animator> createAnimation() { List<Animator> animators=new ArrayList<Animator>(); float startX=getWidth()/6; float startY=getWidth()/6; for (int i = 0; i < 2; i++) { final int index=i; ValueAnimator translateXAnim=ValueAnimator.ofFloat(startX,getWidth()-startX,getWidth()/2,startX); if (i==1){ translateXAnim=ValueAnimator.ofFloat(getWidth()-startX,startX,getWidth()/2,getWidth()-startX); } ValueAnimator translateYAnim=ValueAnimator.ofFloat(startY,startY,getHeight()/2,startY); if (i==1){ translateYAnim=ValueAnimator.ofFloat(getHeight()-startY,getHeight()-startY,getHeight()/2,getHeight()-startY); } translateXAnim.setDuration(1000); translateXAnim.setInterpolator(new LinearInterpolator()); translateXAnim.setRepeatCount(-1); translateXAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator animation) { translateX[index] = (Float) animation.getAnimatedValue(); postInvalidate(); } }); translateXAnim.start(); translateYAnim.setDuration(1000); translateYAnim.setInterpolator(new LinearInterpolator()); translateYAnim.setRepeatCount(-1); translateYAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator animation) { translateY[index] = (Float) animation.getAnimatedValue(); postInvalidate(); } }); translateYAnim.start(); animators.add(translateXAnim); animators.add(translateYAnim); } return animators; } }
3e05cb6751738e8acb1d8093d3442f0b26c6c032
4,638
java
Java
src/com/Voxce/DAO/ActionTextsDAO.java
trialmanager/voxce
b7b1796a60e63bf6a9db47406f6810ba44c46cc3
[ "Apache-2.0" ]
29
2015-01-24T12:49:57.000Z
2021-11-12T14:11:33.000Z
src/com/Voxce/DAO/ActionTextsDAO.java
trialmanager/voxce
b7b1796a60e63bf6a9db47406f6810ba44c46cc3
[ "Apache-2.0" ]
4
2015-08-04T14:09:36.000Z
2019-03-26T12:58:59.000Z
src/com/Voxce/DAO/ActionTextsDAO.java
trialmanager/voxce
b7b1796a60e63bf6a9db47406f6810ba44c46cc3
[ "Apache-2.0" ]
14
2015-04-03T21:54:11.000Z
2021-07-14T08:07:35.000Z
31.127517
207
0.695343
2,431
package com.Voxce.DAO; import java.util.ArrayList; import java.util.List; import org.hibernate.SessionFactory; import org.springframework.orm.hibernate3.HibernateTemplate; import com.Voxce.model.ActionTexts; import com.Voxce.model.Users; public class ActionTextsDAO { private HibernateTemplate hibernateTemplate; List<ActionTexts> listActionTexts; public void setSessionFactory(SessionFactory sessionFactory) { this.hibernateTemplate = new HibernateTemplate(sessionFactory); } //*** ADD ActionText public int saveActionText(ActionTexts actionText, Users user){ int messageCode = -1; java.util.Date today = new java.util.Date(); java.sql.Date dateCreated = new java.sql.Date(today.getTime()); int language = 1; List<?> existingCodes = null; List<?> existingNames = null; //Check for existing actionText code or name try{ existingCodes = hibernateTemplate.find("SELECT CODE FROM ActionTexts WHERE subscriber_id="+user.getSubscription_id()+" AND CODE=?", actionText.getCODE()); existingNames = hibernateTemplate.find("SELECT NAME FROM ActionTexts WHERE subscriber_id="+user.getSubscription_id()+" AND NAME=?", actionText.getNAME()); } catch(Exception exp){ exp.printStackTrace(); } if(existingNames.size()!=0){ //ActionText already exists , 0 is left for empty message string messageCode = 1; } else if(existingCodes.size()!=0){ //ActionText code already exists messageCode=2; } else if(existingCodes.size()==0 && existingNames.size()==0){ //ActionText code or name is valid, so save it actionText.setLANGUAGE_ID(language); actionText.setDATE_CREATED(dateCreated); actionText.setSubscriber_id(user.getSubscription_id()); hibernateTemplate.saveOrUpdate(actionText); messageCode = 3; } else{ messageCode = 4; } return messageCode; } //****** GET ActionTexts LIST @SuppressWarnings("unchecked") public List<ActionTexts> getActionTextsList(Users user) throws Exception{ try{ if(user.getUser_type().equals("super admin")){ return (List<ActionTexts>) hibernateTemplate.find("from ActionTexts"); }else{ return (List<ActionTexts>) hibernateTemplate.find("from ActionTexts WHERE subscriber_id="+user.getSubscription_id()+""); } }catch(Exception ex){ return new ArrayList<ActionTexts>(); } } //**** FIND THE ActionText public ActionTexts findAnActionText(int at_id) { ActionTexts actionText = null; List<?> findActionText = null; try{ findActionText = hibernateTemplate.find("FROM ActionTexts WHERE ACTION_TEXT_ID = ?", at_id); actionText = (ActionTexts) findActionText.get(0); } catch(Exception excp){ System.out.println("Exception ActionText = "+ excp); } return actionText; } //**** UPDATE THE ActionText public int updateActionTexts(ActionTexts newAT, Users user){ List<?> existingCodes = null; List<?> existingNames = null; int messageCode = -1; java.util.Date today = new java.util.Date(); java.sql.Date dateModified = new java.sql.Date(today.getTime()); //Check for existing action text code or name try{ existingCodes = hibernateTemplate.find("SELECT CODE FROM ActionTexts WHERE subscriber_id="+user.getSubscription_id()+" AND CODE = ? AND ACTION_TEXT_ID <> ?", newAT.getCODE(), newAT.getACTION_TEXT_ID()); existingNames = hibernateTemplate.find("SELECT NAME FROM ActionTexts WHERE subscriber_id="+user.getSubscription_id()+" AND NAME = ? AND ACTION_TEXT_ID <> ?", newAT.getNAME(), newAT.getACTION_TEXT_ID()); } catch(Exception exp){ exp.printStackTrace(); } if(existingNames.size()!=0){ //ActionText already exists , 0 is left for empty message string messageCode = 1; } else if(existingCodes.size()!=0){ //ActionText code already exists messageCode = 2; } else if(existingCodes.size()==0 && existingNames.size()==0){ //ActionText code or name is valid, so save it newAT.setDATE_MODIFIED(dateModified); try{ ActionTexts oldText = this.findAnActionText(newAT.getACTION_TEXT_ID()); newAT.setLANGUAGE_ID(oldText.getLANGUAGE_ID()); newAT.setCREATED_BY(oldText.getCREATED_BY()); newAT.setDATE_CREATED(oldText.getDATE_CREATED()); newAT.setSubscriber_id(user.getSubscription_id()); hibernateTemplate.update(newAT); // hibernateTemplate.flush(); } catch(Exception e) { e.printStackTrace(); } messageCode = 3; } else{ messageCode = 4; } return messageCode; } } //END ACTION TEXT CLASS
3e05cb9bce4cd06e5a17ea7ae56b5e33be2856ec
7,301
java
Java
anychart/src/main/java/com/anychart/scales/ScatterTicks.java
gitdevstar/FinanicalApp
b9d8af5c6fd17a8f3f5ae178f31b9c9325fca012
[ "Apache-2.0" ]
null
null
null
anychart/src/main/java/com/anychart/scales/ScatterTicks.java
gitdevstar/FinanicalApp
b9d8af5c6fd17a8f3f5ae178f31b9c9325fca012
[ "Apache-2.0" ]
null
null
null
anychart/src/main/java/com/anychart/scales/ScatterTicks.java
gitdevstar/FinanicalApp
b9d8af5c6fd17a8f3f5ae178f31b9c9325fca012
[ "Apache-2.0" ]
null
null
null
34.601896
143
0.623887
2,432
package com.anychart.scales; import com.anychart.APIlib; import com.anychart.chart.common.dataentry.DataEntry; import com.anychart.JsObject; import com.anychart.core.Base; import java.util.Locale; import java.util.Arrays; import java.util.List; import java.util.ArrayList; import android.text.TextUtils; // class /** * The ScatterTicks class contains methods for configuring ticks on the Scatter scale. */ public class ScatterTicks extends Base { protected ScatterTicks() { } public static ScatterTicks instantiate() { return new ScatterTicks("new anychart.scales.scatterTicks()"); } public ScatterTicks(String jsChart) { jsBase = "scatterTicks" + ++variableIndex; APIlib.getInstance().addJSLine(jsBase + " = " + jsChart + ";"); } public String getJsBase() { return jsBase; } /** * Getter for the allowFractional flag. */ public void allowFractional() { APIlib.getInstance().addJSLine(jsBase + ".allowFractional();"); } /** * Setter for the allowFractional flag.<br/> Whether to the allow fractional values in ticks.<br/> <b>Note</b>: When {@link anychart.scales.ScatterTicks#mode} set to 'logarithmic', the allowFractional flag is always <b>false</b>. */ public com.anychart.scales.ScatterTicks allowFractional(Boolean enabled) { APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".allowFractional(%s);", enabled)); return this; } /** * Getter for ticks base value. */ public void base() { APIlib.getInstance().addJSLine(jsBase + ".base();"); } /** * Setter for ticks base value. <b>Note:</b> it is a number that is guaranteed to set a tick if the number is located between minimum and maximum values of the scale. */ public com.anychart.scales.ScatterTicks base(Number baseValue) { APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".base(%s);", baseValue)); return this; } /** * Getter for ticks count. */ public void count() { APIlib.getInstance().addJSLine(jsBase + ".count();"); } /** * Setter for ticks count value. <b>Note:</b> Final number of ticks can be greater (one more tick can be added). */ public com.anychart.scales.ScatterTicks count(Number count) { APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".count(%s);", count)); return this; } /** * Setter for ticks count value using two parameters. <b>Note:</b> Final number of ticks can be greater than maximum (one more tick can be added). */ public com.anychart.scales.ScatterTicks count(Number minimumCount, Number maximumCount) { APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".count(%s, %s);", minimumCount, maximumCount)); return this; } /** * Returns an array of ticks. Each tick is a value in terms of data, to make a tick on. <b>Note:</b> returns correct values only after {@link anychart.scales.Base#finishAutoCalc} or after <b>chart.draw()</b> */ public void get() { APIlib.getInstance().addJSLine(jsBase + ".get();"); } /** * Getter for ticks interval value. <b>Note:</b> You can get interval value only if it was set explicitly, otherwise its returns NaN. */ public void interval() { APIlib.getInstance().addJSLine(jsBase + ".interval();"); } /** * Setter for ticks interval value. */ public com.anychart.scales.ScatterTicks interval(Number value) { APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".interval(%s);", value)); return this; } /** * Getter for the ticks mode. */ public void mode() { APIlib.getInstance().addJSLine(jsBase + ".mode();"); } /** * Setter for the ticks mode. <b>Note:</b> Use only with logarithmic scales. */ public com.anychart.scales.ScatterTicks mode(com.anychart.enums.ScatterTicksMode mode) { APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".mode(%s);", (mode != null) ? mode.getJsBase() : null)); return this; } /** * Setter for the ticks mode. <b>Note:</b> Use only with logarithmic scales. */ public com.anychart.scales.ScatterTicks mode(String mode) { APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".mode(%s);", wrapQuotes(mode))); return this; } /** * Removes all listeners from an object. You can also optionally remove listeners of some particular type. */ public void removeAllListeners(String type) { APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".removeAllListeners(%s);", wrapQuotes(type))); } /** * Setups ticks as an explicit array of fixed ticks. */ public com.anychart.scales.ScatterTicks set(String[] ticks) { APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".set(%s);", arrayToStringWrapQuotes(ticks))); return this; } public void setOnClickListener(com.anychart.chart.common.listener.ListenersInterface.OnClickListener listener) { StringBuilder js = new StringBuilder(); js.append(jsBase).append(".listen('pointClick', function(e) {"); if (listener.getFields() != null) { js.append("var result = "); for (String field : listener.getFields()) { js.append(String.format(Locale.US, "'%1$s' + ':' + e.point.get('%1$s') + ',' +", field)); } js.setLength(js.length() - 8); js.append(";"); js.append("android.onClick(result);"); } else { js.append("android.onClick(null);"); } js.append("});"); com.anychart.chart.common.listener.ListenersInterface.getInstance().setOnClickListener(listener); APIlib.getInstance().addJSLine(js.toString()); } public void setOnClickListener(com.anychart.chart.common.listener.ListenersInterface.OnClickListener listener, String type, String ePath) { StringBuilder js = new StringBuilder(); js.append(jsBase).append(String.format(Locale.US, ".listen('%1$s', function(e) {", type)); if (listener.getFields() != null) { ePath = (ePath != null) ? ePath + "." : ""; js.append("var result = "); for (String field : listener.getFields()) { js.append(String.format(Locale.US, "'%1$s' + ':' + e.%2$s%1$s + ',' +", field, ePath)); } js.setLength(js.length() - 8); js.append(";"); js.append("android.onClick(result);"); } else { js.append("android.onClick(null);"); } js.append("});"); com.anychart.chart.common.listener.ListenersInterface.getInstance().setOnClickListener(listener); APIlib.getInstance().addJSLine(js.toString()); } /** * Removes an event listener which was added with listen() by the key returned by listen() or listenOnce(). */ public void unlistenByKey(String key) { APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".unlistenByKey(%s);", wrapQuotes(key))); } }
3e05cbc38c075f7025c82436840679b7600e94ce
184
java
Java
src/model/entities/Motorcycle.java
joaopioner1/VehicleRentalSystem
5221fbfd712f54639484690178bed634e7094045
[ "MIT" ]
null
null
null
src/model/entities/Motorcycle.java
joaopioner1/VehicleRentalSystem
5221fbfd712f54639484690178bed634e7094045
[ "MIT" ]
null
null
null
src/model/entities/Motorcycle.java
joaopioner1/VehicleRentalSystem
5221fbfd712f54639484690178bed634e7094045
[ "MIT" ]
null
null
null
13.142857
51
0.733696
2,433
package model.entities; import model.Enum.ColorEnum; public class Motorcycle extends Vehicle { public Motorcycle(ColorEnum color, String model) { super(color, model); } }
3e05cc28c2dd1ee9b6964c7ae2daa6829190b987
1,789
java
Java
plugins/transforms/valuemapper/src/main/java/org/apache/hop/pipeline/transforms/valuemapper/ValueMapperData.java
henrikjan/incubator-hop
c4d05201ed61585a04678f383c80352a1423b370
[ "Apache-2.0" ]
null
null
null
plugins/transforms/valuemapper/src/main/java/org/apache/hop/pipeline/transforms/valuemapper/ValueMapperData.java
henrikjan/incubator-hop
c4d05201ed61585a04678f383c80352a1423b370
[ "Apache-2.0" ]
null
null
null
plugins/transforms/valuemapper/src/main/java/org/apache/hop/pipeline/transforms/valuemapper/ValueMapperData.java
henrikjan/incubator-hop
c4d05201ed61585a04678f383c80352a1423b370
[ "Apache-2.0" ]
null
null
null
29.816667
82
0.651202
2,434
/*! ****************************************************************************** * * Hop : The Hop Orchestration Platform * * Copyright (C) 2002-2017 by Hitachi Vantara : http://www.pentaho.com * ******************************************************************************* * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ******************************************************************************/ package org.apache.hop.pipeline.transforms.valuemapper; import org.apache.hop.core.row.IRowMeta; import org.apache.hop.core.row.IValueMeta; import org.apache.hop.core.row.value.ValueMetaString; import org.apache.hop.pipeline.transform.BaseTransformData; import org.apache.hop.pipeline.transform.ITransformData; import java.util.Hashtable; /** * @author Matt * @since 24-jan-2005 */ public class ValueMapperData extends BaseTransformData implements ITransformData { public IRowMeta previousMeta; public IRowMeta outputMeta; public int keynr; public Hashtable<String, String> hashtable; public int emptyFieldIndex; public IValueMeta stringMeta; public IValueMeta outputValueMeta; public IValueMeta sourceValueMeta; public ValueMapperData() { super(); hashtable = null; stringMeta = new ValueMetaString( "string" ); } }
3e05cd53a8be686e4f3ea5061b34060bae02ecaa
2,537
java
Java
src/main/java/net/wissel/vertx/proxy/filters/html/DropLinks.java
Stwissel/SampleProxy
2ad190b4b776bda19ab4a2715a26a3ef26b339be
[ "Apache-2.0" ]
1
2022-03-17T02:03:59.000Z
2022-03-17T02:03:59.000Z
src/main/java/net/wissel/vertx/proxy/filters/html/DropLinks.java
Stwissel/SampleProxy
2ad190b4b776bda19ab4a2715a26a3ef26b339be
[ "Apache-2.0" ]
1
2018-12-11T15:59:13.000Z
2018-12-11T15:59:27.000Z
src/main/java/net/wissel/vertx/proxy/filters/html/DropLinks.java
Stwissel/SampleProxy
2ad190b4b776bda19ab4a2715a26a3ef26b339be
[ "Apache-2.0" ]
null
null
null
43.084746
88
0.446892
2,435
/** ========================================================================= * * Copyright (C) 2017, 2018 Salesforce Inc ( http://www.salesforce.com/ * * All rights reserved. * * * * @author Stephan H. Wissel (stw) <[email protected]> * * @notessensei * * @version 1.0 * * ========================================================================== * * * * Licensed under the Apache License, Version 2.0 (the "License"). You may * * not use this file except in compliance with the License. You may obtain a * * copy of the License at <http://www.apache.org/licenses/LICENSE-2.0>. * * * * Unless required by applicable law or agreed to in writing, software * * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * * License for the specific language governing permissions and limitations * * under the License. * * * * ========================================================================== * */ package net.wissel.vertx.proxy.filters.html; import org.jsoup.nodes.Document; import org.jsoup.select.Elements; import io.vertx.core.json.JsonObject; import net.wissel.vertx.proxy.filters.HtmlSubFilter; /** * Gets rid of all images * * @author swissel * */ public class DropLinks implements HtmlSubFilter { private final JsonObject parameters; public DropLinks(final JsonObject parameters) { this.parameters = parameters; } /** * @see net.wissel.vertx.proxy.filters.HtmlSubFilter#apply(org.jsoup.nodes.Document) */ @Override public void apply(final Document doc) { final boolean fullRemove = this.parameters.getBoolean("fullremove", false); final Elements links = doc.getElementsByTag("a"); links.forEach(e -> { if (fullRemove) { e.remove(); } else { e.attr("href", "#"); } }); } }
3e05cd798201ee4b30c14d4987ccc2e973776ae3
1,214
java
Java
app/src/main/java/com/redberrystudios/whatsfordinner/AppExecutors.java
RedBerryStudios/WhatsForDinner-Android
e00cd8c246e90fb89d8e8dda73ed5e03bc758351
[ "Apache-2.0" ]
null
null
null
app/src/main/java/com/redberrystudios/whatsfordinner/AppExecutors.java
RedBerryStudios/WhatsForDinner-Android
e00cd8c246e90fb89d8e8dda73ed5e03bc758351
[ "Apache-2.0" ]
null
null
null
app/src/main/java/com/redberrystudios/whatsfordinner/AppExecutors.java
RedBerryStudios/WhatsForDinner-Android
e00cd8c246e90fb89d8e8dda73ed5e03bc758351
[ "Apache-2.0" ]
null
null
null
23.803922
84
0.686161
2,436
package com.redberrystudios.whatsfordinner; import android.os.Handler; import android.os.Looper; import android.support.annotation.NonNull; import java.util.concurrent.Executor; import java.util.concurrent.Executors; public class AppExecutors { private final Executor mDiskIO; private final Executor mNetworkIO; private final Executor mMainThread; private AppExecutors(Executor diskIO, Executor networkIO, Executor mainThread) { this.mDiskIO = diskIO; this.mNetworkIO = networkIO; this.mMainThread = mainThread; } public AppExecutors() { this(Executors.newSingleThreadExecutor(), Executors.newFixedThreadPool(3), new MainThreadExecutor()); } public Executor diskIO() { return mDiskIO; } public Executor networkIO() { return mNetworkIO; } public Executor mainThread() { return mMainThread; } private static class MainThreadExecutor implements Executor { private Handler mainThreadHandler = new Handler(Looper.getMainLooper()); @Override public void execute(@NonNull Runnable command) { mainThreadHandler.post(command); } } }
3e05cde1d21ec0ec9e03afec56d65bdc6d98f678
7,273
java
Java
hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionRemoteProcedureBase.java
sanyaa92/hbase
3fe8649b2c9ba1271c25e8f476548907e4c7a90d
[ "Apache-2.0" ]
null
null
null
hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionRemoteProcedureBase.java
sanyaa92/hbase
3fe8649b2c9ba1271c25e8f476548907e4c7a90d
[ "Apache-2.0" ]
null
null
null
hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionRemoteProcedureBase.java
sanyaa92/hbase
3fe8649b2c9ba1271c25e8f476548907e4c7a90d
[ "Apache-2.0" ]
null
null
null
40.405556
114
0.751684
2,437
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.hadoop.hbase.master.assignment; import java.io.IOException; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; import org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv; import org.apache.hadoop.hbase.master.procedure.TableProcedureInterface; import org.apache.hadoop.hbase.procedure2.FailedRemoteDispatchException; import org.apache.hadoop.hbase.procedure2.Procedure; import org.apache.hadoop.hbase.procedure2.ProcedureEvent; import org.apache.hadoop.hbase.procedure2.ProcedureStateSerializer; import org.apache.hadoop.hbase.procedure2.ProcedureSuspendedException; import org.apache.hadoop.hbase.procedure2.ProcedureYieldException; import org.apache.hadoop.hbase.procedure2.RemoteProcedureDispatcher.RemoteProcedure; import org.apache.hadoop.hbase.procedure2.RemoteProcedureException; import org.apache.yetus.audience.InterfaceAudience; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.RegionRemoteProcedureBaseStateData; /** * The base class for the remote procedures used to open/close a region. * <p/> * Notice that here we do not care about the result of the remote call, if the remote call is * finished, either succeeded or not, we will always finish the procedure. The parent procedure * should take care of the result and try to reschedule if the result is not good. */ @InterfaceAudience.Private public abstract class RegionRemoteProcedureBase extends Procedure<MasterProcedureEnv> implements TableProcedureInterface, RemoteProcedure<MasterProcedureEnv, ServerName> { private static final Logger LOG = LoggerFactory.getLogger(RegionRemoteProcedureBase.class); protected RegionInfo region; private ServerName targetServer; private boolean dispatched; protected RegionRemoteProcedureBase() { } protected RegionRemoteProcedureBase(RegionInfo region, ServerName targetServer) { this.region = region; this.targetServer = targetServer; } @Override public void remoteOperationCompleted(MasterProcedureEnv env) { // should not be called since we use reportRegionStateTransition to report the result throw new UnsupportedOperationException(); } @Override public void remoteOperationFailed(MasterProcedureEnv env, RemoteProcedureException error) { // should not be called since we use reportRegionStateTransition to report the result throw new UnsupportedOperationException(); } private RegionStateNode getRegionNode(MasterProcedureEnv env) { return env.getAssignmentManager().getRegionStates().getRegionStateNode(region); } @Override public void remoteCallFailed(MasterProcedureEnv env, ServerName remote, IOException exception) { RegionStateNode regionNode = getRegionNode(env); regionNode.lock(); try { ProcedureEvent<?> event = regionNode.getProcedureEvent(); if (event.isReady()) { LOG.warn( "The procedure event of procedure {} for region {} to server {} is not suspended, " + "usually this should not happen, but anyway let's skip the following wake up code, ", this, region, targetServer); return; } LOG.warn("The remote operation {} for region {} to server {} failed", this, region, targetServer, exception); event.wake(env.getProcedureScheduler()); } finally { regionNode.unlock(); } } @Override public TableName getTableName() { return region.getTable(); } @Override protected void rollback(MasterProcedureEnv env) throws IOException, InterruptedException { throw new UnsupportedOperationException(); } @Override protected boolean abort(MasterProcedureEnv env) { return false; } /** * Check whether we still need to make the call to RS. * <p/> * Usually this will not happen if we do not allow assigning a already onlined region. But if we * have something wrong in the RSProcedureDispatcher, where we have already sent the request to * RS, but then we tell the upper layer the remote call is failed due to rpc timeout or connection * closed or anything else, then this issue can still happen. So here we add a check to make it * more robust. */ protected abstract boolean shouldDispatch(RegionStateNode regionNode); @Override protected Procedure<MasterProcedureEnv>[] execute(MasterProcedureEnv env) throws ProcedureYieldException, ProcedureSuspendedException, InterruptedException { if (dispatched) { // we are done, the parent procedure will check whether we are succeeded. return null; } RegionStateNode regionNode = getRegionNode(env); regionNode.lock(); try { if (!shouldDispatch(regionNode)) { return null; } // The code which wakes us up also needs to lock the RSN so here we do not need to synchronize // on the event. ProcedureEvent<?> event = regionNode.getProcedureEvent(); try { env.getRemoteDispatcher().addOperationToNode(targetServer, this); } catch (FailedRemoteDispatchException e) { LOG.warn("Can not add remote operation {} for region {} to server {}, this usually " + "because the server is alread dead, give up and mark the procedure as complete, " + "the parent procedure will take care of this.", this, region, targetServer, e); return null; } dispatched = true; event.suspend(); event.suspendIfNotReady(this); throw new ProcedureSuspendedException(); } finally { regionNode.unlock(); } } @Override protected void serializeStateData(ProcedureStateSerializer serializer) throws IOException { serializer.serialize(RegionRemoteProcedureBaseStateData.newBuilder() .setRegion(ProtobufUtil.toRegionInfo(region)) .setTargetServer(ProtobufUtil.toServerName(targetServer)).setDispatched(dispatched).build()); } @Override protected void deserializeStateData(ProcedureStateSerializer serializer) throws IOException { RegionRemoteProcedureBaseStateData data = serializer.deserialize(RegionRemoteProcedureBaseStateData.class); region = ProtobufUtil.toRegionInfo(data.getRegion()); targetServer = ProtobufUtil.toServerName(data.getTargetServer()); dispatched = data.getDispatched(); } }
3e05ce2984ae3fc759ae5840c921d39e8aaf4baf
307
java
Java
src/main/java/strategy/strategies/impl/SpeedUpWithEngine.java
l81893521/design-pattern-example
19ffd23c5bcb08865fc3b541a4385819275f8ab9
[ "Apache-2.0" ]
3
2016-04-25T01:36:38.000Z
2020-04-10T09:06:44.000Z
src/main/java/strategy/strategies/impl/SpeedUpWithEngine.java
l81893521/design-pattern-example
19ffd23c5bcb08865fc3b541a4385819275f8ab9
[ "Apache-2.0" ]
null
null
null
src/main/java/strategy/strategies/impl/SpeedUpWithEngine.java
l81893521/design-pattern-example
19ffd23c5bcb08865fc3b541a4385819275f8ab9
[ "Apache-2.0" ]
null
null
null
15.35
58
0.742671
2,438
package strategy.strategies.impl; import strategy.strategies.SpeedUpStrategy; /** * 实现了加速策略接口 * 这个实现方法我们是使用引擎加速来实现 * 这个接口可以支持各种使用引擎加速的汽车 * 比如:大众,本田,丰田等等 * @author zhangjiawei * */ public class SpeedUpWithEngine implements SpeedUpStrategy{ public void go() { System.out.println("我用引擎加速"); } }
3e05ced9e42e3ad36207432504f24a99b37768ba
12,748
java
Java
jOOQ/src/main/java/org/jooq/impl/AbstractMeta.java
lelle1234/jOOQ
2ec2de548a59d3277b0888d99ef885cfe1ecb608
[ "Apache-2.0" ]
null
null
null
jOOQ/src/main/java/org/jooq/impl/AbstractMeta.java
lelle1234/jOOQ
2ec2de548a59d3277b0888d99ef885cfe1ecb608
[ "Apache-2.0" ]
null
null
null
jOOQ/src/main/java/org/jooq/impl/AbstractMeta.java
lelle1234/jOOQ
2ec2de548a59d3277b0888d99ef885cfe1ecb608
[ "Apache-2.0" ]
null
null
null
29.785047
131
0.602997
2,439
/* * 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. * * Other licenses: * ----------------------------------------------------------------------------- * Commercial licenses for this work are available. These replace the above * ASL 2.0 and offer limited warranties, support, maintenance, and commercial * database integrations. * * For more information, please visit: http://www.jooq.org/licenses * * * * * * * * * * * * * * * * */ package org.jooq.impl; import static org.jooq.impl.DSL.name; import java.io.Serializable; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import org.jooq.Catalog; import org.jooq.Configuration; import org.jooq.DDLExportConfiguration; import org.jooq.Domain; import org.jooq.Index; import org.jooq.Meta; import org.jooq.Name; import org.jooq.Named; import org.jooq.Queries; import org.jooq.Query; import org.jooq.Schema; import org.jooq.Sequence; import org.jooq.Table; import org.jooq.UniqueKey; import org.jooq.util.xml.jaxb.InformationSchema; /** * @author Lukas Eder */ abstract class AbstractMeta extends AbstractScope implements Meta, Serializable { private static final long serialVersionUID = 910484713008245977L; // [#9010] TODO: Allow for opting out of this cache private Map<Name, Catalog> cachedCatalogs; private Map<Name, Schema> cachedQualifiedSchemas; private Map<Name, Table<?>> cachedQualifiedTables; private Map<Name, Domain<?>> cachedQualifiedDomains; private Map<Name, Sequence<?>> cachedQualifiedSequences; private Map<Name, List<Schema>> cachedUnqualifiedSchemas; private Map<Name, List<Table<?>>> cachedUnqualifiedTables; private Map<Name, List<Domain<?>>> cachedUnqualifiedDomains; private Map<Name, List<Sequence<?>>> cachedUnqualifiedSequences; private List<UniqueKey<?>> cachedPrimaryKeys; private List<Index> cachedIndexes; AbstractMeta(Configuration configuration) { super(configuration); } @Override public final Catalog getCatalog(String name) { return getCatalog(name(name)); } @Override public final Catalog getCatalog(Name name) { initCatalogs(); return cachedCatalogs.get(name); } @Override public final List<Catalog> getCatalogs() { initCatalogs(); return Collections.unmodifiableList(new ArrayList<>(cachedCatalogs.values())); } private final void initCatalogs() { if (cachedCatalogs == null) { cachedCatalogs = new LinkedHashMap<>(); for (Catalog catalog : getCatalogs0()) cachedCatalogs.put(catalog.getQualifiedName(), catalog); } } abstract List<Catalog> getCatalogs0(); @Override public final List<Schema> getSchemas(String name) { return getSchemas(name(name)); } @Override public final List<Schema> getSchemas(Name name) { initSchemas(); return get(name, new Iterable<Schema>() { @Override public Iterator<Schema> iterator() { return getSchemas0().iterator(); } }, cachedQualifiedSchemas, cachedUnqualifiedSchemas); } @Override public final List<Schema> getSchemas() { initSchemas(); return Collections.unmodifiableList(new ArrayList<>(cachedQualifiedSchemas.values())); } private final void initSchemas() { if (cachedQualifiedSchemas == null) { cachedQualifiedSchemas = new LinkedHashMap<>(); cachedUnqualifiedSchemas = new LinkedHashMap<>(); get(name(""), new Iterable<Schema>() { @Override public Iterator<Schema> iterator() { return getSchemas0().iterator(); } }, cachedQualifiedSchemas, cachedUnqualifiedSchemas); } } List<Schema> getSchemas0() { List<Schema> result = new ArrayList<>(); for (Catalog catalog : getCatalogs()) result.addAll(catalog.getSchemas()); return result; } @Override public final List<Table<?>> getTables(String name) { return getTables(name(name)); } @Override public final List<Table<?>> getTables(Name name) { initTables(); return get(name, new Iterable<Table<?>>() { @Override public Iterator<Table<?>> iterator() { return getTables().iterator(); } }, cachedQualifiedTables, cachedUnqualifiedTables); } @Override public final List<Table<?>> getTables() { initTables(); return Collections.unmodifiableList(new ArrayList<>(cachedQualifiedTables.values())); } private final void initTables() { if (cachedQualifiedTables == null) { cachedQualifiedTables = new LinkedHashMap<>(); cachedUnqualifiedTables = new LinkedHashMap<>(); get(name(""), new Iterable<Table<?>>() { @Override public Iterator<Table<?>> iterator() { return getTables0().iterator(); } }, cachedQualifiedTables, cachedUnqualifiedTables); } } List<Table<?>> getTables0() { List<Table<?>> result = new ArrayList<>(); for (Schema schema : getSchemas()) result.addAll(schema.getTables()); return result; } @Override public final List<Domain<?>> getDomains(String name) { return getDomains(name(name)); } @Override public final List<Domain<?>> getDomains(Name name) { initDomains(); return get(name, new Iterable<Domain<?>>() { @Override public Iterator<Domain<?>> iterator() { return getDomains().iterator(); } }, cachedQualifiedDomains, cachedUnqualifiedDomains); } @Override public final List<Domain<?>> getDomains() { initDomains(); return Collections.unmodifiableList(new ArrayList<>(cachedQualifiedDomains.values())); } private final void initDomains() { if (cachedQualifiedDomains == null) { cachedQualifiedDomains = new LinkedHashMap<>(); cachedUnqualifiedDomains = new LinkedHashMap<>(); get(name(""), new Iterable<Domain<?>>() { @Override public Iterator<Domain<?>> iterator() { return getDomains0().iterator(); } }, cachedQualifiedDomains, cachedUnqualifiedDomains); } } List<Domain<?>> getDomains0() { List<Domain<?>> result = new ArrayList<>(); for (Schema schema : getSchemas()) result.addAll(schema.getDomains()); return result; } @Override public final List<Sequence<?>> getSequences(String name) { return getSequences(name(name)); } @Override public final List<Sequence<?>> getSequences(Name name) { initSequences(); return get(name, new Iterable<Sequence<?>>() { @Override public Iterator<Sequence<?>> iterator() { return getSequences().iterator(); } }, cachedQualifiedSequences, cachedUnqualifiedSequences); } @Override public final List<Sequence<?>> getSequences() { initSequences(); return Collections.unmodifiableList(new ArrayList<>(cachedQualifiedSequences.values())); } private final void initSequences() { if (cachedQualifiedSequences == null) { cachedQualifiedSequences = new LinkedHashMap<>(); cachedUnqualifiedSequences = new LinkedHashMap<>(); get(name(""), new Iterable<Sequence<?>>() { @Override public Iterator<Sequence<?>> iterator() { return getSequences0().iterator(); } }, cachedQualifiedSequences, cachedUnqualifiedSequences); } } List<Sequence<?>> getSequences0() { List<Sequence<?>> result = new ArrayList<>(); for (Schema schema : getSchemas()) result.addAll(schema.getSequences()); return result; } @Override public final List<UniqueKey<?>> getPrimaryKeys() { initPrimaryKeys(); return Collections.unmodifiableList(cachedPrimaryKeys); } private final void initPrimaryKeys() { if (cachedPrimaryKeys == null) cachedPrimaryKeys = new ArrayList<>(getPrimaryKeys0()); } List<UniqueKey<?>> getPrimaryKeys0() { List<UniqueKey<?>> result = new ArrayList<>(); for (Table<?> table : getTables()) if (table.getPrimaryKey() != null) result.add(table.getPrimaryKey()); return result; } @Override public final List<Index> getIndexes() { initIndexes(); return Collections.unmodifiableList(cachedIndexes); } private final void initIndexes() { if (cachedIndexes == null) cachedIndexes = new ArrayList<>(getIndexes0()); } List<Index> getIndexes0() { List<Index> result = new ArrayList<>(); for (Table<?> table : getTables()) result.addAll(table.getIndexes()); return result; } private final <T extends Named> List<T> get(Name name, Iterable<T> i, Map<Name, T> qualified, Map<Name, List<T>> unqualified) { if (qualified.isEmpty()) { for (T object : i) { Name q = object.getQualifiedName(); Name u = object.getUnqualifiedName(); qualified.put(q, object); List<T> list = unqualified.get(u); if (list == null) { list = new ArrayList<>(); unqualified.put(u, list); } list.add(object); } } T object = qualified.get(name); if (object != null) return Collections.singletonList(object); List<T> list = unqualified.get(name); if (list == null) return Collections.emptyList(); else return Collections.unmodifiableList(list); } @Override public final Queries ddl() { return ddl(new DDLExportConfiguration()); } // [#9396] TODO Fix this. Subclasses should not need to override this to get // correct results @Override public /* non-final */ Queries ddl(DDLExportConfiguration exportConfiguration) { return new DDL(dsl(), exportConfiguration).queries(this); } @Override public final Meta apply(String migration) { return apply(dsl().parser().parse(migration)); } @Override public final Meta apply(Query... migration) { return apply(dsl().queries(migration)); } @Override public final Meta apply(Collection<? extends Query> migration) { return apply(dsl().queries(migration)); } @Override public final Meta apply(Queries migration) { return dsl().meta(ddl().concat(migration).queries()); } @Override public final Queries migrateTo(Meta other) { return migrateTo(other, new org.jooq.MigrationConfiguration()); } @Override public final Queries migrateTo(Meta other, org.jooq.MigrationConfiguration c) { return new Diff(configuration(), c, this, other).queries(); } // [#9396] TODO Fix this. Subclasses should not need to override this to get // correct results @Override public /* non-final */ InformationSchema informationSchema() { return InformationSchemaExport.exportCatalogs(configuration(), getCatalogs()); } @Override public int hashCode() { return ddl().hashCode(); } @Override public boolean equals(Object obj) { if (obj instanceof Meta) return ddl().equals(((Meta) obj).ddl()); return false; } @Override public String toString() { return ddl().toString(); } }
3e05cf37fceb6713286b96d2008a8ffb77f79566
1,755
java
Java
runtime-parent/runtime-field/src/main/java/com/speedment/runtime/field/internal/predicate/string/AbstractStringPredicate.java
YunLemon/speedment
09211a6b65887b51e3d21581d583c0fd4b268b10
[ "ECL-2.0", "Apache-2.0" ]
2,206
2015-05-21T04:43:59.000Z
2022-03-28T13:57:16.000Z
runtime-parent/runtime-field/src/main/java/com/speedment/runtime/field/internal/predicate/string/AbstractStringPredicate.java
YunLemon/speedment
09211a6b65887b51e3d21581d583c0fd4b268b10
[ "ECL-2.0", "Apache-2.0" ]
877
2015-06-09T13:36:15.000Z
2022-03-29T11:20:44.000Z
runtime-parent/runtime-field/src/main/java/com/speedment/runtime/field/internal/predicate/string/AbstractStringPredicate.java
anniyanvr/speedment
27fa6fe4ad9e6e68d1c0e98655d1d52fbbc3f4d6
[ "ECL-2.0", "Apache-2.0" ]
299
2015-05-29T12:36:04.000Z
2022-03-31T12:33:40.000Z
32.5
80
0.738462
2,440
/* * * Copyright (c) 2006-2020, Speedment, 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.speedment.runtime.field.internal.predicate.string; import com.speedment.common.tuple.Tuple1; import com.speedment.runtime.field.internal.predicate.AbstractFieldPredicate; import com.speedment.runtime.field.predicate.FieldPredicate; import com.speedment.runtime.field.predicate.PredicateType; import com.speedment.runtime.field.trait.HasReferenceValue; import java.util.function.Predicate; /** * Abstract base implementation of a {@link FieldPredicate} for String Fields. * * @param <ENTITY> the entity type * * @author Per Minborg * @since 2.2.0 */ abstract class AbstractStringPredicate<ENTITY, D> extends AbstractFieldPredicate<ENTITY, HasReferenceValue<ENTITY, D, String>> implements Tuple1<String> { private final String operand; AbstractStringPredicate(PredicateType predicateType, final HasReferenceValue<ENTITY, D, String> field, final String operand, final Predicate<ENTITY> tester) { super(predicateType, field, tester); this.operand = operand; } @Override public final String get0() { return operand; } }
3e05cfc155fe2f2f3cc5f7a8eaacca2dc1abf5e1
687
java
Java
accessories/src/main/java/dev/nick/accessories/injection/annotation/binding/OnLongClick.java
NickAndroid/MediaAccessories_Android
90c5573a9831c5c936a9aa7c4883621afe62900e
[ "Apache-2.0" ]
1
2016-06-25T07:33:10.000Z
2016-06-25T07:33:10.000Z
accessories/src/main/java/dev/nick/accessories/injection/annotation/binding/OnLongClick.java
NickAndroid/ZImageLoader
90c5573a9831c5c936a9aa7c4883621afe62900e
[ "Apache-2.0" ]
1
2016-08-25T03:12:09.000Z
2016-08-25T03:12:09.000Z
accessories/src/main/java/dev/nick/accessories/injection/annotation/binding/OnLongClick.java
NickAndroid/ZImageLoader
90c5573a9831c5c936a9aa7c4883621afe62900e
[ "Apache-2.0" ]
null
null
null
32.714286
75
0.74818
2,441
/* * Copyright (c) 2016 Nick Guo * * 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 dev.nick.accessories.injection.annotation.binding; public @interface OnLongClick { }
3e05d0ff503671846a1925bc8e779b44022d226e
6,526
java
Java
JavaSource/org/unitime/timetable/server/admin/DurationTypes.java
KoreaMTS/MTS
70e41df5e7efc5914a6f6e1e61efe66fe0b93ca9
[ "Apache-2.0" ]
3
2016-02-12T07:09:03.000Z
2021-04-02T13:24:34.000Z
JavaSource/org/unitime/timetable/server/admin/DurationTypes.java
KoreaMTS/MTS
70e41df5e7efc5914a6f6e1e61efe66fe0b93ca9
[ "Apache-2.0" ]
2
2022-02-09T23:01:04.000Z
2022-03-31T21:01:27.000Z
JavaSource/org/unitime/timetable/server/admin/DurationTypes.java
KoreaMTS/MTS
70e41df5e7efc5914a6f6e1e61efe66fe0b93ca9
[ "Apache-2.0" ]
1
2019-07-16T07:15:56.000Z
2019-07-16T07:15:56.000Z
39.313253
112
0.755593
2,442
/* * Licensed to The Apereo Foundation under one or more contributor license * agreements. See the NOTICE file distributed with this work for * additional information regarding copyright ownership. * * The Apereo Foundation 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.unitime.timetable.server.admin; import org.cpsolver.ifs.util.ToolBox; import org.hibernate.Session; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.stereotype.Service; import org.unitime.localization.impl.Localization; import org.unitime.timetable.gwt.resources.GwtMessages; import org.unitime.timetable.gwt.shared.SimpleEditInterface; import org.unitime.timetable.gwt.shared.SimpleEditInterface.Field; import org.unitime.timetable.gwt.shared.SimpleEditInterface.FieldType; import org.unitime.timetable.gwt.shared.SimpleEditInterface.Flag; import org.unitime.timetable.gwt.shared.SimpleEditInterface.PageName; import org.unitime.timetable.gwt.shared.SimpleEditInterface.Record; import org.unitime.timetable.model.ChangeLog; import org.unitime.timetable.model.ClassDurationType; import org.unitime.timetable.model.ChangeLog.Operation; import org.unitime.timetable.model.ChangeLog.Source; import org.unitime.timetable.model.dao.ClassDurationTypeDAO; import org.unitime.timetable.security.SessionContext; import org.unitime.timetable.security.rights.Right; /** * @author Tomas Muller */ @Service("gwtAdminTable[type=durationType]") public class DurationTypes implements AdminTable { protected static final GwtMessages MESSAGES = Localization.create(GwtMessages.class); @Override public PageName name() { return new PageName(MESSAGES.pageDurationType(), MESSAGES.pageDurationTypes()); } @Override @PreAuthorize("checkPermission('DurationTypes')") public SimpleEditInterface load(SessionContext context, Session hibSession) { SimpleEditInterface data = new SimpleEditInterface( new Field(MESSAGES.fieldReference(), FieldType.text, 160, 20, Flag.UNIQUE), new Field(MESSAGES.fieldAbbreviation(), FieldType.text, 160, 20, Flag.NOT_EMPTY), new Field(MESSAGES.fieldName(), FieldType.text, 300, 60, Flag.NOT_EMPTY), new Field(MESSAGES.fieldImplementation(), FieldType.text, 600, 255, Flag.NOT_EMPTY, Flag.HIDDEN), new Field(MESSAGES.fieldParameters(), FieldType.text, 300, 200), new Field(MESSAGES.fieldVisible(), FieldType.toggle, 40) ); data.setSortBy(2); data.setAddable(false); for (ClassDurationType type: ClassDurationTypeDAO.getInstance().findAll()) { Record r = data.addRecord(type.getUniqueId(), false); r.setField(0, type.getReference(), false); r.setField(1, type.getAbbreviation()); r.setField(2, type.getLabel()); r.setField(3, type.getImplementation(), false); r.setField(4, type.getParameter()); r.setField(5, type.isVisible() ? "true" : "false"); } data.setEditable(context.hasPermission(Right.DurationTypeEdit)); return data; } @Override @PreAuthorize("checkPermission('DurationTypeEdit')") public void save(SimpleEditInterface data, SessionContext context, Session hibSession) { for (ClassDurationType type: ClassDurationTypeDAO.getInstance().findAll()) { Record r = data.getRecord(type.getUniqueId()); if (r == null) delete(type, context, hibSession); else update(type, r, context, hibSession); } for (Record r: data.getNewRecords()) save(r, context, hibSession); } @Override @PreAuthorize("checkPermission('DurationTypeEdit')") public void save(Record record, SessionContext context, Session hibSession) { ClassDurationType type = new ClassDurationType(); type.setReference(record.getField(0)); type.setAbbreviation(record.getField(1)); type.setLabel(record.getField(2)); type.setImplementation(record.getField(3)); type.setParameter(record.getField(4)); type.setVisible("true".equalsIgnoreCase(record.getField(5))); record.setUniqueId((Long)hibSession.save(type)); ChangeLog.addChange(hibSession, context, type, type.getReference() + " " + type.getLabel(), Source.SIMPLE_EDIT, Operation.CREATE, null, null); } protected void update(ClassDurationType type, Record record, SessionContext context, Session hibSession) { if (type == null) return; if (ToolBox.equals(type.getReference(), record.getField(0)) && ToolBox.equals(type.getAbbreviation(), record.getField(1)) && ToolBox.equals(type.getLabel(), record.getField(2)) && ToolBox.equals(type.getImplementation(), record.getField(3)) && ToolBox.equals(type.getParameter(), record.getField(4)) && ToolBox.equals(type.isVisible(), "true".equalsIgnoreCase(record.getField(5)))) return; type.setReference(record.getField(0)); type.setAbbreviation(record.getField(1)); type.setLabel(record.getField(2)); type.setImplementation(record.getField(3)); type.setParameter(record.getField(4)); type.setVisible("true".equalsIgnoreCase(record.getField(5))); hibSession.saveOrUpdate(type); ChangeLog.addChange(hibSession, context, type, type.getReference() + " " + type.getLabel(), Source.SIMPLE_EDIT, Operation.UPDATE, null, null); } @Override @PreAuthorize("checkPermission('DurationTypeEdit')") public void update(Record record, SessionContext context, Session hibSession) { update(ClassDurationTypeDAO.getInstance().get(record.getUniqueId(), hibSession), record, context, hibSession); } protected void delete(ClassDurationType type, SessionContext context, Session hibSession) { if (type == null) return; ChangeLog.addChange(hibSession, context, type, type.getReference() + " " + type.getLabel(), Source.SIMPLE_EDIT, Operation.DELETE, null, null); hibSession.delete(type); } @Override @PreAuthorize("checkPermission('DurationTypeEdit')") public void delete(Record record, SessionContext context, Session hibSession) { delete(ClassDurationTypeDAO.getInstance().get(record.getUniqueId(), hibSession), context, hibSession); } }
3e05d20d027fbdd3fa9a0fbbb2017839e3594690
5,433
java
Java
registry/src/main/java/net/hasor/registry/server/manager/InitServerManager.java
zycgit/rsf
f66499283ddfb9cf188de1cdd64291d632870dd0
[ "Apache-2.0" ]
93
2016-04-13T06:28:41.000Z
2021-04-25T16:51:38.000Z
registry/src/main/java/net/hasor/registry/server/manager/InitServerManager.java
zycgit/rsf
f66499283ddfb9cf188de1cdd64291d632870dd0
[ "Apache-2.0" ]
1
2017-02-24T17:03:17.000Z
2017-03-12T10:54:41.000Z
registry/src/main/java/net/hasor/registry/server/manager/InitServerManager.java
zycgit/rsf
f66499283ddfb9cf188de1cdd64291d632870dd0
[ "Apache-2.0" ]
40
2016-07-12T13:07:20.000Z
2021-11-09T06:23:02.000Z
50.268519
149
0.552956
2,443
/* * Copyright 2008-2009 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package net.hasor.registry.server.manager; import net.hasor.core.AppContext; import net.hasor.core.Init; import net.hasor.core.Inject; import net.hasor.core.Singleton; import net.hasor.registry.server.adapter.DataAdapter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * 负责启动时将服务器的信息登记到数据库。 * @version : 2015年8月19日 * @author 赵永春([email protected]) */ @Deprecated @Singleton public class InitServerManager { protected Logger logger = LoggerFactory.getLogger(getClass()); @Inject private AppContext appContext; @Inject private DataAdapter dataAdapter; private long serverID; // @Init public void init() throws Throwable { // logger.info("init rsf-center to db."); // // // // -Server信息 // RsfContext rsfContext = this.appContext.getInstance(RsfContext.class); // InterAddress rsfHost = rsfContext.bindAddress(); // // // // -预先查询ServerDO // Result<ServerDO> queryResult = this.dataAdapter.queryServerByHost(rsfHost.getHost(), rsfHost.getPort()); // if (queryResult == null || !queryResult.isSuccess()) { // throw new IllegalStateException("init server info to db failed -> query error ," + queryResult.firstMessage()); // } // // // // -RsfContext到ServerDO的转换 // DataChainContext<RsfContext, ServerDO> dataChainContext = new DataChainContext<RsfContext, ServerDO>() { // }; // // dataChainContext.addDataFilter("dataFilter", this.appContext.getInstance(RsfContext2ServerDODataFilter.class)); // ServerDO serverDO = dataChainContext.doChain(rsfContext, queryResult.getResult()); // // // // -根据预查结果决定是新增还是更新 // if (queryResult.getResult() == null) { // Result<Long> insertResult = this.dataAdapter.insertServer(serverDO); // if (insertResult == null || !insertResult.isSuccess() || insertResult.getResult() == null || insertResult.getResult() <= 0) { // IllegalStateException err = null; // if (insertResult != null) { // err = new IllegalStateException("init server info to db failed -> insert Server error ," + queryResult.firstMessage()); // } else { // err = new IllegalStateException("init server info to db failed -> insert Result is null."); // } // this.logger.error(err.getMessage(), err); // throw err; // } // } else { // Result<Boolean> updateResult = this.dataAdapter.updateServer(serverDO); // if (updateResult == null || !updateResult.isSuccess() || updateResult.getResult() == null || !updateResult.getResult()) { // IllegalStateException err = null; // if (updateResult != null) { // err = new IllegalStateException("init server info to db failed -> update Server error ," + queryResult.firstMessage()); // } else { // err = new IllegalStateException("init server info to db failed -> update Result is null."); // } // this.logger.error(err.getMessage(), err); // throw err; // } // } // // // // -记录盐值和serverID // this.serverID = serverDO.getId(); // // } public void beatServer() throws IllegalStateException { // Date beatDate = new Date(); // logger.info("rsfCenter beat -> {}", DateCenterUtils.timestamp(beatDate)); // Result<Boolean> beatResult = this.dataAdapter.beatOfServer(this.serverID, beatDate); // // // if (beatResult == null || !beatResult.isSuccess() || beatResult.getResult() == null || !beatResult.getResult()) { // IllegalStateException err = null; // if (beatResult != null) { // err = new IllegalStateException("beatOfServer to db failed -> update Server error ," + beatResult.firstMessage()); // } else { // err = new IllegalStateException("beatOfServer to db failed -> update Result is null."); // } // throw err; // } else { // this.logger.info("beatOfServer to db success -> serverID= " + this.serverID); // } // // } }
3e05d3240eb86c076455b48acdcec38219e25a62
2,743
java
Java
server-spi/src/main/java/org/keycloak/models/UserFederationMapperModel.java
imransashraf/keycloak
d138b19adb51418f81d2f60b04297eeefef7612a
[ "Apache-2.0" ]
1
2020-08-17T20:44:14.000Z
2020-08-17T20:44:14.000Z
server-spi/src/main/java/org/keycloak/models/UserFederationMapperModel.java
OneIdentity/keycloak
2f4c2c20f9dbb5aa15781b9ca770182e12336d11
[ "Apache-2.0" ]
1
2021-02-23T14:13:32.000Z
2021-02-23T15:30:40.000Z
server-spi/src/main/java/org/keycloak/models/UserFederationMapperModel.java
OneIdentity/keycloak
2f4c2c20f9dbb5aa15781b9ca770182e12336d11
[ "Apache-2.0" ]
3
2016-03-24T18:44:57.000Z
2020-11-12T10:25:31.000Z
26.394231
96
0.664117
2,444
/* * Copyright 2016 Red Hat, Inc. and/or its affiliates * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.keycloak.models; import java.io.Serializable; import java.util.Map; /** * @author <a href="mailto:[email protected]">Marek Posolda</a> */ public class UserFederationMapperModel implements Serializable { protected String id; protected String name; // Refers to DB ID of federation provider protected String federationProviderId; // Refers to ID of UserFederationMapper implementation ( UserFederationMapperFactory.getId ) protected String federationMapperType; protected Map<String, String> config; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getFederationProviderId() { return federationProviderId; } public void setFederationProviderId(String federationProviderId) { this.federationProviderId = federationProviderId; } public String getFederationMapperType() { return federationMapperType; } public void setFederationMapperType(String federationMapperType) { this.federationMapperType = federationMapperType; } public Map<String, String> getConfig() { return config; } public void setConfig(Map<String, String> config) { this.config = config; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; UserFederationMapperModel that = (UserFederationMapperModel) o; if (!id.equals(that.id)) return false; return true; } @Override public int hashCode() { return id.hashCode(); } @Override public String toString() { return new StringBuilder(" { name=" + name) .append(", federationMapperType=" + federationMapperType) .append(", config=" + config) .append(" } ").toString(); } }
3e05d34242a7ed9778a3159ed16069699c1542fb
1,642
java
Java
moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/xmlschema/defaultns/singleemptyprefix/Person.java
marschall/eclipselink.runtime
3d59eaa9e420902d5347b9fb60fbe6c92310894b
[ "BSD-3-Clause" ]
null
null
null
moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/xmlschema/defaultns/singleemptyprefix/Person.java
marschall/eclipselink.runtime
3d59eaa9e420902d5347b9fb60fbe6c92310894b
[ "BSD-3-Clause" ]
2
2021-03-24T17:58:46.000Z
2021-12-14T20:59:52.000Z
moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/xmlschema/defaultns/singleemptyprefix/Person.java
marschall/eclipselink.runtime
3d59eaa9e420902d5347b9fb60fbe6c92310894b
[ "BSD-3-Clause" ]
null
null
null
35.695652
87
0.648599
2,445
/******************************************************************************* * Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 * which accompanies this distribution. * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html * and the Eclipse Distribution License is available at * http://www.eclipse.org/org/documents/edl-v10.php. ******************************************************************************/ package org.eclipse.persistence.testing.jaxb.xmlschema.defaultns.singleemptyprefix; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAnyAttribute; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import java.util.Map; @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "name" }) @XmlRootElement(name = "person", namespace = "http://www.example.com/FOO") public class Person { @XmlAttribute(name = "name") public String name; // Trigger Bug #493879 @XmlAnyAttribute Map anyAttributes; @Override public String toString() { return "Person:[" + name + "]"; } @Override public boolean equals(Object obj) { if (obj instanceof Person) { Person pObj = (Person) obj; return name.equals(pObj.name); } return false; } }
3e05d4584eaa075d5b3d3381a784b2350386adf9
12,236
java
Java
rpc/src/main/java/org/apache/crail/rpc/RpcRequestMessage.java
raduioanstoica/incubator-crail
a4e38e5e247dfd51d11b7692d78594df0f219bfa
[ "Apache-2.0" ]
1
2022-03-14T07:25:09.000Z
2022-03-14T07:25:09.000Z
rpc/src/main/java/org/apache/crail/rpc/RpcRequestMessage.java
raduioanstoica/incubator-crail
a4e38e5e247dfd51d11b7692d78594df0f219bfa
[ "Apache-2.0" ]
null
null
null
rpc/src/main/java/org/apache/crail/rpc/RpcRequestMessage.java
raduioanstoica/incubator-crail
a4e38e5e247dfd51d11b7692d78594df0f219bfa
[ "Apache-2.0" ]
1
2022-03-14T07:25:15.000Z
2022-03-14T07:25:15.000Z
21.132988
120
0.677019
2,446
/* * Copyright (C) 2015-2018, IBM Corporation * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.crail.rpc; import java.net.UnknownHostException; import java.nio.ByteBuffer; import org.apache.crail.CrailNodeType; import org.apache.crail.metadata.BlockInfo; import org.apache.crail.metadata.DataNodeInfo; import org.apache.crail.metadata.FileInfo; import org.apache.crail.metadata.FileName; public class RpcRequestMessage { public static class CreateFileReq implements RpcProtocol.NameNodeRpcMessage { public static int CSIZE = FileName.CSIZE + 16; protected FileName filename; protected CrailNodeType type; protected int storageClass; protected int locationClass; protected boolean enumerable; public CreateFileReq(){ this.filename = new FileName(); this.type = CrailNodeType.DATAFILE; this.storageClass = 0; this.locationClass = 0; this.enumerable = true; } public CreateFileReq(FileName filename, CrailNodeType type, int storageClass, int locationClass, boolean enumerable) { this.filename = filename; this.type = type; this.storageClass = storageClass; this.locationClass = locationClass; this.enumerable = enumerable; } public FileName getFileName() { return filename; } public CrailNodeType getFileType(){ return type; } public int getStorageClass() { return storageClass; } public int getLocationClass() { return locationClass; } public boolean isEnumerable() { return enumerable; } public int size() { return CSIZE; } public short getType(){ return RpcProtocol.REQ_CREATE_FILE; } public int write(ByteBuffer buffer) { filename.write(buffer); buffer.putInt(type.getLabel()); buffer.putInt(storageClass); buffer.putInt(locationClass); buffer.putInt(enumerable ? 1 : 0); return CSIZE; } public void update(ByteBuffer buffer) { filename.update(buffer); int _type = buffer.getInt(); type = CrailNodeType.parse(_type); storageClass = buffer.getInt(); locationClass = buffer.getInt(); int _enumerable = buffer.getInt(); enumerable = (_enumerable == 1) ? true : false; } @Override public String toString() { return "CreateFileReq [filename=" + filename + ", type=" + type + ", storageClass=" + storageClass + ", locationClass=" + locationClass + ", enumerable=" + enumerable + "]"; } } public static class GetFileReq implements RpcProtocol.NameNodeRpcMessage { public static int CSIZE = FileName.CSIZE + 4; protected FileName filename; protected boolean writeable; public GetFileReq(){ this.filename = new FileName(); this.writeable = false; } public GetFileReq(FileName filename, boolean writeable) { this.filename = filename; this.writeable = writeable; } public FileName getFileName() { return filename; } public boolean isWriteable(){ return writeable; } public int size() { return CSIZE; } public short getType(){ return RpcProtocol.REQ_GET_FILE; } public int write(ByteBuffer buffer) { filename.write(buffer); buffer.putInt(writeable ? 1 : 0); return CSIZE; } public void update(ByteBuffer buffer) { filename.update(buffer); int tmp = buffer.getInt(); writeable = (tmp == 1) ? true : false; } } public static class SetFileReq implements RpcProtocol.NameNodeRpcMessage { public static int CSIZE = FileInfo.CSIZE + 4; protected FileInfo fileInfo; protected boolean close; public SetFileReq(){ this.fileInfo = new FileInfo(); this.close = false; } public SetFileReq(FileInfo fileInfo, boolean close) { this.fileInfo = fileInfo; this.close = close; } public FileInfo getFileInfo() { return fileInfo; } public boolean isClose(){ return close; } public int size() { return CSIZE; } public short getType(){ return RpcProtocol.REQ_SET_FILE; } public int write(ByteBuffer buffer) { fileInfo.write(buffer, true); buffer.putInt(close ? 1 : 0); return CSIZE; } public void update(ByteBuffer buffer) { try { fileInfo.update(buffer); int tmp = buffer.getInt(); close = (tmp == 1) ? true : false; } catch (UnknownHostException e) { e.printStackTrace(); } } @Override public String toString() { return "SetFileReq [fileInfo=" + fileInfo + ", close=" + close + "]"; } } public static class RemoveFileReq implements RpcProtocol.NameNodeRpcMessage { public static int CSIZE = FileName.CSIZE + 4; protected FileName filename; protected boolean recursive; public RemoveFileReq(){ this.filename = new FileName(); this.recursive = false; } public RemoveFileReq(FileName filename, boolean recursive) { this.filename = filename; this.recursive = recursive; } public FileName getFileName() { return filename; } public boolean isRecursive(){ return recursive; } public int size() { return CSIZE; } public short getType(){ return RpcProtocol.REQ_REMOVE_FILE; } public int write(ByteBuffer buffer) { filename.write(buffer); buffer.putInt(recursive ? 1 : 0); return CSIZE; } public void update(ByteBuffer buffer) { filename.update(buffer); int tmp = buffer.getInt(); recursive = (tmp == 1) ? true : false; } } public static class RenameFileReq implements RpcProtocol.NameNodeRpcMessage { public static int CSIZE = FileName.CSIZE*2; protected FileName srcFileName; protected FileName dstFileName; public RenameFileReq(){ this.srcFileName = new FileName(); this.dstFileName = new FileName(); } public RenameFileReq(FileName srcFileName, FileName dstFileName) { this.srcFileName = srcFileName; this.dstFileName = dstFileName; } public FileName getSrcFileName() { return srcFileName; } public FileName getDstFileName() { return dstFileName; } public int size() { return CSIZE; } public short getType(){ return RpcProtocol.REQ_RENAME_FILE; } public int write(ByteBuffer buffer) { int written = srcFileName.write(buffer); written += dstFileName.write(buffer); return written; } public void update(ByteBuffer buffer) { srcFileName.update(buffer); dstFileName.update(buffer); } @Override public String toString() { return "RenameFileReq [srcFileName=" + srcFileName + ", dstFileName=" + dstFileName + "]"; } } public static class GetBlockReq implements RpcProtocol.NameNodeRpcMessage { public static int CSIZE = 32; protected long fd; protected long token; protected long position; protected long capacity; public GetBlockReq(){ this.fd = 0; this.token = 0; this.position = 0; this.capacity = 0; } public GetBlockReq(long fd, long token, long position, long capacity) { this.fd = fd; this.token = token; this.position = position; this.capacity = capacity; } public long getFd() { return fd; } public long getPosition(){ return this.position; } public long getToken() { return token; } public long getCapacity(){ return capacity; } public int size() { return CSIZE; } public short getType(){ return RpcProtocol.REQ_GET_BLOCK; } public int write(ByteBuffer buffer) { buffer.putLong(fd); buffer.putLong(token); buffer.putLong(position); buffer.putLong(capacity); return CSIZE; } public void update(ByteBuffer buffer) { fd = buffer.getLong(); token = buffer.getLong(); position = buffer.getLong(); capacity = buffer.getLong(); } @Override public String toString() { return "GetBlockReq [fd=" + fd + ", token=" + token + ", position=" + position + ", capacity=" + capacity + "]"; } public void setToken(long value) { this.token = value; } } public static class GetLocationReq implements RpcProtocol.NameNodeRpcMessage { public static int CSIZE = FileName.CSIZE + 8; protected FileName fileName; protected long position; public GetLocationReq(){ this.fileName = new FileName(); this.position = 0; } public GetLocationReq(FileName fileName, long position) { this.fileName = fileName; this.position = position; } public long getPosition(){ return this.position; } public FileName getFileName() { return fileName; } public int size() { return CSIZE; } public short getType(){ return RpcProtocol.REQ_GET_LOCATION; } public int write(ByteBuffer buffer) { fileName.write(buffer); buffer.putLong(position); return CSIZE; } public void update(ByteBuffer buffer) { fileName.update(buffer); position = buffer.getLong(); } } public static class SetBlockReq implements RpcProtocol.NameNodeRpcMessage { public static int CSIZE = BlockInfo.CSIZE; protected BlockInfo blockInfo; public SetBlockReq() { this.blockInfo = new BlockInfo(); } public SetBlockReq(BlockInfo blockInfo) { this.blockInfo = blockInfo; } public BlockInfo getBlockInfo() throws Exception { return blockInfo; } public int size() { return CSIZE; } public short getType(){ return RpcProtocol.REQ_SET_BLOCK; } public int write(ByteBuffer buffer){ int written = blockInfo.write(buffer); return written; } public void update(ByteBuffer buffer) { try { blockInfo.update(buffer); } catch (UnknownHostException e) { e.printStackTrace(); } } @Override public String toString() { return "SetBlockReq [blockInfo=" + blockInfo + "]"; } } public static class GetDataNodeReq implements RpcProtocol.NameNodeRpcMessage { public static int CSIZE = DataNodeInfo.CSIZE; protected DataNodeInfo dnInfo; public GetDataNodeReq(){ this.dnInfo = new DataNodeInfo(); } public GetDataNodeReq(DataNodeInfo dnInfo) { this.dnInfo = dnInfo; } public DataNodeInfo getInfo(){ return this.dnInfo; } public int size() { return CSIZE; } public short getType(){ return RpcProtocol.REQ_GET_DATANODE; } public int write(ByteBuffer buffer) { int written = dnInfo.write(buffer); return written; } public void update(ByteBuffer buffer) { try { dnInfo.update(buffer); } catch (UnknownHostException e) { e.printStackTrace(); } } } public static class DumpNameNodeReq implements RpcProtocol.NameNodeRpcMessage { public static int CSIZE = 4; protected int op; public DumpNameNodeReq(){ this.op = 0; } public int getOp() { return op; } public int size() { return CSIZE; } public short getType(){ return RpcProtocol.REQ_DUMP_NAMENODE; } public int write(ByteBuffer buffer) { buffer.putInt(op); return CSIZE; } public void update(ByteBuffer buffer) { op = buffer.getInt(); } } public static class PingNameNodeReq implements RpcProtocol.NameNodeRpcMessage { public static int CSIZE = 4; protected int op; public PingNameNodeReq(){ this.op = 0; } public int getOp(){ return this.op; } public int size() { return CSIZE; } public short getType(){ return RpcProtocol.REQ_PING_NAMENODE; } public int write(ByteBuffer buffer) { buffer.putInt(op); return CSIZE; } public void update(ByteBuffer buffer) { op = buffer.getInt(); } } }
3e05d45f1ad6ef9591a58bc0d4f1aff7d7d1fcc5
8,524
java
Java
services/console-proxy/rdpconsole/src/main/java/streamer/SocketWrapperImpl.java
aleskxyz/cloudstack
2700beb4fb1206f93829b8c4085479a8f416833d
[ "Apache-2.0" ]
1,131
2015-01-08T18:59:06.000Z
2022-03-29T11:31:10.000Z
services/console-proxy/rdpconsole/src/main/java/streamer/SocketWrapperImpl.java
aleskxyz/cloudstack
2700beb4fb1206f93829b8c4085479a8f416833d
[ "Apache-2.0" ]
5,908
2015-01-13T15:28:37.000Z
2022-03-31T20:31:07.000Z
services/console-proxy/rdpconsole/src/main/java/streamer/SocketWrapperImpl.java
Rostov1991/cloudstack
4abe8385e0721793d5dae8f195303d010c8ff8d2
[ "Apache-2.0" ]
1,083
2015-01-05T01:16:52.000Z
2022-03-31T12:14:10.000Z
32.410646
121
0.602417
2,447
// 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 streamer; import static streamer.debug.MockServer.Packet.PacketType.CLIENT; import static streamer.debug.MockServer.Packet.PacketType.SERVER; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.InetSocketAddress; import java.net.Socket; import java.util.HashMap; import javax.net.SocketFactory; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLSocket; import javax.net.ssl.SSLSocketFactory; import javax.net.ssl.TrustManager; import org.apache.log4j.Logger; import org.apache.cloudstack.utils.security.SSLUtils; import org.apache.cloudstack.utils.security.SecureSSLSocketFactory; import streamer.debug.MockServer; import streamer.debug.MockServer.Packet; import streamer.ssl.SSLState; import streamer.ssl.TrustAllX509TrustManager; public class SocketWrapperImpl extends PipelineImpl implements SocketWrapper { private static final Logger s_logger = Logger.getLogger(SocketWrapperImpl.class); protected InputStreamSource source; protected OutputStreamSink sink; protected Socket socket; protected InetSocketAddress address; protected SSLSocket sslSocket; protected SSLState sslState; public SocketWrapperImpl(String id, SSLState sslState) { super(id); this.sslState = sslState; } @Override protected HashMap<String, Element> initElementMap(String id) { HashMap<String, Element> map = new HashMap<String, Element>(); source = new InputStreamSource(id + "." + OUT, this); sink = new OutputStreamSink(id + "." + IN, this); // Pass requests to read data to socket input stream map.put(OUT, source); // All incoming data, which is sent to this socket wrapper, will be sent // to socket remote map.put(IN, sink); return map; } /** * Connect this socket wrapper to remote server and start main loop on * IputStreamSource stdout link, to watch for incoming data, and * OutputStreamSink stdin link, to pull for outgoing data. * * @param address * @throws IOException */ @Override public void connect(InetSocketAddress address) throws IOException { this.address = address; // Connect socket to server socket = SocketFactory.getDefault().createSocket(); try { socket.connect(address); InputStream is = socket.getInputStream(); source.setInputStream(is); OutputStream os = socket.getOutputStream(); sink.setOutputStream(os); // Start polling for data to send to remote sever runMainLoop(IN, STDIN, true, true); // Push incoming data from server to handlers runMainLoop(OUT, STDOUT, false, false); } finally { socket.close(); } } @Override public void handleEvent(Event event, Direction direction) { switch (event) { case SOCKET_UPGRADE_TO_SSL: upgradeToSsl(); break; default: super.handleEvent(event, direction); break; } } @Override public void upgradeToSsl() { if (sslSocket != null) // Already upgraded return; if (verbose) System.out.println("[" + this + "] INFO: Upgrading socket to SSL."); try { // Use most secure implementation of SSL available now. // JVM will try to negotiate TLS1.2, then will fallback to TLS1.0, if // TLS1.2 is not supported. SSLContext sslContext = SSLUtils.getSSLContext(); // Trust all certificates (FIXME: insecure) sslContext.init(null, new TrustManager[] {new TrustAllX509TrustManager(sslState)}, null); SSLSocketFactory sslSocketFactory = new SecureSSLSocketFactory(sslContext); sslSocket = (SSLSocket)sslSocketFactory.createSocket(socket, address.getHostName(), address.getPort(), true); sslSocket.setEnabledProtocols(SSLUtils.getSupportedProtocols(sslSocket.getEnabledProtocols())); sslSocket.startHandshake(); InputStream sis = sslSocket.getInputStream(); source.setInputStream(sis); OutputStream sos = sslSocket.getOutputStream(); sink.setOutputStream(sos); } catch (Exception e) { throw new RuntimeException("Cannot upgrade socket to SSL: " + e.getMessage(), e); } } @Override public void validate() { for (Element element : elements.values()) element.validate(); if (get(IN).getPads(Direction.IN).size() == 0) throw new RuntimeException("[ " + this + "] Input of socket is not connected."); if (get(OUT).getPads(Direction.OUT).size() == 0) throw new RuntimeException("[ " + this + "] Output of socket is not connected."); } @Override public void shutdown() { try { handleEvent(Event.STREAM_CLOSE, Direction.IN); } catch (Exception e) { s_logger.info("[ignored]" + "error sending input close event: " + e.getLocalizedMessage()); } try { handleEvent(Event.STREAM_CLOSE, Direction.OUT); } catch (Exception e) { s_logger.info("[ignored]" + "error sending output close event: " + e.getLocalizedMessage()); } try { if (sslSocket != null) sslSocket.close(); } catch (Exception e) { s_logger.info("[ignored]" + "error closing ssl socket: " + e.getLocalizedMessage()); } try { socket.close(); } catch (Exception e) { s_logger.info("[ignored]" + "error closing socket: " + e.getLocalizedMessage()); } } @Override public String toString() { return "SocketWrapper(" + id + ")"; } /** * Example. */ public static void main(String args[]) { try { System.setProperty("streamer.Link.debug", "true"); System.setProperty("streamer.Element.debug", "true"); System.setProperty("rdpclient.MockServer.debug", "true"); Pipeline pipeline = new PipelineImpl("echo client"); SocketWrapperImpl socketWrapper = new SocketWrapperImpl("socket", null); pipeline.add(socketWrapper); pipeline.add(new BaseElement("echo")); pipeline.add(new Queue("queue")); // To decouple input and output pipeline.link("socket", "echo", "queue", "socket"); final byte[] mockData = new byte[] {0x01, 0x02, 0x03}; MockServer server = new MockServer(new Packet[] {new Packet("Server hello") { { type = SERVER; data = mockData; } }, new Packet("Client hello") { { type = CLIENT; data = mockData; } }, new Packet("Server hello") { { type = SERVER; data = mockData; } }, new Packet("Client hello") { { type = CLIENT; data = mockData; } }}); server.start(); InetSocketAddress address = server.getAddress(); /*DEBUG*/System.out.println("Address: " + address); socketWrapper.connect(address); } catch (Exception e) { e.printStackTrace(System.err); } } }
3e05d4600e065cc91725e93bf4ad6432a65441fe
2,554
java
Java
src/test/java/com/inova8/resolver/tester/Tests.java
peterjohnlawrence/com.inova8.resolver
aba197d601021a6b0b555d389039b2271c05d54f
[ "Apache-2.0" ]
null
null
null
src/test/java/com/inova8/resolver/tester/Tests.java
peterjohnlawrence/com.inova8.resolver
aba197d601021a6b0b555d389039b2271c05d54f
[ "Apache-2.0" ]
null
null
null
src/test/java/com/inova8/resolver/tester/Tests.java
peterjohnlawrence/com.inova8.resolver
aba197d601021a6b0b555d389039b2271c05d54f
[ "Apache-2.0" ]
null
null
null
35.472222
82
0.738841
2,448
package com.inova8.resolver.tester; import static org.junit.Assert.*; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import org.junit.Test; import com.inova8.resolver.ResolverClass; public class Tests { @Test public void ammonia() throws IOException { ResolverClass Resolver = new ResolverClass(); String test = "src\\test\\resources\\"+ "Ammonia"; Resolver = IOUtils.ReadModel(Resolver, test); //Resolve(int MaximumTime, int Iterations, double Precision, double Convergence) Resolver.Resolve(1000, 100,.000001, 0.0001); IOUtils.WriteResults(Resolver, test); } @Test public void largeBilinear() throws IOException { ResolverClass Resolver = new ResolverClass(); String test = "src\\test\\resources\\"+ "LargeBilinear"; Resolver = IOUtils.ReadModel(Resolver, test); //Resolve(int MaximumTime, int Iterations, double Precision, double Convergence) Resolver.Resolve(1000, 100,.000001, 0.0001); IOUtils.WriteResults(Resolver, test); } @Test public void largeNL() throws IOException { ResolverClass Resolver = new ResolverClass(); String test = "src\\test\\resources\\"+ "LargeNL"; Resolver = IOUtils.ReadModel(Resolver, test); //Resolve(int MaximumTime, int Iterations, double Precision, double Convergence) Resolver.Resolve(1000, 100,.000001, 0.0001); IOUtils.WriteResults(Resolver, test); } @Test public void simpleLinear() throws IOException { ResolverClass Resolver = new ResolverClass(); String test = "src\\test\\resources\\"+ "SimpleLinear"; Resolver = IOUtils.ReadModel(Resolver, test); //Resolve(int MaximumTime, int Iterations, double Precision, double Convergence) Resolver.Resolve(1000, 100,.000001, 0.0001); IOUtils.WriteResults(Resolver, test); } @Test public void simpleVolume() throws IOException { ResolverClass Resolver = new ResolverClass(); String test = "src\\test\\resources\\"+ "SimpleVolume"; Resolver = IOUtils.ReadModel(Resolver, test); //Resolve(int MaximumTime, int Iterations, double Precision, double Convergence) Resolver.Resolve(1000, 100,.000001, 0.0001); IOUtils.WriteResults(Resolver, test); } @Test public void veryNL() throws IOException { ResolverClass Resolver = new ResolverClass(); String test = "src\\test\\resources\\"+ "VeryNL"; Resolver = IOUtils.ReadModel(Resolver, test); //Resolve(int MaximumTime, int Iterations, double Precision, double Convergence) Resolver.Resolve(1000, 100,.000001, 0.0001); IOUtils.WriteResults(Resolver, test); } }
3e05d52f5143ed62a3d26cb6ab66005445f1553c
10,284
java
Java
plugins/eeui/framework/android/src/main/java/app/eeui/framework/ui/component/blurView/element/BlockingBlurController.java
Fang-NB-Plus/eeui-template
0bb03fcf156db4043ba23891117caefdd71a4863
[ "MIT" ]
50
2019-06-12T03:46:17.000Z
2022-03-30T09:20:27.000Z
plugins/eeui/framework/android/src/main/java/app/eeui/framework/ui/component/blurView/element/BlockingBlurController.java
Fang-NB-Plus/eeui-template
0bb03fcf156db4043ba23891117caefdd71a4863
[ "MIT" ]
8
2019-07-12T02:17:21.000Z
2022-02-07T07:30:55.000Z
plugins/eeui/framework/android/src/main/java/app/eeui/framework/ui/component/blurView/element/BlockingBlurController.java
Fang-NB-Plus/eeui-template
0bb03fcf156db4043ba23891117caefdd71a4863
[ "MIT" ]
30
2019-06-28T17:07:57.000Z
2021-12-09T06:06:19.000Z
33.174194
114
0.665305
2,449
package app.eeui.framework.ui.component.blurView.element; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.drawable.Drawable; import android.os.Build; import android.view.View; import android.view.ViewGroup; import android.view.ViewTreeObserver; import androidx.annotation.ColorInt; import androidx.annotation.NonNull; import androidx.annotation.Nullable; /** * Blur Controller that handles all blur logic for the attached View. * It honors View size changes, View animation and Visibility changes. * <p> * The basic idea is to draw the view hierarchy on a bitmap, excluding the attached View, * then blur and draw it on the system Canvas. * <p> * It uses {@link ViewTreeObserver.OnPreDrawListener} to detect when * blur should be updated. * <p> * Blur is done on the main thread. */ final class BlockingBlurController implements BlurController { // Bitmap size should be divisible by ROUNDING_VALUE to meet stride requirement. // This will help avoiding an extra bitmap allocation when passing the bitmap to RenderScript for blur. // Usually it's 16, but on Samsung devices it's 64 for some reason. private static final int ROUNDING_VALUE = 64; @ColorInt static final int TRANSPARENT = 0; private final float scaleFactor = DEFAULT_SCALE_FACTOR; private float blurRadius = DEFAULT_BLUR_RADIUS; private float roundingWidthScaleFactor = 1f; private float roundingHeightScaleFactor = 1f; private BlurAlgorithm blurAlgorithm; private Canvas internalCanvas; private Bitmap internalBitmap; @SuppressWarnings("WeakerAccess") final View blurView; private int overlayColor; private final ViewGroup rootView; private final int[] rootLocation = new int[2]; private final int[] blurViewLocation = new int[2]; private final ViewTreeObserver.OnPreDrawListener drawListener = new ViewTreeObserver.OnPreDrawListener() { @Override public boolean onPreDraw() { // Not invalidating a View here, just updating the Bitmap. // This relies on the HW accelerated bitmap drawing behavior in Android // If the bitmap was drawn on HW accelerated canvas, it holds a reference to it and on next // drawing pass the updated content of the bitmap will be rendered on the screen updateBlur(); return true; } }; private boolean blurEnabled = true; private boolean initialized; @Nullable private Drawable frameClearDrawable; private boolean hasFixedTransformationMatrix; private final Paint paint = new Paint(Paint.FILTER_BITMAP_FLAG); /** * @param blurView View which will draw it's blurred underlying content * @param rootView Root View where blurView's underlying content starts drawing. * Can be Activity's root content layout (android.R.id.content) * or some of your custom root layouts. */ BlockingBlurController(@NonNull View blurView, @NonNull ViewGroup rootView, @ColorInt int overlayColor) { this.rootView = rootView; this.blurView = blurView; this.overlayColor = overlayColor; this.blurAlgorithm = new NoOpBlurAlgorithm(); int measuredWidth = blurView.getMeasuredWidth(); int measuredHeight = blurView.getMeasuredHeight(); if (isZeroSized(measuredWidth, measuredHeight)) { deferBitmapCreation(); return; } init(measuredWidth, measuredHeight); } private int downScaleSize(float value) { return (int) Math.ceil(value / scaleFactor); } /** * Rounds a value to the nearest divisible by {@link #ROUNDING_VALUE} to meet stride requirement */ private int roundSize(int value) { if (value % ROUNDING_VALUE == 0) { return value; } return value - (value % ROUNDING_VALUE) + ROUNDING_VALUE; } @SuppressWarnings("WeakerAccess") void init(int measuredWidth, int measuredHeight) { if (isZeroSized(measuredWidth, measuredHeight)) { blurView.setWillNotDraw(true); return; } blurView.setWillNotDraw(false); allocateBitmap(measuredWidth, measuredHeight); internalCanvas = new Canvas(internalBitmap); initialized = true; if (hasFixedTransformationMatrix) { setupInternalCanvasMatrix(); } } private boolean isZeroSized(int measuredWidth, int measuredHeight) { return downScaleSize(measuredHeight) == 0 || downScaleSize(measuredWidth) == 0; } @SuppressWarnings("WeakerAccess") void updateBlur() { if (!blurEnabled || !initialized) { return; } if (frameClearDrawable == null) { internalBitmap.eraseColor(Color.TRANSPARENT); } else { frameClearDrawable.draw(internalCanvas); } if (hasFixedTransformationMatrix) { rootView.draw(internalCanvas); } else { internalCanvas.save(); setupInternalCanvasMatrix(); rootView.draw(internalCanvas); internalCanvas.restore(); } blurAndSave(); } /** * Deferring initialization until view is laid out */ private void deferBitmapCreation() { blurView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { @Override public void onGlobalLayout() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { blurView.getViewTreeObserver().removeOnGlobalLayoutListener(this); } else { legacyRemoveOnGlobalLayoutListener(); } int measuredWidth = blurView.getMeasuredWidth(); int measuredHeight = blurView.getMeasuredHeight(); init(measuredWidth, measuredHeight); } @SuppressWarnings("deprecation") void legacyRemoveOnGlobalLayoutListener() { blurView.getViewTreeObserver().removeGlobalOnLayoutListener(this); } }); } private void allocateBitmap(int measuredWidth, int measuredHeight) { int nonRoundedScaledWidth = downScaleSize(measuredWidth); int nonRoundedScaledHeight = downScaleSize(measuredHeight); int scaledWidth = roundSize(nonRoundedScaledWidth); int scaledHeight = roundSize(nonRoundedScaledHeight); roundingHeightScaleFactor = (float) nonRoundedScaledHeight / scaledHeight; roundingWidthScaleFactor = (float) nonRoundedScaledWidth / scaledWidth; internalBitmap = Bitmap.createBitmap(scaledWidth, scaledHeight, blurAlgorithm.getSupportedBitmapConfig()); } /** * Set up matrix to draw starting from blurView's position */ private void setupInternalCanvasMatrix() { rootView.getLocationOnScreen(rootLocation); blurView.getLocationOnScreen(blurViewLocation); int left = blurViewLocation[0] - rootLocation[0]; int top = blurViewLocation[1] - rootLocation[1]; float scaleFactorX = scaleFactor * roundingWidthScaleFactor; float scaleFactorY = scaleFactor * roundingHeightScaleFactor; float scaledLeftPosition = -left / scaleFactorX; float scaledTopPosition = -top / scaleFactorY; internalCanvas.translate(scaledLeftPosition, scaledTopPosition); internalCanvas.scale(1 / scaleFactorX, 1 / scaleFactorY); } @Override public boolean draw(Canvas canvas) { if (!blurEnabled || !initialized) { return true; } // Not blurring own children if (canvas == internalCanvas) { return false; } updateBlur(); canvas.save(); canvas.scale(scaleFactor * roundingWidthScaleFactor, scaleFactor * roundingHeightScaleFactor); canvas.drawBitmap(internalBitmap, 0, 0, paint); canvas.restore(); if (overlayColor != TRANSPARENT) { canvas.drawColor(overlayColor); } return true; } private void blurAndSave() { internalBitmap = blurAlgorithm.blur(internalBitmap, blurRadius); if (!blurAlgorithm.canModifyBitmap()) { internalCanvas.setBitmap(internalBitmap); } } @Override public void updateBlurViewSize() { int measuredWidth = blurView.getMeasuredWidth(); int measuredHeight = blurView.getMeasuredHeight(); init(measuredWidth, measuredHeight); } @Override public void destroy() { setBlurAutoUpdate(false); blurAlgorithm.destroy(); initialized = false; } @Override public BlurViewFacade setBlurRadius(float radius) { this.blurRadius = radius; return this; } @Override public BlurViewFacade setBlurAlgorithm(BlurAlgorithm algorithm) { this.blurAlgorithm = algorithm; return this; } @Override public BlurViewFacade setFrameClearDrawable(@Nullable Drawable frameClearDrawable) { this.frameClearDrawable = frameClearDrawable; return this; } @Override public BlurViewFacade setBlurEnabled(boolean enabled) { this.blurEnabled = enabled; setBlurAutoUpdate(enabled); blurView.invalidate(); return this; } public BlurViewFacade setBlurAutoUpdate(final boolean enabled) { blurView.getViewTreeObserver().removeOnPreDrawListener(drawListener); if (enabled) { blurView.getViewTreeObserver().addOnPreDrawListener(drawListener); } return this; } @Override public BlurViewFacade setHasFixedTransformationMatrix(boolean hasFixedTransformationMatrix) { this.hasFixedTransformationMatrix = hasFixedTransformationMatrix; return this; } @Override public BlurViewFacade setOverlayColor(int overlayColor) { if (this.overlayColor != overlayColor) { this.overlayColor = overlayColor; blurView.invalidate(); } return this; } }
3e05d54f39a8d38b22fd8e7d84df19f99bfd0002
2,491
java
Java
src/functionalTest/java/uk/gov/hmcts/reform/et/syaapi/BaseFunctionalTest.java
hmcts/et-sya-api
0b0a7f1efa1f286290304d152bc17ddcc42c4e47
[ "MIT" ]
null
null
null
src/functionalTest/java/uk/gov/hmcts/reform/et/syaapi/BaseFunctionalTest.java
hmcts/et-sya-api
0b0a7f1efa1f286290304d152bc17ddcc42c4e47
[ "MIT" ]
21
2021-12-20T11:20:50.000Z
2022-03-29T08:14:38.000Z
src/functionalTest/java/uk/gov/hmcts/reform/et/syaapi/BaseFunctionalTest.java
hmcts/et-sya-api
0b0a7f1efa1f286290304d152bc17ddcc42c4e47
[ "MIT" ]
null
null
null
37.742424
91
0.767965
2,450
package uk.gov.hmcts.reform.et.syaapi; import lombok.extern.slf4j.Slf4j; import org.apache.http.conn.ssl.NoopHostnameVerifier; import org.apache.http.conn.ssl.SSLConnectionSocketFactory; import org.apache.http.conn.ssl.TrustSelfSignedStrategy; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.ssl.SSLContextBuilder; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.TestInstance; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; import java.security.KeyManagementException; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; import static io.restassured.RestAssured.baseURI; import static io.restassured.RestAssured.useRelaxedHTTPSValidation; @RunWith(SpringRunner.class) @SpringBootTest(classes = {SyaApiApplication.class}) @Slf4j @TestInstance(TestInstance.Lifecycle.PER_CLASS) public class BaseFunctionalTest { protected String userToken; protected CloseableHttpClient client; protected IdamTestApiRequests idamTestApiRequests; @Value("${sya.api.test.url}") protected String baseUrl; @Value("${idam.url}") private String idamApiUrl; @BeforeAll public void setup() throws Exception { client = buildClient(); idamTestApiRequests = new IdamTestApiRequests(client, idamApiUrl); CreateUser user = idamTestApiRequests.createUser(createRandomEmail()); userToken = idamTestApiRequests.getAccessToken(user.getEmail()); baseURI = baseUrl; useRelaxedHTTPSValidation(); } private String createRandomEmail() { int randomNumber = (int) (Math.random() * 10_000_000); return "test" + randomNumber + "@hmcts.net"; } private CloseableHttpClient buildClient() throws KeyStoreException, NoSuchAlgorithmException, KeyManagementException { SSLContextBuilder builder = new SSLContextBuilder(); builder.loadTrustMaterial(null, new TrustSelfSignedStrategy()); SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(builder.build(), NoopHostnameVerifier.INSTANCE); HttpClientBuilder httpClientBuilder = HttpClientBuilder.create() .setSSLSocketFactory(sslsf); return httpClientBuilder.build(); } }
3e05d55fc7ee7ed5edd5d16160a9ba02f8c72de4
1,251
java
Java
src/main/java/ir/fassih/workshopautomation/rest/RawMaterialService.java
MrFassih/workshop-automation
e7f75b85935021ec8251b059c74c521ae8a1eeda
[ "MIT" ]
null
null
null
src/main/java/ir/fassih/workshopautomation/rest/RawMaterialService.java
MrFassih/workshop-automation
e7f75b85935021ec8251b059c74c521ae8a1eeda
[ "MIT" ]
1
2018-08-07T08:37:50.000Z
2018-08-07T08:37:50.000Z
src/main/java/ir/fassih/workshopautomation/rest/RawMaterialService.java
MrFassih/workshop-automation
e7f75b85935021ec8251b059c74c521ae8a1eeda
[ "MIT" ]
null
null
null
33.810811
92
0.790568
2,451
package ir.fassih.workshopautomation.rest; import ir.fassih.workshopautomation.entity.rawmaterial.RawMaterialEntity; import ir.fassih.workshopautomation.manager.AbstractManager; import ir.fassih.workshopautomation.manager.RawMaterialCategoryManager; import ir.fassih.workshopautomation.manager.RawMaterialManager; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.annotation.Secured; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.Map; @Secured("ADMIN") @RestController @RequestMapping("/rest/rawMaterial") public class RawMaterialService extends AbstractRestService<RawMaterialEntity, Long> { private RawMaterialManager getMyManager() { return (RawMaterialManager) manager; } @Autowired public RawMaterialService(RawMaterialManager manager) { super(manager); } @Override protected Map<Class<? extends AbstractManager>, String> getOptionsMetadata() { Map<Class<? extends AbstractManager>, String> metadata = super.getOptionsMetadata(); metadata.put(RawMaterialCategoryManager.class, "categories"); return metadata; } }
3e05d5694cc5296aa85b6f7bf9a1a5b776ac30a8
204
java
Java
src/test/java/org/concordion/testsuite/failureIndex/FailureIndex.java
nigelcharman/concordion-run-examples
f71e372dbdcb27c54892563c02d28d756eb3924f
[ "Apache-2.0" ]
null
null
null
src/test/java/org/concordion/testsuite/failureIndex/FailureIndex.java
nigelcharman/concordion-run-examples
f71e372dbdcb27c54892563c02d28d756eb3924f
[ "Apache-2.0" ]
null
null
null
src/test/java/org/concordion/testsuite/failureIndex/FailureIndex.java
nigelcharman/concordion-run-examples
f71e372dbdcb27c54892563c02d28d756eb3924f
[ "Apache-2.0" ]
null
null
null
22.666667
58
0.838235
2,452
package org.concordion.testsuite.failureIndex; import org.concordion.integration.junit4.ConcordionRunner; import org.junit.runner.RunWith; @RunWith(ConcordionRunner.class) public class FailureIndex { }
3e05d569f2f2361776279b0a9a3132e6d0f41ee2
4,960
java
Java
aws-java-sdk-kinesis/src/main/java/com/amazonaws/services/kinesisfirehose/model/transform/CreateDeliveryStreamRequestMarshaller.java
johndemic/aws-sdk-java
784c5c058be640c5929da0d685e3f12d7b1669b7
[ "Apache-2.0" ]
null
null
null
aws-java-sdk-kinesis/src/main/java/com/amazonaws/services/kinesisfirehose/model/transform/CreateDeliveryStreamRequestMarshaller.java
johndemic/aws-sdk-java
784c5c058be640c5929da0d685e3f12d7b1669b7
[ "Apache-2.0" ]
null
null
null
aws-java-sdk-kinesis/src/main/java/com/amazonaws/services/kinesisfirehose/model/transform/CreateDeliveryStreamRequestMarshaller.java
johndemic/aws-sdk-java
784c5c058be640c5929da0d685e3f12d7b1669b7
[ "Apache-2.0" ]
null
null
null
40
103
0.633871
2,453
/* * Copyright 2011-2016 Amazon.com, Inc. or its affiliates. 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. A copy of the License is * located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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.amazonaws.services.kinesisfirehose.model.transform; import java.io.ByteArrayInputStream; import java.util.Collections; import java.util.Map; import java.util.List; import java.util.regex.Pattern; import com.amazonaws.AmazonClientException; import com.amazonaws.Request; import com.amazonaws.DefaultRequest; import com.amazonaws.http.HttpMethodName; import com.amazonaws.services.kinesisfirehose.model.*; import com.amazonaws.transform.Marshaller; import com.amazonaws.util.BinaryUtils; import com.amazonaws.util.StringUtils; import com.amazonaws.util.IdempotentUtils; import com.amazonaws.util.StringInputStream; import com.amazonaws.protocol.json.*; /** * CreateDeliveryStreamRequest Marshaller */ public class CreateDeliveryStreamRequestMarshaller implements Marshaller<Request<CreateDeliveryStreamRequest>, CreateDeliveryStreamRequest> { private final SdkJsonProtocolFactory protocolFactory; public CreateDeliveryStreamRequestMarshaller( SdkJsonProtocolFactory protocolFactory) { this.protocolFactory = protocolFactory; } public Request<CreateDeliveryStreamRequest> marshall( CreateDeliveryStreamRequest createDeliveryStreamRequest) { if (createDeliveryStreamRequest == null) { throw new AmazonClientException( "Invalid argument passed to marshall(...)"); } Request<CreateDeliveryStreamRequest> request = new DefaultRequest<CreateDeliveryStreamRequest>( createDeliveryStreamRequest, "AmazonKinesisFirehose"); request.addHeader("X-Amz-Target", "Firehose_20150804.CreateDeliveryStream"); request.setHttpMethod(HttpMethodName.POST); request.setResourcePath(""); try { final StructuredJsonGenerator jsonGenerator = protocolFactory .createGenerator(); jsonGenerator.writeStartObject(); if (createDeliveryStreamRequest.getDeliveryStreamName() != null) { jsonGenerator.writeFieldName("DeliveryStreamName").writeValue( createDeliveryStreamRequest.getDeliveryStreamName()); } if (createDeliveryStreamRequest.getS3DestinationConfiguration() != null) { jsonGenerator.writeFieldName("S3DestinationConfiguration"); S3DestinationConfigurationJsonMarshaller .getInstance() .marshall( createDeliveryStreamRequest .getS3DestinationConfiguration(), jsonGenerator); } if (createDeliveryStreamRequest .getRedshiftDestinationConfiguration() != null) { jsonGenerator .writeFieldName("RedshiftDestinationConfiguration"); RedshiftDestinationConfigurationJsonMarshaller .getInstance() .marshall( createDeliveryStreamRequest .getRedshiftDestinationConfiguration(), jsonGenerator); } if (createDeliveryStreamRequest .getElasticsearchDestinationConfiguration() != null) { jsonGenerator .writeFieldName("ElasticsearchDestinationConfiguration"); ElasticsearchDestinationConfigurationJsonMarshaller .getInstance() .marshall( createDeliveryStreamRequest .getElasticsearchDestinationConfiguration(), jsonGenerator); } jsonGenerator.writeEndObject(); byte[] content = jsonGenerator.getBytes(); request.setContent(new ByteArrayInputStream(content)); request.addHeader("Content-Length", Integer.toString(content.length)); request.addHeader("Content-Type", protocolFactory.getContentType()); } catch (Throwable t) { throw new AmazonClientException( "Unable to marshall request to JSON: " + t.getMessage(), t); } return request; } }
3e05d5d3732c10c8ee6d4eff23336a926b48763a
112
java
Java
src/main/java/org/springframework/samples/petclinic/model/Estado.java
gii-is-psg2/PSG2-2021-G1-15
7e780a4c04b398bdeaf6adca733283ab36e0079e
[ "Apache-2.0" ]
null
null
null
src/main/java/org/springframework/samples/petclinic/model/Estado.java
gii-is-psg2/PSG2-2021-G1-15
7e780a4c04b398bdeaf6adca733283ab36e0079e
[ "Apache-2.0" ]
141
2021-04-09T07:18:41.000Z
2021-05-28T15:58:11.000Z
src/main/java/org/springframework/samples/petclinic/model/Estado.java
gii-is-psg2/PSG2-2021-G1-15
7e780a4c04b398bdeaf6adca733283ab36e0079e
[ "Apache-2.0" ]
null
null
null
18.666667
52
0.785714
2,454
package org.springframework.samples.petclinic.model; public enum Estado { Pendiente, Aceptada, Rechazada }
3e05d61a5f3d394aecc768d2a4c4d766729d4dd8
4,877
java
Java
propertiesutils-swingproperties/src/main/java/com/anrisoftware/propertiesutils/AwtContextProperties.java
devent/propertiesutils
d30908cbc36c357c572e8e522470a8c0fd15bad9
[ "Apache-2.0" ]
null
null
null
propertiesutils-swingproperties/src/main/java/com/anrisoftware/propertiesutils/AwtContextProperties.java
devent/propertiesutils
d30908cbc36c357c572e8e522470a8c0fd15bad9
[ "Apache-2.0" ]
null
null
null
propertiesutils-swingproperties/src/main/java/com/anrisoftware/propertiesutils/AwtContextProperties.java
devent/propertiesutils
d30908cbc36c357c572e8e522470a8c0fd15bad9
[ "Apache-2.0" ]
null
null
null
28.312139
77
0.658432
2,455
/* * Copyright 2012-2021 Erwin Müller <[email protected]> * * 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.anrisoftware.propertiesutils; import java.awt.Color; import java.awt.geom.Point2D; import java.text.ParseException; import java.util.Properties; import com.anrisoftware.globalpom.format.point.PointFormat; /** * Properties with a specified context returning AWT properties. * * <ul> * <li>{@link Color}</li> * <li>{@link Point2D}</li> * </ul> * * @author Erwin Mueller, [email protected] * @since 1.7 */ @SuppressWarnings("serial") public class AwtContextProperties extends ContextProperties { /** * Sets the context and the properties. * * @param context * an {@link Object} that is used as the context. * * @param parentProperties * the {@link Properties} that are returned. */ public AwtContextProperties(Class<?> context, Properties parentProperties) { super(context, parentProperties); } /** * Sets the context and the properties. * * @param context * an {@link Object} that is used as the context. * * @param parentProperties * the {@link Properties} that are returned. */ public AwtContextProperties(Object context, Properties parentProperties) { super(context, parentProperties); } /** * Sets the context and the properties. * * @param context * the context. * * @param parentProperties * the {@link Properties} that are returned. */ public AwtContextProperties(String context, Properties parentProperties) { super(context, parentProperties); } /** * Returns a color property using the format defined in * {@link Color#decode(String)}. * * @param key * the property key. * * @return the {@link Color} from the property or {@code null} if no * property with the key was found. */ public Color getColorProperty(String key) { String property = getProperty(key); return Color.decode(property); } /** * Returns a color property using the format defined in * {@link Color#decode(String)}. * * @param key * the property key. * * @param defaultValue * the default {@link Color}. * * @return the {@link Color} from the property or the default color if no * property with the key was found. */ public Color getColorProperty(String key, Color defaultValue) { String property = getProperty(key); return property == null ? null : Color.decode(property); } /** * Returns a point property using the format: {@code (x, y)}. The * parenthesis are optional. * * @param key * the property key. * * @return the {@link Point2D} from the property or {@code null} if no * property with the key was found. * * @throws ParseException * if the property cannot be parsed to a point. */ public Point2D getPointProperty(String key) throws ParseException { return getTypedProperty(key, new PointFormat()); } /** * Returns a point property using the format: {@code (x, y)}. The * parenthesis are optional. * * @param key * the property key. * * @param point * the {@link Point2D} that should be parsed. If {@code null} a * {@link Point2D#Double} is used. * * @return the {@link Point2D} from the property or {@code null} if no * property with the key was found. * * @throws ParseException * if the property cannot be parsed to a point. */ public Point2D getPointProperty(String key, Point2D point) throws ParseException { String property = getProperty(key); return new PointFormat().parse(property, point); } /** * Returns a point property using the format: {@code (x, y)}. The * parenthesis are optional. * * @param key * the property key. * * @param defaultValue * the default {@link Point2D}. * * @throws ParseException * if the property cannot be parsed to a point. * * @return the {@link Point2D} from the property or the default point if no * property with the key was found. */ public Point2D getPointPropertyWithDefault(String key, Point2D defaultValue) throws ParseException { return getTypedProperty(key, new PointFormat(), defaultValue); } }
3e05d69de813f4d5c5da92ba9f8b02df107e12c0
1,457
java
Java
app/src/main/java/com/techco/igotrip/ui/adapter/JourneyAdapter.java
nhat292/android-mvp
5b36fe59c7b841b8001500266f7384c08ec01e18
[ "Apache-2.0" ]
null
null
null
app/src/main/java/com/techco/igotrip/ui/adapter/JourneyAdapter.java
nhat292/android-mvp
5b36fe59c7b841b8001500266f7384c08ec01e18
[ "Apache-2.0" ]
null
null
null
app/src/main/java/com/techco/igotrip/ui/adapter/JourneyAdapter.java
nhat292/android-mvp
5b36fe59c7b841b8001500266f7384c08ec01e18
[ "Apache-2.0" ]
null
null
null
31
115
0.736445
2,456
package com.techco.igotrip.ui.adapter; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.techco.igotrip.R; import com.techco.igotrip.data.network.model.object.Journey; import com.techco.igotrip.ui.viewholder.JourneyViewHolder; import java.util.List; /** * Created by Nhat on 12/15/17. */ public class JourneyAdapter extends RecyclerView.Adapter<JourneyViewHolder> { private List<Journey> journeys; private OnItemClickListener listener; public JourneyAdapter(List<Journey> journeys, OnItemClickListener listener) { this.journeys = journeys; this.listener = listener; } @Override public JourneyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.my_trip_item, null); RecyclerView.LayoutParams layoutParams = new RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, (int) parent.getContext().getResources().getDimension(R.dimen.my_trip_item_height)); view.setLayoutParams(layoutParams); return new JourneyViewHolder(view); } @Override public void onBindViewHolder(JourneyViewHolder holder, int position) { holder.bind(journeys, position, listener, this); } @Override public int getItemCount() { return journeys.size(); } }
3e05d6dca8620d0ad31244af5b297d72ee19225e
2,989
java
Java
app/src/main/java/com/moxi/agenttool/ui/bean/CollectionHoseBean.java
subenli115/AgentTool
63ef76b0ce390331d7cdb863a6391920bc682fb9
[ "Apache-2.0" ]
null
null
null
app/src/main/java/com/moxi/agenttool/ui/bean/CollectionHoseBean.java
subenli115/AgentTool
63ef76b0ce390331d7cdb863a6391920bc682fb9
[ "Apache-2.0" ]
null
null
null
app/src/main/java/com/moxi/agenttool/ui/bean/CollectionHoseBean.java
subenli115/AgentTool
63ef76b0ce390331d7cdb863a6391920bc682fb9
[ "Apache-2.0" ]
null
null
null
21.817518
58
0.508866
2,457
package com.moxi.agenttool.ui.bean; import java.util.List; /** * @ClassName: CollectionHoseBean * @Description: 收藏房源实体 * @Author: join_lu * @CreateDate: 2021/7/28 14:14 */ public class CollectionHoseBean { private String code; private String msg; private DataDTO data; public String getCode() { return code; } public void setCode(String code) { this.code = code; } public String getMsg() { return msg; } public void setMsg(String msg) { this.msg = msg; } public DataDTO getData() { return data; } public void setData(DataDTO data) { this.data = data; } public static class DataDTO { private String pageNum; private String pageSize; private String total; private List<ListDTO> list; public String getPageNum() { return pageNum; } public void setPageNum(String pageNum) { this.pageNum = pageNum; } public String getPageSize() { return pageSize; } public void setPageSize(String pageSize) { this.pageSize = pageSize; } public String getTotal() { return total; } public void setTotal(String total) { this.total = total; } public List<ListDTO> getList() { return list; } public void setList(List<ListDTO> list) { this.list = list; } public static class ListDTO { private String id; private String clientId; private String detailUrl; private String detail; private String updateTime; private String createTime; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getClientId() { return clientId; } public void setClientId(String clientId) { this.clientId = clientId; } public String getDetailUrl() { return detailUrl; } public void setDetailUrl(String detailUrl) { this.detailUrl = detailUrl; } public String getDetail() { return detail; } public void setDetail(String detail) { this.detail = detail; } public String getUpdateTime() { return updateTime; } public void setUpdateTime(String updateTime) { this.updateTime = updateTime; } public String getCreateTime() { return createTime; } public void setCreateTime(String createTime) { this.createTime = createTime; } } } }
3e05d6ea3d99fd8acabdaa4f627fd4ddbf5576b8
4,021
java
Java
elide-core/src/main/java/com/yahoo/elide/resources/JsonApiEndpoint.java
DanyBv/elide
680606834ce4058c0af5aabb78ce6f09583b35e3
[ "Apache-2.0" ]
null
null
null
elide-core/src/main/java/com/yahoo/elide/resources/JsonApiEndpoint.java
DanyBv/elide
680606834ce4058c0af5aabb78ce6f09583b35e3
[ "Apache-2.0" ]
null
null
null
elide-core/src/main/java/com/yahoo/elide/resources/JsonApiEndpoint.java
DanyBv/elide
680606834ce4058c0af5aabb78ce6f09583b35e3
[ "Apache-2.0" ]
null
null
null
30.233083
110
0.686148
2,458
/* * Copyright 2019, Yahoo Inc. * Licensed under the Apache License, Version 2.0 * See LICENSE file in project root for terms. */ package com.yahoo.elide.resources; import static com.yahoo.elide.Elide.JSONAPI_CONTENT_TYPE; import com.yahoo.elide.Elide; import com.yahoo.elide.ElideResponse; import com.yahoo.elide.annotation.PATCH; import java.util.function.Function; import javax.inject.Inject; import javax.inject.Named; import javax.inject.Singleton; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; import javax.ws.rs.GET; import javax.ws.rs.HeaderParam; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.Context; import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; import javax.ws.rs.core.UriInfo; /** * Default endpoint/servlet for using Elide and JSONAPI. */ @Singleton @Produces(JSONAPI_CONTENT_TYPE) @Path("/") public class JsonApiEndpoint { protected final Elide elide; protected final Function<SecurityContext, Object> getUser; public static final DefaultOpaqueUserFunction DEFAULT_GET_USER = securityContext -> securityContext; @Inject public JsonApiEndpoint( @Named("elide") Elide elide, @Named("elideUserExtractionFunction") DefaultOpaqueUserFunction getUser) { this.elide = elide; this.getUser = getUser == null ? DEFAULT_GET_USER : getUser; } /** * Create handler. * * @param path request path * @param securityContext security context * @param jsonapiDocument post data as jsonapi document * @return response */ @POST @Path("{path:.*}") @Consumes(JSONAPI_CONTENT_TYPE) public Response post( @PathParam("path") String path, @Context SecurityContext securityContext, String jsonapiDocument) { return build(elide.post(path, jsonapiDocument, getUser.apply(securityContext))); } /** * Read handler. * * @param path request path * @param uriInfo URI info * @param securityContext security context * @return response */ @GET @Path("{path:.*}") public Response get( @PathParam("path") String path, @Context UriInfo uriInfo, @Context SecurityContext securityContext) { MultivaluedMap<String, String> queryParams = uriInfo.getQueryParameters(); return build(elide.get(path, queryParams, getUser.apply(securityContext))); } /** * Update handler. * * @param contentType document MIME type * @param accept response MIME type * @param path request path * @param securityContext security context * @param jsonapiDocument patch data as jsonapi document * @return response */ @PATCH @Path("{path:.*}") @Consumes(JSONAPI_CONTENT_TYPE) public Response patch( @HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept, @PathParam("path") String path, @Context SecurityContext securityContext, String jsonapiDocument) { return build(elide.patch(contentType, accept, path, jsonapiDocument, getUser.apply(securityContext))); } /** * Delete relationship handler (expects body with resource ids and types). * * @param path request path * @param securityContext security context * @param jsonApiDocument DELETE document * @return response */ @DELETE @Path("{path:.*}") @Consumes(JSONAPI_CONTENT_TYPE) public Response delete( @PathParam("path") String path, @Context SecurityContext securityContext, String jsonApiDocument) { return build(elide.delete(path, jsonApiDocument, getUser.apply(securityContext))); } private static Response build(ElideResponse response) { return Response.status(response.getResponseCode()).entity(response.getBody()).build(); } }
3e05d8a3b66859e81a3aacc56de3b9fddbdc8869
5,148
java
Java
org.python/src/org/python/antlr/ast/Bytes.java
isaiah/jy3k
0dea5518a698bf4167e80f84d2e5936ba4dda67e
[ "CNRI-Jython" ]
2
2021-02-26T06:41:02.000Z
2021-03-08T23:16:02.000Z
org.python/src/org/python/antlr/ast/Bytes.java
isaiah/jy3k
0dea5518a698bf4167e80f84d2e5936ba4dda67e
[ "CNRI-Jython" ]
null
null
null
org.python/src/org/python/antlr/ast/Bytes.java
isaiah/jy3k
0dea5518a698bf4167e80f84d2e5936ba4dda67e
[ "CNRI-Jython" ]
null
null
null
26.13198
96
0.641997
2,459
// Autogenerated AST node package org.python.antlr.ast; import org.antlr.v4.runtime.CommonToken; import org.antlr.v4.runtime.Token; import org.antlr.v4.runtime.tree.TerminalNode; import org.python.antlr.AST; import org.python.antlr.ast.VisitorIF; import org.python.antlr.PythonTree; import org.python.antlr.adapter.AstAdapters; import org.python.antlr.base.excepthandler; import org.python.antlr.base.expr; import org.python.antlr.base.mod; import org.python.antlr.base.slice; import org.python.antlr.base.stmt; import org.python.core.ArgParser; import org.python.core.Py; import org.python.core.PyObject; import org.python.core.PyUnicode; import org.python.core.PyTuple; import org.python.core.PyStringMap; import org.python.core.PyLong; import org.python.core.PyType; import org.python.core.PyList; import org.python.parser.Node; import org.python.core.PyNewWrapper; import org.python.core.Visitproc; import org.python.annotations.ExposedGet; import org.python.annotations.ExposedMethod; import org.python.annotations.ExposedNew; import org.python.annotations.ExposedSet; import org.python.annotations.ExposedType; import org.python.annotations.ExposedSlot; import org.python.annotations.SlotFunc; import java.util.Objects; import java.io.DataOutputStream; import java.io.IOException; import java.util.ArrayList; @ExposedType(name = "_ast.Bytes", base = expr.class) public class Bytes extends expr { public static final PyType TYPE = PyType.fromClass(Bytes.class); private String s; public String getInternalS() { return s; } public void setInternalS(String s) { this.s = s; } @ExposedGet(name = "s") public PyObject getS() { return AstAdapters.bytes2py(s); } @ExposedSet(name = "s") public void setS(PyObject s) { this.s = AstAdapters.py2bytes(s); } private final static PyUnicode[] fields = new PyUnicode[] {new PyUnicode("s")}; @ExposedGet(name = "_fields") public PyObject get_fields() { return new PyTuple(fields); } private final static PyUnicode[] attributes = new PyUnicode[] {new PyUnicode("lineno"), new PyUnicode("col_offset")}; @ExposedGet(name = "_attributes") public PyObject get_attributes() { return new PyTuple(attributes); } public Bytes() { super(TYPE); } @ExposedNew @ExposedSlot(SlotFunc.NEW) public static PyObject Bytes_new(PyNewWrapper _new, boolean init, PyType subtype, PyObject[] args, String[] keywords) { return new Bytes(subtype); } @ExposedMethod(names={"__init__"}) public void Bytes___init__(PyObject[] args, String[] keywords) { ArgParser ap = new ArgParser("Bytes", args, keywords, new String[] {"s", "lineno", "col_offset"}, 1, true); setS(ap.getPyObject(0, Py.None)); PyObject lin = ap.getOptionalArg(1); if (lin != null) { lineno = lin; } PyObject col = ap.getOptionalArg(2); if (col != null) { col_offset = col; } } public Bytes(PyObject s) { super(TYPE); setS(s); } // called from derived class public Bytes(PyType subtype) { super(subtype); } public Bytes(Node token, String s) { super(TYPE, token); this.s = s; } public Bytes(Token token, String s) { super(TYPE, token); this.s = s; } public Bytes(PythonTree tree, String s) { super(TYPE, tree); this.s = s; } public Bytes copy() { return new Bytes(this.getToken(), this.s); } @ExposedGet(name = "repr") public String toString() { return "Bytes"; } @Override public String toStringTree() { StringBuffer sb = new StringBuffer("Bytes("); sb.append("s="); sb.append(dumpThis(s)); sb.append(","); sb.append(")"); return sb.toString(); } public <R> boolean enter(VisitorIF<R> visitor) { return visitor.enterBytes(this); } public <R> void leave(VisitorIF<R> visitor) { visitor.leaveBytes(this); } public <R> R accept(VisitorIF<R> visitor) { return visitor.visitBytes(this); } public <R> void traverse(VisitorIF<R> visitor) { } public void replaceField(expr value, expr newValue) { } public PyObject __dict__; @Override public PyObject fastGetDict() { ensureDict(); return __dict__; } @ExposedGet(name = "__dict__") public PyObject getDict() { return fastGetDict(); } private void ensureDict() { if (__dict__ == null) { __dict__ = new PyStringMap(); } } @ExposedGet(name = "lineno") public int getLineno() { return super.getLineno(); } @ExposedSet(name = "lineno") public void setLineno(int num) { lineno = new PyLong(num); } @ExposedGet(name = "col_offset") public int getCol_offset() { return super.getCol_offset(); } @ExposedSet(name = "col_offset") public void setCol_offset(int num) { col_offset = new PyLong(num); } }
3e05d93fa30e275f4a4ca2c588dc69d9b38d1de4
3,710
java
Java
src/main/java/com/ethereumapi/ethereumapi/Controller.java
kunalbarchha/erc20-eth-restAPI
3e6e96309e8ae56280c610cc0ffa43468a0d6477
[ "MIT" ]
1
2020-12-05T08:16:17.000Z
2020-12-05T08:16:17.000Z
src/main/java/com/ethereumapi/ethereumapi/Controller.java
kunalbarchha/erc20-eth-restAPI
3e6e96309e8ae56280c610cc0ffa43468a0d6477
[ "MIT" ]
null
null
null
src/main/java/com/ethereumapi/ethereumapi/Controller.java
kunalbarchha/erc20-eth-restAPI
3e6e96309e8ae56280c610cc0ffa43468a0d6477
[ "MIT" ]
null
null
null
32.831858
132
0.660377
2,460
package com.ethereumapi.ethereumapi; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import lombok.Data; import lombok.extern.slf4j.Slf4j; import okhttp3.Response; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import springfox.documentation.spring.web.json.Json; import java.math.BigDecimal; import java.math.BigInteger; import java.util.Collections; import java.util.List; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @Slf4j @RestController @RequestMapping("/ethereum-service/api") public class Controller { @Data public static class Transfer { private String fromWallet; private String privateKey; private String toAddress; private BigDecimal value; } @Data public static class CreateWallet{ private String walletName; } @Data public static class BalanceOfToken{ private String walletAddress; } @Autowired WalletService walletService; @Autowired Erc20Service erc20Service; @RequestMapping(value = "/{walletAddress}", method = RequestMethod.POST) public ResponseEntity<?> getBalance(@PathVariable String walletAddress) { log.info("Wallet Address {} ", walletAddress); try{ return new ResponseEntity<>(walletService.getBalance(walletAddress), HttpStatus.OK); } catch (Exception e) { e.printStackTrace(); return new ResponseEntity<>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR); } } @PostMapping(value = "/transfer/", consumes = "application/json", produces = "application/json") public ResponseEntity<String> transferSend(@RequestBody Transfer transfer) { try { log.info("withdraw request: {} {} {} {} ",transfer.fromWallet, transfer.privateKey, transfer.toAddress, transfer.value); walletService.sendEther( transfer.fromWallet, transfer.privateKey, transfer.toAddress, transfer.value); } catch (Exception e) { e.printStackTrace(); return new ResponseEntity<>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR); } return new ResponseEntity<String>(HttpStatus.OK); } @JsonSerialize @PostMapping(value = "/create/",consumes = "application/json",produces = "application/json") public ResponseEntity<?>wallet(@RequestBody CreateWallet createWallet){ try { log.info("Wallet name >>>> {}", createWallet.walletName); return new ResponseEntity<>(walletService.createWallet(createWallet.walletName), HttpStatus.OK); } catch (Exception e) { e.printStackTrace(); return new ResponseEntity<>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR); } } @PostMapping(value="/getTokenBalance/", consumes = "application/json", produces = "application/json") public ResponseEntity<?>balance(@RequestBody BalanceOfToken balance) { try { log.info("Wallet address for token {}", balance.walletAddress); return new ResponseEntity<>(erc20Service.getBalance(balance.walletAddress),HttpStatus.OK); } catch (Exception ne){ ne.printStackTrace(); return new ResponseEntity<>(ne.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR); } } }
3e05daf6891ae519a7ed4bcd8c6faa8e99c82124
1,802
java
Java
gobblin-metastore/src/main/java/org/apache/gobblin/metastore/JobHistoryStore.java
hanghangliu/gobblin
a445b0ddcc38441e8768884f07695ac849dcc7fe
[ "Apache-2.0" ]
918
2017-07-28T08:30:36.000Z
2021-02-08T14:15:51.000Z
gobblin-metastore/src/main/java/org/apache/gobblin/metastore/JobHistoryStore.java
hanghangliu/gobblin
a445b0ddcc38441e8768884f07695ac849dcc7fe
[ "Apache-2.0" ]
840
2017-07-27T08:37:27.000Z
2021-02-06T03:12:22.000Z
gobblin-metastore/src/main/java/org/apache/gobblin/metastore/JobHistoryStore.java
Mattlk13/gobblin
1d7671a8dea8638c7bfeb314883c31dbe256e238
[ "Apache-2.0" ]
325
2017-07-26T20:14:30.000Z
2021-02-03T05:48:21.000Z
33.37037
82
0.745838
2,461
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.gobblin.metastore; import java.io.Closeable; import java.io.IOException; import java.util.List; import org.apache.gobblin.rest.JobExecutionInfo; import org.apache.gobblin.rest.JobExecutionQuery; /** * An interface for stores that store job execution information. * * @author Yinan Li */ public interface JobHistoryStore extends Closeable { /** * Insert a new or update an existing job execution record. * * @param jobExecutionInfo a {@link JobExecutionInfo} record * @throws java.io.IOException if the insertion or update fails */ public void put(JobExecutionInfo jobExecutionInfo) throws IOException; /** * Get a list of {@link JobExecutionInfo} records as results of the given query. * * @param query a {@link JobExecutionQuery} instance * @return a list of {@link JobExecutionInfo} records * @throws IOException if the query fails */ public List<JobExecutionInfo> get(JobExecutionQuery query) throws IOException; }
3e05db15206aa3359940b9f247b0b5ff7f487c1b
3,014
java
Java
sell_cars_springboot/src/main/java/sellcars/models/User.java
Rodriguez111/job4j
85237b8b9b77895b42fd62fd1555cc175a791af3
[ "Apache-2.0" ]
null
null
null
sell_cars_springboot/src/main/java/sellcars/models/User.java
Rodriguez111/job4j
85237b8b9b77895b42fd62fd1555cc175a791af3
[ "Apache-2.0" ]
17
2020-03-04T23:28:49.000Z
2021-12-09T21:54:34.000Z
sell_cars_springboot/src/main/java/sellcars/models/User.java
Rodriguez111/job4j
85237b8b9b77895b42fd62fd1555cc175a791af3
[ "Apache-2.0" ]
null
null
null
21.375887
118
0.596218
2,462
package sellcars.models; import com.fasterxml.jackson.annotation.JsonBackReference; import com.fasterxml.jackson.annotation.JsonManagedReference; import javax.persistence.*; import java.util.HashSet; import java.util.List; import java.util.Objects; import java.util.Set; @Entity @Table(name = "users") public class User { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "id") private int id; @Column(name = "login", length = 20, nullable = false, unique = true) private String login; @Column(name = "password", nullable = false) private String password; @Column(name = "name", length = 20, nullable = false) private String name; @Column(name = "surname", length = 20, nullable = false) private String surname; @Column(name = "phone", length = 13) private String phone; @Column(name = "email", length = 60, nullable = false) private String email; @JsonBackReference @OneToMany(mappedBy = "user", cascade = CascadeType.ALL, fetch = FetchType.LAZY) //user - имя поля в классе Advert private Set<Advert> adverts = new HashSet<>(); public User() { } public User(String login, String password, String name, String surname, String phone, String email) { this.login = login; this.password = password; this.name = name; this.surname = surname; this.phone = phone; this.email = email; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getLogin() { return login; } public void setLogin(String login) { this.login = login; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getSurname() { return surname; } public void setSurname(String surname) { this.surname = surname; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public Set<Advert> getAdverts() { return adverts; } public void setAdverts(Set<Advert> adverts) { this.adverts = adverts; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } User user = (User) o; return Objects.equals(login, user.login); } @Override public int hashCode() { return Objects.hash(login); } @Override public String toString() { return login; } }
3e05dc547b29a17debbaf3fd9532224d71b4c7e5
436
java
Java
src/main/java/br/com/zupperacademy/ranyell/proposta/bloqueio/BloqueioClientRequest.java
RanyellHenrique/orange-talents-04-template-proposta
72c9e1cb2afe1d05813566ba26e4449603a0c56d
[ "Apache-2.0" ]
null
null
null
src/main/java/br/com/zupperacademy/ranyell/proposta/bloqueio/BloqueioClientRequest.java
RanyellHenrique/orange-talents-04-template-proposta
72c9e1cb2afe1d05813566ba26e4449603a0c56d
[ "Apache-2.0" ]
null
null
null
src/main/java/br/com/zupperacademy/ranyell/proposta/bloqueio/BloqueioClientRequest.java
RanyellHenrique/orange-talents-04-template-proposta
72c9e1cb2afe1d05813566ba26e4449603a0c56d
[ "Apache-2.0" ]
null
null
null
25.647059
97
0.770642
2,463
package br.com.zupperacademy.ranyell.proposta.bloqueio; import com.fasterxml.jackson.annotation.JsonProperty; public class BloqueioClientRequest { private String sistemaResponsavel; public BloqueioClientRequest(@JsonProperty("sistemaResponsavel") String sistemaResponsavel) { this.sistemaResponsavel = sistemaResponsavel; } public String getSistemaResponsavel() { return sistemaResponsavel; } }
3e05dd153cbe66244b0f44764a1eae8a1165be21
3,894
java
Java
Corpus/birt/3100.java
JamesCao2048/BlizzardData
a524bec4f0d297bb748234eeb1c2fcdee3dce7d7
[ "MIT" ]
1
2022-01-15T02:47:45.000Z
2022-01-15T02:47:45.000Z
Corpus/birt/3100.java
JamesCao2048/BlizzardData
a524bec4f0d297bb748234eeb1c2fcdee3dce7d7
[ "MIT" ]
null
null
null
Corpus/birt/3100.java
JamesCao2048/BlizzardData
a524bec4f0d297bb748234eeb1c2fcdee3dce7d7
[ "MIT" ]
null
null
null
27.617021
81
0.6736
2,464
/******************************************************************************* * Copyright (c) 2004, 2007 Actuate Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Actuate Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.birt.chart.api; import org.eclipse.birt.chart.datafeed.IDataSetProcessor; import org.eclipse.birt.chart.device.IDeviceRenderer; import org.eclipse.birt.chart.exception.ChartException; import org.eclipse.birt.chart.factory.Generator; import org.eclipse.birt.chart.factory.IGenerator; import org.eclipse.birt.chart.model.Serializer; import org.eclipse.birt.chart.model.impl.SerializerImpl; import org.eclipse.birt.chart.util.PluginSettings; import org.eclipse.birt.core.framework.PlatformConfig; /** * The Entry Point class to access the Eclipse Chart Engine (ECE) API */ public class ChartEngine { private PluginSettings ps = null; static private ChartEngine ce = null; /** * A non-instantiable constructor */ private ChartEngine( PluginSettings ps ) { this.ps = ps; } /** * Retrieves a singleton instance of the Chart Engine * * Initializes the OSGi Platform framework to load chart extension bundles * unless the STANDALONE flag was set in PlatformConfig property. * * If the config is null, it will use the BIRT_HOME JVM property to find the * OSGi chart bundles. Subsequent calls to this method will ignore the * config parameter . * * @param config * The OSGi platform configuration. Can be null. */ public static ChartEngine instance( PlatformConfig config ) { if ( ce == null ) { synchronized ( ChartEngine.class ) { if ( ce == null ) { PluginSettings ps = PluginSettings.instance( config ); ce = new ChartEngine( ps ); } } } return ce; } /** * Returns a singleton instance of the Chart Engine * * @return A singleton instance of the Chart Engine */ public static ChartEngine instance( ) { return instance( null ); } /** * Retrieve the Serializer interface, used for loading/saving chart design * from/to an XML stream * * @return A Serializer instance * @deprecated The Serializer instance is decoupled from the ChartEngine. To * obtain a instance of SerializerImpl use: * SerializerImpl.instance( ). */ public Serializer getSerializer( ) { return SerializerImpl.instance( ); } /** * Returns the IChartGenerator interface used to run and render charts * * @return IChartGenerator */ public IGenerator getGenerator( ) { return Generator.instance( ); } /** * Loads a device renderer, required by IChartGenerator to render charts * * @param deviceID * The type of output. Examples are dv.SWT, dv.PNG, dv.JPG, * dv.PDF, dv.SVG * @return An IDeviceRenderer instance * @throws ChartException * If the device renderer does not exist or there is problem * loading it. */ public IDeviceRenderer getRenderer( String deviceID ) throws ChartException { return ps.getDevice( deviceID ); } /** * Retrieves the first instance of a data set processor registered as an * extension for a given series type. * * @param cSeries * The Class instance associated with the given series type * * @return A newly created instance of a registered data set processor * extension * * @throws ChartException */ public final IDataSetProcessor getDataSetProcessor( Class cSeries ) throws ChartException { return ps.getDataSetProcessor( cSeries ); } }
3e05dd5ba72c3883cd3352077db9d190dc540eeb
230
java
Java
work/src/main/java/com/sxh/work/entity/TelNote.java
sxh87621653/sxh87621653.github.io
b6fc3688feb212e3d83abf2f4c72a9eced77bd5a
[ "Apache-2.0" ]
2
2021-11-22T11:22:34.000Z
2021-11-22T11:22:42.000Z
work/src/main/java/com/sxh/work/entity/TelNote.java
sxh87621653/sxh87621653.github.io
b6fc3688feb212e3d83abf2f4c72a9eced77bd5a
[ "Apache-2.0" ]
null
null
null
work/src/main/java/com/sxh/work/entity/TelNote.java
sxh87621653/sxh87621653.github.io
b6fc3688feb212e3d83abf2f4c72a9eced77bd5a
[ "Apache-2.0" ]
null
null
null
16.428571
29
0.734783
2,465
package com.sxh.work.entity; import lombok.Data; @Data public class TelNote { private Integer noteId; private String sendName; private String requestName; private String sendTel; private String requestTel; }
3e05de9b7d16383c7c33a38a3ea261480884c7b1
4,242
java
Java
matos-android/src/main/java/android/provider/VoicemailContract.java
Orange-OpenSource/matos-profiles
fb27c246911437070052197aa3ef91f9aaac6fc3
[ "Apache-2.0" ]
4
2015-05-31T02:12:56.000Z
2016-01-27T11:53:06.000Z
matos-android/src/main/java/android/provider/VoicemailContract.java
Orange-OpenSource/matos-profiles
fb27c246911437070052197aa3ef91f9aaac6fc3
[ "Apache-2.0" ]
null
null
null
matos-android/src/main/java/android/provider/VoicemailContract.java
Orange-OpenSource/matos-profiles
fb27c246911437070052197aa3ef91f9aaac6fc3
[ "Apache-2.0" ]
5
2015-05-31T00:15:20.000Z
2021-06-22T10:21:38.000Z
29.255172
104
0.73786
2,466
package android.provider; /* * #%L * Matos * $Id:$ * $HeadURL:$ * %% * Copyright (C) 2010 - 2014 Orange SA * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * #L% */ public class VoicemailContract { // Classes public static final class Voicemails implements OpenableColumns, BaseColumns { // Fields public static final android.net.Uri CONTENT_URI = null; public static final java.lang.String DIR_TYPE = "vnd.android.cursor.dir/voicemails"; public static final java.lang.String ITEM_TYPE = "vnd.android.cursor.item/voicemail"; public static final java.lang.String NUMBER = "number"; public static final java.lang.String DATE = "date"; public static final java.lang.String DURATION = "duration"; public static final java.lang.String IS_READ = "is_read"; public static final java.lang.String STATE = "state"; public static int STATE_INBOX; public static int STATE_DELETED; public static int STATE_UNDELETED; public static final java.lang.String SOURCE_PACKAGE = "source_package"; public static final java.lang.String SOURCE_DATA = "source_data"; public static final java.lang.String HAS_CONTENT = "has_content"; public static final java.lang.String MIME_TYPE = "mime_type"; public static final java.lang.String _DATA = "_data"; // Constructors private Voicemails(){ } // Methods public static android.net.Uri buildSourceUri(java.lang.String arg1){ return (android.net.Uri) null; } } public static final class Status implements BaseColumns { // Fields public static final android.net.Uri CONTENT_URI = null; public static final java.lang.String DIR_TYPE = "vnd.android.cursor.dir/voicemail.source.status"; public static final java.lang.String ITEM_TYPE = "vnd.android.cursor.item/voicemail.source.status"; public static final java.lang.String SOURCE_PACKAGE = "source_package"; public static final java.lang.String SETTINGS_URI = "settings_uri"; public static final java.lang.String VOICEMAIL_ACCESS_URI = "voicemail_access_uri"; public static final java.lang.String CONFIGURATION_STATE = "configuration_state"; public static final int CONFIGURATION_STATE_OK = 0; public static final int CONFIGURATION_STATE_NOT_CONFIGURED = 1; public static final int CONFIGURATION_STATE_CAN_BE_CONFIGURED = 2; public static final java.lang.String DATA_CHANNEL_STATE = "data_channel_state"; public static final int DATA_CHANNEL_STATE_OK = 0; public static final int DATA_CHANNEL_STATE_NO_CONNECTION = 1; public static final java.lang.String NOTIFICATION_CHANNEL_STATE = "notification_channel_state"; public static final int NOTIFICATION_CHANNEL_STATE_OK = 0; public static final int NOTIFICATION_CHANNEL_STATE_NO_CONNECTION = 1; public static final int NOTIFICATION_CHANNEL_STATE_MESSAGE_WAITING = 2; // Constructors private Status(){ } // Methods public static android.net.Uri buildSourceUri(java.lang.String arg1){ return (android.net.Uri) null; } } // Fields public static final java.lang.String AUTHORITY = "com.android.voicemail"; public static final java.lang.String PARAM_KEY_SOURCE_PACKAGE = "source_package"; public static final java.lang.String ACTION_NEW_VOICEMAIL = "android.intent.action.NEW_VOICEMAIL"; public static final java.lang.String ACTION_FETCH_VOICEMAIL = "android.intent.action.FETCH_VOICEMAIL"; public static final java.lang.String EXTRA_SELF_CHANGE = "com.android.voicemail.extra.SELF_CHANGE"; public static final java.lang.String SOURCE_PACKAGE_FIELD = "source_package"; // Constructors private VoicemailContract(){ } }
3e05ded35a26e2d1c002e959ed9c0236a6755651
2,819
java
Java
compiler-project/packaging/src/test/java/com/asakusafw/lang/compiler/packaging/ResourceItemRepositoryTest.java
asakusafw/asakusafw-compiler
f88ae71d9d9a3e8ab22f25069d2086a6d3bb810e
[ "Apache-2.0" ]
2
2015-07-08T17:32:50.000Z
2020-06-14T02:26:14.000Z
compiler-project/packaging/src/test/java/com/asakusafw/lang/compiler/packaging/ResourceItemRepositoryTest.java
asakusafw/asakusafw-compiler
f88ae71d9d9a3e8ab22f25069d2086a6d3bb810e
[ "Apache-2.0" ]
212
2015-06-30T09:16:35.000Z
2022-02-09T22:31:09.000Z
compiler-project/packaging/src/test/java/com/asakusafw/lang/compiler/packaging/ResourceItemRepositoryTest.java
asakusafw/asakusafw-compiler
f88ae71d9d9a3e8ab22f25069d2086a6d3bb810e
[ "Apache-2.0" ]
7
2015-06-25T02:37:40.000Z
2020-06-18T03:27:40.000Z
30.978022
86
0.636041
2,467
/** * Copyright 2011-2021 Asakusa Framework Team. * * 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.asakusafw.lang.compiler.packaging; import static org.hamcrest.Matchers.*; import static org.junit.Assert.*; import java.util.ArrayList; import java.util.List; import java.util.Map; import org.junit.Test; /** * Test for {@link ResourceItemRepository}. */ public class ResourceItemRepositoryTest extends ResourceTestRoot { /** * simple case. */ @Test public void simple() { List<ResourceItem> items = new ArrayList<>(); items.add(item("a.txt", "A")); ResourceItemRepository repo = new ResourceItemRepository(items); Map<String, String> results = dump(repo); assertThat(results.keySet(), hasSize(1)); assertThat(results, hasEntry("a.txt", "A")); } /** * multiple items. */ @Test public void many() { List<ResourceItem> items = new ArrayList<>(); items.add(item("a.txt", "A")); items.add(item("b.txt", "B")); items.add(item("c.txt", "C")); ResourceItemRepository repo = new ResourceItemRepository(items); Map<String, String> results = dump(repo); assertThat(results.keySet(), hasSize(3)); assertThat(results, hasEntry("a.txt", "A")); assertThat(results, hasEntry("b.txt", "B")); assertThat(results, hasEntry("c.txt", "C")); } /** * empty. */ @Test public void no_items() { List<ResourceItem> items = new ArrayList<>(); ResourceItemRepository repo = new ResourceItemRepository(items); Map<String, String> results = dump(repo); assertThat(results.keySet(), hasSize(0)); } /** * comparing. */ @Test public void compare() { List<ResourceItem> items = new ArrayList<>(); items.add(item("a.txt", "A")); items.add(item("b.txt", "B")); items.add(item("c.txt", "C")); ResourceItemRepository repo = new ResourceItemRepository(items); assertThat(repo.toString(), repo, is(new ResourceItemRepository(items))); assertThat(repo.hashCode(), is(new ResourceItemRepository(items).hashCode())); assertThat(repo, is(not(new ResourceItemRepository(items.subList(0, 2))))); } }
3e05df6f5173184a5d0815d0ee0496d25d095e40
763
java
Java
backend/src/main/java/io/berndruecker/camunda/harvest/config/DefaultCamundaEnginePopulation.java
AlexRogalskiy/camunda-engine-harvester
2ec351a7a44bdd3af4fdd635e6b5342f8edfd926
[ "Apache-2.0" ]
3
2020-07-22T07:18:13.000Z
2021-12-29T18:28:26.000Z
backend/src/main/java/io/berndruecker/camunda/harvest/config/DefaultCamundaEnginePopulation.java
berndruecker/camunda-engine-harvester
02f1d8877dfdb2dd1aad2e0abe48c85da1284039
[ "Apache-2.0" ]
1
2021-12-14T23:02:57.000Z
2021-12-14T23:03:14.000Z
backend/src/main/java/io/berndruecker/camunda/harvest/config/DefaultCamundaEnginePopulation.java
AlexRogalskiy/camunda-engine-harvester
2ec351a7a44bdd3af4fdd635e6b5342f8edfd926
[ "Apache-2.0" ]
2
2020-05-23T01:51:39.000Z
2021-12-14T23:02:50.000Z
26.310345
75
0.781127
2,468
package io.berndruecker.camunda.harvest.config; import javax.annotation.PostConstruct; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import io.berndruecker.camunda.harvest.domain.CamundaEngineInfo; import io.berndruecker.camunda.harvest.repository.CamundaEngineRepository; @Component public class DefaultCamundaEnginePopulation { @Autowired private DefaultCamundaEngineConfig defaultConfig; @Autowired private CamundaEngineRepository repository; @PostConstruct public void populateDefaults() { for (CamundaEngineInfo engine : defaultConfig.getEngines()) { if (!repository.existsByName(engine.getName())) { repository.save(engine); } } } }
3e05df73b1a78ccfc7bdfe3c45e62ea8ddf42ed0
2,193
java
Java
map_tools/src/main/java/net/patrykczarnik/map_tools/graphic/PixelPath.java
patczar/map_tools
e111135bba7baca61b3fe8f21d77566f1468c689
[ "Apache-2.0" ]
null
null
null
map_tools/src/main/java/net/patrykczarnik/map_tools/graphic/PixelPath.java
patczar/map_tools
e111135bba7baca61b3fe8f21d77566f1468c689
[ "Apache-2.0" ]
null
null
null
map_tools/src/main/java/net/patrykczarnik/map_tools/graphic/PixelPath.java
patczar/map_tools
e111135bba7baca61b3fe8f21d77566f1468c689
[ "Apache-2.0" ]
null
null
null
27.848101
153
0.713182
2,469
package net.patrykczarnik.map_tools.graphic; import java.awt.Point; import java.util.Collection; import java.util.LinkedList; import java.util.List; import java.util.NoSuchElementException; import java.util.stream.Collectors; import java.util.stream.Stream; /** * @author Patryk Czarnik <[email protected]> * * A path of points. Typically used to denote a series of pixels. */ public class PixelPath { private final List<PixelCoordinates> fPixels; private PixelPath(List<PixelCoordinates> aPixels) { fPixels = aPixels; } /** Creates a new path with no points. * @return a fresh PixelPath object, never null. */ public static PixelPath empty() { return new PixelPath(new LinkedList<>()); } /** Creates a new path initialized with the given collection of points. The order of the points originating from the input collection will be preserved. * @param aPixels a collection of points, not null * @return a fresh PixelPath object, never null. */ public static PixelPath of(Collection<PixelCoordinates> aPixels) { return new PixelPath(new LinkedList<>(aPixels)); } /** Creates a new path initialized with the given points. If the stream is ordered, the order of the points will be preserved. * @param aPixels a stream of points, not null. The stream must be finished. * @return a fresh PixelPath object, never null. */ public static PixelPath of(Stream<PixelCoordinates> aPixels) { return new PixelPath(aPixels.collect(Collectors.toList())); } @Override public String toString() { return fPixels.toString(); } public List<Point> getPoints() { return fPixels.stream() .map(PixelCoordinates::toAwtPoint) .collect(Collectors.toList()); } public PixelBounds getBounds() { if(fPixels.isEmpty()) { throw new NoSuchElementException("Empty path has no bounds."); } int minX = Integer.MAX_VALUE; int minY = Integer.MAX_VALUE; int maxX = Integer.MIN_VALUE; int maxY = Integer.MIN_VALUE; for(PixelCoordinates p : fPixels) { if(p.x < minX) minX = p.x; if(p.x > maxX) maxX = p.x; if(p.y < minY) minY = p.y; if(p.y > maxY) maxY = p.y; } return PixelBounds.of(minX, maxX, minY, maxY); } }
3e05dfb199e53f0a0689d932b5f0078c73518d8a
261
java
Java
threadcomponent/src/main/java/com/bilibili/threadcomponent/guardedsuspension/sample/Request.java
Chihiro23333/ChidoriX
7e57171085f4230611cd51db594d3fc619a02603
[ "Apache-2.0" ]
2
2018-08-31T09:59:20.000Z
2019-05-29T07:43:31.000Z
threadcomponent/src/main/java/com/bilibili/threadcomponent/guardedsuspension/sample/Request.java
Chihiro23333/ChidoriX
7e57171085f4230611cd51db594d3fc619a02603
[ "Apache-2.0" ]
null
null
null
threadcomponent/src/main/java/com/bilibili/threadcomponent/guardedsuspension/sample/Request.java
Chihiro23333/ChidoriX
7e57171085f4230611cd51db594d3fc619a02603
[ "Apache-2.0" ]
null
null
null
16.3125
62
0.64751
2,470
package com.bilibili.threadcomponent.guardedsuspension.sample; public class Request { private final String name; public Request(String name) { this.name = name; } @Override public String toString() { return name; } }
3e05dfc47be94756825fbd983a5c00843fffea13
2,415
java
Java
src/main/java/io/streamthoughts/kafka/specs/operation/ExecutableOperation.java
TrivadisPF/jikkou
ca4438fb1a65e5ad314253fadcbeb5a6e8d4bfe3
[ "Apache-2.0" ]
25
2019-07-04T08:39:47.000Z
2021-09-20T08:00:27.000Z
src/main/java/io/streamthoughts/kafka/specs/operation/ExecutableOperation.java
TrivadisPF/jikkou
ca4438fb1a65e5ad314253fadcbeb5a6e8d4bfe3
[ "Apache-2.0" ]
20
2019-10-14T15:54:37.000Z
2021-10-29T21:06:53.000Z
src/main/java/io/streamthoughts/kafka/specs/operation/ExecutableOperation.java
TrivadisPF/jikkou
ca4438fb1a65e5ad314253fadcbeb5a6e8d4bfe3
[ "Apache-2.0" ]
6
2020-08-04T15:18:27.000Z
2021-02-17T23:40:38.000Z
37.153846
139
0.693996
2,471
/* * Copyright 2021 StreamThoughts. * * 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 io.streamthoughts.kafka.specs.operation; import io.streamthoughts.kafka.specs.change.Change; import io.vavr.concurrent.Future; import org.jetbrains.annotations.NotNull; import java.util.Collection; import java.util.List; import java.util.Map; import java.util.function.Function; import java.util.function.Predicate; import java.util.stream.Collectors; public interface ExecutableOperation<T extends Change<K>, K, V> extends Operation<K, T>, Function<Collection<T>, Map<K, List<Future<V>>>> { /** * Executes this operation for the given list of changes. * * @param changes the list of change to be applied. * @return a map of operation results. */ @Override default Map<K, List<Future<V>>> apply(final Collection<T> changes) { return this.doApply(filter(changes, this)); } /** * Applies this operation on all changes. * * @param changes the list of change to be applied. * @return a map of operation results. */ @NotNull Map<K, List<Future<V>>> doApply(@NotNull final Collection<T> changes); /** * Returns the {@link Change} object that match the given predicate. * * @param predicate the {@link Predicate}. * @return the filtered {@link Change} object. */ private static <K, T extends Change<K>> Collection<T> filter(@NotNull final Collection<T> changes, @NotNull final Predicate<T> predicate) { return changes.stream().filter(predicate).collect(Collectors.toList()); } }
3e05e008864be45f4bb6725ce8f0c41b12fde20c
7,272
java
Java
src/main/java/nz/ac/waikato/its/dspace/reporting/configuration/Report.java
aschweer/API-Extras
c84d733ca40746a0ba5768a7ffdfd9a8dc1c474f
[ "BSD-3-Clause" ]
null
null
null
src/main/java/nz/ac/waikato/its/dspace/reporting/configuration/Report.java
aschweer/API-Extras
c84d733ca40746a0ba5768a7ffdfd9a8dc1c474f
[ "BSD-3-Clause" ]
null
null
null
src/main/java/nz/ac/waikato/its/dspace/reporting/configuration/Report.java
aschweer/API-Extras
c84d733ca40746a0ba5768a7ffdfd9a8dc1c474f
[ "BSD-3-Clause" ]
null
null
null
28.20155
164
0.684992
2,472
package nz.ac.waikato.its.dspace.reporting.configuration; import nz.ac.waikato.its.dspace.reporting.ReportingException; import org.apache.commons.lang.StringUtils; import org.apache.solr.client.solrj.SolrQuery; import org.apache.solr.client.solrj.SolrServerException; import org.apache.solr.client.solrj.impl.HttpSolrServer; import org.apache.solr.client.solrj.response.FacetField; import org.apache.solr.client.solrj.response.QueryResponse; import org.apache.solr.common.util.DateUtil; import javax.xml.bind.annotation.*; import java.io.UnsupportedEncodingException; import java.net.MalformedURLException; import java.net.URL; import java.net.URLEncoder; import java.text.DateFormat; import java.util.*; /** * @author Andrea Schweer [email protected] for AgResearch */ @XmlRootElement(namespace = "nz.ac.waikato.its.dspace.reporting.configuration.ReportsConfiguration") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(propOrder = {"title", "sorting", "dateField", "maxResults", "fields"}) public class Report { @XmlAttribute(required = true) private String id; @XmlElementWrapper(name = "fields") @XmlElement(name = "field") private List<Field> fields = new ArrayList<>(); @XmlElement private String title; @XmlElement private Sorting sorting; @XmlElement private String dateField; @XmlElement(defaultValue = "10000") private int maxResults = 10000; private static final DateFormat solrDateFormat = DateUtil.getThreadLocalDateFormat(); static { solrDateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); } public Report() { } // no-arg constructor needed by JAXB public Report(String id) { this.id = id; } public String getId() { return id; } public void setId(String id) { this.id = id; } public List<Field> getFields() { return fields; } public void setFields(List<Field> fields) { this.fields = fields; } public void addField(Field field) { fields.add(field); } public String getDateField() { return dateField; } public void setDateField(String dateField) { this.dateField = dateField; } public Sorting getSorting() { return sorting; } public void setSorting(Sorting sorting) { this.sorting = sorting; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public URL toQueryURL(String solrServer, Date start, Date end) throws MalformedURLException, UnsupportedEncodingException { return toQueryURL(solrServer, start, end, null); } public URL toQueryURL(String solrServer, Date start, Date end, Map<String, List<String>> pickedValues) throws MalformedURLException, UnsupportedEncodingException { SolrQuery query = getBasicSolrQuery(); if (pickedValues != null && !pickedValues.isEmpty()) { for (String field : pickedValues.keySet()) { List<String> values = pickedValues.get(field); if (values == null || values.isEmpty()) { continue; // skip this field } StringBuilder filterBuilder = new StringBuilder("("); boolean first = true; for (String value : values) { if (first) { first = false; } else { filterBuilder.append(" OR "); } filterBuilder.append("\""); filterBuilder.append(value); filterBuilder.append("\""); } filterBuilder.append(")"); query.addFilterQuery(field + ":" + filterBuilder.toString()); } } // csv settings query.add("wt", "csv"); query.add("csv.mv.separator", "|"); if (StringUtils.isNotBlank(dateField)) { query.addFilterQuery(dateField + ":[" + dateToSolr(start, false) + " TO " + dateToSolr(end, true) + "]"); } if (sorting != null) { query.addSort(sorting.getFieldName(), sorting.getOrder() == Sorting.Order.ASC ? SolrQuery.ORDER.asc : SolrQuery.ORDER.desc); } for (Field field : fields) { String fieldSpec; if (StringUtils.isNotBlank(field.getHeader())) { fieldSpec = URLEncoder.encode(field.getHeader(), "UTF-8") + ":" + field.getName(); } else { fieldSpec = field.getName(); } query.addField(fieldSpec); } query.setRows(maxResults); return new URL(solrServer + "/select?" + query.toString()); } private SolrQuery getBasicSolrQuery() { SolrQuery query = new SolrQuery("*:*"); // only include live items query.addFilterQuery("withdrawn:false"); query.addFilterQuery("search.resourcetype:2"); return query; } private String dateToSolr(Date date, boolean pushForward) { if (date == null) { return "*"; } else if(pushForward){ Calendar c = Calendar.getInstance(); c.setTime(date); c.add(Calendar.DATE, 1); date = c.getTime(); } return solrDateFormat.format(date); } public void setMaxResults(int maxResults) { this.maxResults = maxResults; } public int getMaxResults() { return maxResults; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Report report = (Report) o; if (maxResults != report.maxResults) return false; if (dateField != null ? !dateField.equals(report.dateField) : report.dateField != null) return false; if (!fields.equals(report.fields)) return false; if (!id.equals(report.id)) return false; if (!title.equals(report.title)) return false; if (sorting != null ? !sorting.equals(report.sorting) : report.sorting != null) return false; return true; } @Override public int hashCode() { int result = id.hashCode(); result = 31 * result + fields.hashCode(); result = 31 * result + (sorting != null ? sorting.hashCode() : 0); result = 31 * result + (dateField != null ? dateField.hashCode() : 0); result = 31 * result + (title != null ? title.hashCode() : 0); result = 31 * result + maxResults; return result; } @Override public String toString() { return "Report{" + "id='" + id + '\'' + ", title=" + title + ", fields=" + fields + ", sorting=" + sorting + ", dateField='" + dateField + '\'' + ", maxResults=" + maxResults + '}'; } public List<String> getPickableValues(Field field, String solrServer) throws ReportingException { if (!fields.contains(field)) { throw new IllegalArgumentException("This report doesn't contain the specified field " + field); } if (field.getValuesMode() != Field.ValuesMode.PICK) { throw new IllegalArgumentException("This field isn't pickable " + field); } List<String> result = new ArrayList<>(); HttpSolrServer solr = new HttpSolrServer(solrServer); SolrQuery query = toPickableValuesQuery(field.getName()); try { QueryResponse response = solr.query(query); FacetField facetField = response.getFacetField(field.getName()); List<FacetField.Count> values = facetField.getValues(); for (FacetField.Count value : values) { result.add(value.getName()); } Collections.sort(result); } catch (SolrServerException e) { throw new ReportingException("Could not determine pickable values", e); } return result; } SolrQuery toPickableValuesQuery(String name) { SolrQuery query = getBasicSolrQuery(); query.setFacet(true); query.setFacetMinCount(1); query.setFacetLimit(maxResults); query.addFacetField(name); return query; } }
3e05e023bc4aefe71d41f91a094abc450487daf3
3,314
java
Java
Java/Java Web/01.Java Web Development Basics - January 2019/12.Exam 24.02.2019/exam/src/main/java/exam/repository/UserRepositoryImpl.java
mgpavlov/SoftUni
cef1a7e4e475c69bbeb7bfdcaf7b3e64c88d604c
[ "MIT" ]
1
2019-06-07T18:24:58.000Z
2019-06-07T18:24:58.000Z
Java/Java Web/01.Java Web Development Basics - January 2019/12.Exam 24.02.2019/exam/src/main/java/exam/repository/UserRepositoryImpl.java
mgpavlov/SoftUni
cef1a7e4e475c69bbeb7bfdcaf7b3e64c88d604c
[ "MIT" ]
null
null
null
Java/Java Web/01.Java Web Development Basics - January 2019/12.Exam 24.02.2019/exam/src/main/java/exam/repository/UserRepositoryImpl.java
mgpavlov/SoftUni
cef1a7e4e475c69bbeb7bfdcaf7b3e64c88d604c
[ "MIT" ]
1
2020-06-16T11:20:31.000Z
2020-06-16T11:20:31.000Z
27.848739
97
0.575438
2,473
package exam.repository; import exam.domain.entities.User; import javax.inject.Inject; import javax.persistence.EntityManager; import java.util.List; public class UserRepositoryImpl implements UserRepository { private final EntityManager entityManager; @Inject public UserRepositoryImpl(EntityManager entityManager) { this.entityManager = entityManager; } @Override public User registerEntity(User entity) { this.entityManager.getTransaction().begin(); try { this.entityManager.persist(entity); this.entityManager.getTransaction().commit(); return entity; }catch (Exception e) { this.entityManager.getTransaction().rollback(); return null; } } @Override public User updateEntity(User entity) { this.entityManager.getTransaction().begin(); try { User updatedUser = this.entityManager.merge(entity); this.entityManager.getTransaction().commit(); return updatedUser; }catch (Exception e) { this.entityManager.getTransaction().rollback(); return null; } } @Override public boolean deleteEntity(String id) { this.entityManager.getTransaction().begin(); try { this.entityManager.createQuery("DELETE FROM User u WHERE u.id = :id") .setParameter("id", id).executeUpdate(); this.entityManager.getTransaction().commit(); return true; }catch (Exception e) { this.entityManager.getTransaction().rollback(); return false; } } @Override public List<User> findAll() { this.entityManager.getTransaction().begin(); try { List<User> users = this.entityManager .createQuery("SELECT u FROM User u ", User.class) .getResultList(); this.entityManager.getTransaction().commit(); return users; }catch (Exception e){ this.entityManager.getTransaction().rollback(); return null; } } @Override public User findById(String id) { this.entityManager.getTransaction().begin(); try { User user = this.entityManager .createQuery("SELECT u FROM User u WHERE u.id = :id", User.class) .setParameter("id", id) .getSingleResult(); this.entityManager.getTransaction().commit(); return user; }catch (Exception e){ this.entityManager.getTransaction().rollback(); return null; } } @Override public User findByUsername(String username) { this.entityManager.getTransaction().begin(); try { User user = this.entityManager .createQuery("SELECT u FROM User u WHERE u.username = :username", User.class) .setParameter("username", username) .getSingleResult(); this.entityManager.getTransaction().commit(); return user; } catch (Exception e) { this.entityManager.getTransaction().rollback(); return null; } } }
3e05e088b326566512ab605f1bdf44cc912f45dd
4,848
java
Java
src/main/java/pha/ics/io/read/LineParser.java
pha3a/ics-library
afe7b5d94bfd34f5b5dd56b973e5ad122e3a4b72
[ "MIT" ]
null
null
null
src/main/java/pha/ics/io/read/LineParser.java
pha3a/ics-library
afe7b5d94bfd34f5b5dd56b973e5ad122e3a4b72
[ "MIT" ]
null
null
null
src/main/java/pha/ics/io/read/LineParser.java
pha3a/ics-library
afe7b5d94bfd34f5b5dd56b973e5ad122e3a4b72
[ "MIT" ]
null
null
null
30.3
113
0.589315
2,474
package pha.ics.io.read; import org.jetbrains.annotations.NotNull; import pha.ics.FieldName; import java.util.ArrayList; import java.util.List; /** * Split a line into 3 parts, a name, a list of parameters(optional) and a value. * <p> * Created by paul on 21/09/14. */ class LineParser { static Line split(@NotNull String original) { char[] chars = original.toCharArray(); List<Region> regions = getQuoteRegions(chars); int colonPosition = find(':', original, regions); String valuePart = null; if (haveColonAt(colonPosition)) { valuePart = original.substring(colonPosition + 1); } int semiPosition = find(';', original, regions); String key; List<String> params = null; if (haveSemicolonAt(semiPosition) && haveColonAt(colonPosition) && semiPosition < colonPosition) { key = original.substring(0, semiPosition); params = splitParams(original, semiPosition + 1, colonPosition, regions); } else if (colonPosition > -1) { key = original.substring(0, colonPosition); } else { key = original; } FieldName fieldName = FieldName.parse(key); if (fieldName == null) { fieldName = FieldName.UNKNOWN; } return new Line(fieldName, params, valuePart); } private static boolean haveColonAt(int position) { return position > -1; } private static boolean haveSemicolonAt(int position) { return position > -1; } /** * Split the string of parameters into an array. * * @param paramString to split * @param startPos position of the start of the parameters in paramString * @param endPos position of the end of the parameters in paramString * @param regions quoted regions that should not be split * @return array of parameters */ @NotNull private static List<String> splitParams(String paramString, int startPos, int endPos, List<Region> regions) { List<String> params = new ArrayList<>(); int start = startPos; int semiPosition = find(';', paramString, regions, start); while (haveSemicolonAt(semiPosition) && semiPosition < endPos) { params.add(paramString.substring(start, semiPosition)); start = semiPosition + 1; semiPosition = find(';', paramString, regions, start); } params.add(paramString.substring(start, endPos)); return params; } /** * Find the given character in the original string that is not between quotes. * * @param charToFind character to find * @param original string to search * @param regions quoted regions * @param startPos position in original to start the search. * @return position of first matching char after startPos */ private static int find(char charToFind, String original, List<Region> regions, int startPos) { int charPosition = original.indexOf(charToFind, startPos); while (charPosition > -1 && inQuotes(charPosition, regions)) { charPosition = original.indexOf(charToFind, charPosition + 1); } return charPosition; } private static int find(char charToFind, String original, List<Region> regions) { return find(charToFind, original, regions, 0); } /** * Is the given position inside quotes? * * @param position to check * @param regions the quoted regions of the string * @return true if position is inside a quoted region */ private static boolean inQuotes(int position, List<Region> regions) { for (Region region : regions) { if (region.contains(position)) { return true; } } return false; } private static List<Region> getQuoteRegions(char[] chars) { List<Region> regions = new ArrayList<>(); // Find the quote regions int start = -1; for (int i = 0; i < chars.length; i++) { if (chars[i] == '"') { if (start == -1) { start = i; } else { regions.add(new Region(start, i)); start = -1; } } } // Unterminated quote if (start != -1) { regions.add(new Region(start, Integer.MAX_VALUE)); } return regions; } private static class Region { private int start; private int end; Region(int startOfRegion, int endOfRegion) { start = startOfRegion; end = endOfRegion; } boolean contains(int position) { return position > start && position < end; } } }
3e05e1bd630d0832b18ce1c22d5333a020de2223
1,474
java
Java
src/main/java/com/grabarski/mateusz/domain/models/DepartmentManager.java
mgrabarski/java-hibernate-employees
92a24145969864bbf27182f71029fad0ca243a00
[ "Apache-2.0" ]
null
null
null
src/main/java/com/grabarski/mateusz/domain/models/DepartmentManager.java
mgrabarski/java-hibernate-employees
92a24145969864bbf27182f71029fad0ca243a00
[ "Apache-2.0" ]
null
null
null
src/main/java/com/grabarski/mateusz/domain/models/DepartmentManager.java
mgrabarski/java-hibernate-employees
92a24145969864bbf27182f71029fad0ca243a00
[ "Apache-2.0" ]
null
null
null
20.191781
76
0.652646
2,475
package com.grabarski.mateusz.domain.models; import com.grabarski.mateusz.domain.models.keys.DepartmentManagerPrimaryKey; import javax.persistence.*; import java.sql.Date; /** * Created by Mateusz Grabarski on 20.07.2018. */ @Entity @Table(name = "dept_manager") public class DepartmentManager { @EmbeddedId private DepartmentManagerPrimaryKey key; @Column(name = "from_date") private Date fromDate; @Column(name = "to_date") private Date toDate; @ManyToOne @JoinColumn(name = "emp_no") @MapsId("empNo") private Employee employee; @ManyToOne @JoinColumn(name = "dept_no") @MapsId("deptNo") private Department department; public DepartmentManagerPrimaryKey getKey() { return key; } public void setKey(DepartmentManagerPrimaryKey key) { this.key = key; } public Date getFromDate() { return fromDate; } public void setFromDate(Date fromDate) { this.fromDate = fromDate; } public Date getToDate() { return toDate; } public void setToDate(Date toDate) { this.toDate = toDate; } public Employee getEmployee() { return employee; } public void setEmployee(Employee employee) { this.employee = employee; } public Department getDepartment() { return department; } public void setDepartment(Department department) { this.department = department; } }
3e05e21f21e7d55927d9adef9aa57c61b0899d08
3,036
java
Java
common/src/test/java/com/vivier_technologies/common/eventreceiver/MulticastEventReceiverTest.java
vivier-technologies/sequencer
2978f4b498ee8edd9c90fcc4dd7febaf2a5a52a0
[ "Apache-2.0" ]
1
2020-05-15T09:58:32.000Z
2020-05-15T09:58:32.000Z
common/src/test/java/com/vivier_technologies/common/eventreceiver/MulticastEventReceiverTest.java
vivier-technologies/sequencer
2978f4b498ee8edd9c90fcc4dd7febaf2a5a52a0
[ "Apache-2.0" ]
null
null
null
common/src/test/java/com/vivier_technologies/common/eventreceiver/MulticastEventReceiverTest.java
vivier-technologies/sequencer
2978f4b498ee8edd9c90fcc4dd7febaf2a5a52a0
[ "Apache-2.0" ]
null
null
null
41.027027
115
0.728261
2,476
/* * Copyright 2020 vivier technologies * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.vivier_technologies.common.eventreceiver; import com.vivier_technologies.common.mux.Multiplexer; import com.vivier_technologies.events.Event; import com.vivier_technologies.events.EventHeader; import com.vivier_technologies.events.Events; import com.vivier_technologies.utils.ByteArrayUtils; import com.vivier_technologies.utils.ConsoleLogger; import com.vivier_technologies.utils.MulticastTestChannelCreator; import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.channels.DatagramChannel; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.*; class MulticastEventReceiverTest { private byte[] _source = new byte[EventHeader.SRC_LEN]; private byte[] _eventBody = "THIS_IS_A_TEST".getBytes(); @Test public void testGotEvent() throws IOException { ByteArrayUtils.copyAndPadRightWithSpaces("TEST".getBytes(), _source, 0, _source.length); MulticastTestChannelCreator creator = new MulticastTestChannelCreator(); DatagramChannel mockChannel = mock(DatagramChannel.class); doAnswer(invocation -> { Object[] args = invocation.getArguments(); ByteBuffer buffer = (ByteBuffer)args[0]; buffer.putShort(EventHeader.TYPE, Events.START_OF_STREAM); buffer.put(EventHeader.SRC, _source, 0, _source.length); buffer.putLong(EventHeader.EVENT_SEQ, 1L); buffer.position(EventHeader.EVENT_HEADER_LEN); buffer.put(_eventBody); buffer.putInt(EventHeader.EVENT_LEN, buffer.position()); return null; // void method, so return null }).when(mockChannel).receive(any()); creator.setReceiveChannel(mockChannel); MulticastEventReceiver receiver = new MulticastEventReceiver(mock(ConsoleLogger.class), mock(Multiplexer.class), creator, null, null, 0, true, 1, 50); EventHandler mockEventHandler = mock(EventHandler.class); receiver.setHandler(mockEventHandler); receiver.open(); receiver.onRead(); ArgumentCaptor<Event> captor = ArgumentCaptor.forClass(Event.class); verify(mockEventHandler).onEvent(captor.capture()); assertEquals(1, captor.getValue().getHeader().getSequence()); } }
3e05e41b141131a4ac998066ef760a1cadbd0b0d
1,354
java
Java
integration-tests/jakartaee-simple-webapp/src/main/java/co/elastic/webapp/JakartaErrorServlet.java
golino/apm-agent-java
71251b5af4e886f125df2d349254dd0d75454498
[ "Apache-2.0" ]
496
2018-02-24T01:52:00.000Z
2022-03-20T16:39:36.000Z
integration-tests/jakartaee-simple-webapp/src/main/java/co/elastic/webapp/JakartaErrorServlet.java
golino/apm-agent-java
71251b5af4e886f125df2d349254dd0d75454498
[ "Apache-2.0" ]
2,324
2018-03-08T19:15:38.000Z
2022-03-31T21:06:29.000Z
integration-tests/jakartaee-simple-webapp/src/main/java/co/elastic/webapp/JakartaErrorServlet.java
golino/apm-agent-java
71251b5af4e886f125df2d349254dd0d75454498
[ "Apache-2.0" ]
280
2018-02-26T08:05:49.000Z
2022-03-22T07:06:01.000Z
36.594595
113
0.75997
2,477
/* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch B.V. 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 co.elastic.webapp; import jakarta.servlet.ServletException; import jakarta.servlet.http.HttpServlet; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.PrintWriter; public class JakartaErrorServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { PrintWriter out = resp.getWriter(); out.print("Hello Error!"); out.close(); } }
3e05e455ab222be1781f753913590dc54d588c45
7,915
java
Java
src/main/java/net/thesimpleteam/simplebot/commands/GithubCommand.java
TheSimpleTeam/SimpleBot
8f95641695a432a5ab414e07baf73558ccdcd166
[ "MIT" ]
null
null
null
src/main/java/net/thesimpleteam/simplebot/commands/GithubCommand.java
TheSimpleTeam/SimpleBot
8f95641695a432a5ab414e07baf73558ccdcd166
[ "MIT" ]
16
2021-09-27T13:35:15.000Z
2022-03-20T10:46:27.000Z
src/main/java/net/thesimpleteam/simplebot/commands/GithubCommand.java
TheSimpleTeam/SimpleBot
8f95641695a432a5ab414e07baf73558ccdcd166
[ "MIT" ]
null
null
null
52.072368
386
0.589893
2,478
package net.thesimpleteam.simplebot.commands; import com.jagrosh.jdautilities.command.Command; import com.jagrosh.jdautilities.command.CommandEvent; import com.typesafe.config.ConfigException; import net.dv8tion.jda.api.EmbedBuilder; import net.dv8tion.jda.api.MessageBuilder; import net.thesimpleteam.simplebot.SimpleBot; import net.thesimpleteam.simplebot.commands.annotations.RequireConfig; import net.thesimpleteam.simplebot.enums.CommandCategories; import net.thesimpleteam.simplebot.utils.MessageHelper; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; import org.kohsuke.github.GHRepository; import org.kohsuke.github.GitHub; import org.kohsuke.github.GitHubBuilder; import java.awt.Color; import java.io.IOException; import java.io.InputStreamReader; import java.net.URL; import java.nio.charset.StandardCharsets; import java.time.ZoneId; import java.time.format.DateTimeFormatter; import java.util.*; @RequireConfig("botGithubToken") public class GithubCommand extends Command { private final GitHub github; public GithubCommand() throws IOException { this.name = "github"; this.cooldown = 5; this.arguments = "arguments.github"; this.category = CommandCategories.MISC.category; this.help = "help.github"; this.example = "search PufferTeam SuperPack"; this.aliases = new String[]{"ghub","gith","gh"}; this.github = new GitHubBuilder().withOAuthToken(SimpleBot.getInfos().botGithubToken()).build(); } @Override protected void execute(CommandEvent event) { String[] args = event.getArgs().split("\\s+"); if(args.length != 2 && args.length != 3) { MessageHelper.syntaxError(event, this, "information.github"); return; } if(isCommandDisabled()) { event.reply(new MessageBuilder(MessageHelper.getEmbed(event, "error.github.disabled", null, null, null).build()).build()); return; } switch (args[0]) { case "search" -> { if (args.length != 3) { MessageHelper.syntaxError(event, this, "information.github"); return; } GHRepository repository; try { repository = github.getRepository(args[1] + "/" + args[2]); } catch (IOException ignored) { event.reply(new MessageBuilder(MessageHelper.getEmbed(event, "error.github.search.repositoryDontExist", null, null, null).build()).build()); return; } try { EmbedBuilder embedBuilder = MessageHelper.getEmbed(event, "success.github.search.success", getColor(repository.getLanguage()), null, repository.getOwner().getAvatarUrl()) .addField(MessageHelper.translateMessage(event, "success.github.search.repositoryName"), repository.getName() + " (" + repository.getUrl().toString() + ")", false) .addField(MessageHelper.translateMessage(event, "success.github.search.author"), repository.getOwnerName(), false) .addField(MessageHelper.translateMessage(event, "success.github.search.license"), repository.getLicense() == null ? MessageHelper.translateMessage(event, "success.github.noLicense") : repository.getLicense().getName(), false); if(repository.getDescription() != null) embedBuilder.addField(MessageHelper.translateMessage(event, "success.github.search.description"), repository.getDescription(), false); if(repository.getLanguage() != null) embedBuilder.addField(MessageHelper.translateMessage(event, "success.github.search.mainLanguage"), repository.getLanguage(), false); try{ embedBuilder.addField(MessageHelper.translateMessage(event, "success.github.search.fileREADME"), MessageHelper.stringShortener(IOUtils.toString(repository.getReadme().read(), StandardCharsets.UTF_8), 1024), false); } finally { event.reply(new MessageBuilder(embedBuilder).build()); } } catch (IOException e) { MessageHelper.sendError(e, event, this); } } case "list" -> event.getMessage().reply(new MessageBuilder(MessageHelper.getEmbed(event, "warning.commands.takeTime", null, null, null).build()).build()).queue(message -> { try { EmbedBuilder embedBuilder = MessageHelper.getEmbed(event, "success.github.list", null, null, github.getUser(args[1]).getAvatarUrl(), name); List<GHRepository> repositories = new ArrayList<>(github.getUser(args[1]).getRepositories().values()); repositories.stream().sorted(Comparator.comparing(GHRepository::getStargazersCount) .reversed() .thenComparing(GHRepository::getForksCount) .reversed() .thenComparing(GHRepository::getWatchersCount) .reversed() .thenComparing(GHRepository::getName)) .forEach(repository -> { try { embedBuilder.addField(repository.getName() + " \u2B50 " + repository.getStargazersCount() + " <:github_fork:969261831359197214> " + repository.getForksCount() + " \uD83D\uDCC5 " + MessageHelper.formatShortDate(repository.getCreatedAt().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime()), repository.getHtmlUrl().toString(), false); } catch (IOException e) { throw new RuntimeException(e); } }); event.getMessage().reply(new MessageBuilder(embedBuilder.build()).build()).queue(unused -> message.delete().queue()); } catch (IOException e) { MessageHelper.sendError(e, event, this); } }); default -> MessageHelper.syntaxError(event, this, "information.github"); } } /** * @return {@code true} if the command is disabled, {@code false} otherwise */ private boolean isCommandDisabled() { try { github.checkApiUrlValidity(); } catch (IOException ignored) { return true; } return false; } /** * @param language the principal repository's language * @return the language's color */ private Color getColor(String language) { try { Map<String, Map<String, String>> lang = SimpleBot.gson.fromJson(new InputStreamReader(new URL("https://raw.githubusercontent.com/ozh/github-colors/master/colors.json").openStream()), Map.class); return language == null ? Color.RED : Color.getColor(String.valueOf(getDecimal(lang.get(StringUtils.capitalize(language)).getOrDefault("color", "#FF0000")))); } catch (IOException e) { e.printStackTrace(); return Color.RED; } } /** * @param hex the hexadecimal color * @return the decimal color */ private int getDecimal(String hex) { String digits = "0123456789ABCDEF"; int val = 0; for (int i = 0; i < hex.length(); i++) { char c = hex.toUpperCase().charAt(i); int d = digits.indexOf(c); val = 16 * val + d; } return val; } }
3e05e478b1c75dc83a89e22549a365113d33e68d
697
java
Java
FtcRobotController/build/generated/source/buildConfig/debug/com/qualcomm/ftcrobotcontroller/BuildConfig.java
SHP-Robotics/13981FroshSoft
7d598c671a8660abefe49e23fa247827e35ae691
[ "MIT" ]
2
2019-09-07T21:20:29.000Z
2019-09-07T21:20:53.000Z
FtcRobotController/build/generated/source/buildConfig/debug/com/qualcomm/ftcrobotcontroller/BuildConfig.java
SHP-Robotics/13981FroshSoft
7d598c671a8660abefe49e23fa247827e35ae691
[ "MIT" ]
null
null
null
FtcRobotController/build/generated/source/buildConfig/debug/com/qualcomm/ftcrobotcontroller/BuildConfig.java
SHP-Robotics/13981FroshSoft
7d598c671a8660abefe49e23fa247827e35ae691
[ "MIT" ]
null
null
null
36.684211
113
0.763271
2,479
/** * Automatically generated file. DO NOT MODIFY */ package com.qualcomm.ftcrobotcontroller; public final class BuildConfig { public static final boolean DEBUG = Boolean.parseBoolean("true"); public static final String LIBRARY_PACKAGE_NAME = "com.qualcomm.ftcrobotcontroller"; /** * @deprecated APPLICATION_ID is misleading in libraries. For the library package name use LIBRARY_PACKAGE_NAME */ @Deprecated public static final String APPLICATION_ID = "com.qualcomm.ftcrobotcontroller"; public static final String BUILD_TYPE = "debug"; public static final String FLAVOR = ""; public static final int VERSION_CODE = 33; public static final String VERSION_NAME = "5.1"; }
3e05e50f882d8544e6f099c45861001cc62f610c
1,259
java
Java
core/client/formatfs/src/main/java/alluxio/client/file/cache/remote/netty/message/RemoteReadRequest.java
PasaLab/FSClientCache
6b730f2bc5aae5dd9e0dc13f16555a9ecd8f04d8
[ "Apache-2.0" ]
1
2020-10-21T14:33:52.000Z
2020-10-21T14:33:52.000Z
core/client/formatfs/src/main/java/alluxio/client/file/cache/remote/netty/message/RemoteReadRequest.java
PasaLab/FSClientCache
6b730f2bc5aae5dd9e0dc13f16555a9ecd8f04d8
[ "Apache-2.0" ]
null
null
null
core/client/formatfs/src/main/java/alluxio/client/file/cache/remote/netty/message/RemoteReadRequest.java
PasaLab/FSClientCache
6b730f2bc5aae5dd9e0dc13f16555a9ecd8f04d8
[ "Apache-2.0" ]
1
2021-12-06T11:50:21.000Z
2021-12-06T11:50:21.000Z
20.306452
79
0.679905
2,480
package alluxio.client.file.cache.remote.netty.message; import io.netty.buffer.ByteBuf; import org.apache.commons.lang3.SerializationUtils; import java.util.HashMap; public class RemoteReadRequest extends RPCMessage { private long mFileId; private long mBegin; private long mEnd; public RemoteReadRequest(long fileId, long begin, long end, long messageId) { super(messageId); mFileId = fileId; mBegin = begin; mEnd = end; } public long getFileId() { return mFileId; } public long getBegin() { return mBegin; } public long getEnd() { return mEnd; } @Override public void encode(ByteBuf out) { encodeMessageId(out); out.writeLong(mFileId); out.writeLong(mBegin); out.writeLong(mEnd); } public static RemoteReadRequest decode(ByteBuf in) { long messageId = decodeMessageId(in); return new RemoteReadRequest(in.readLong(), in.readLong(), in .readLong(), messageId); } @Override public int getEncodedLength() { return Long.BYTES * 3 + getMessageIdEncodedlength(); } @Override public Type getType() { return Type.REMOTE_READ_REQUEST; } public String toString() { return "fileId : " + mFileId + " length : " + (mEnd - mBegin); } }
3e05e522b807b5ecdd679bc6fa8f548264086e57
845
java
Java
src/test/java/ag/algorithms/leetcode/solutions/arrays/MeetingRoomsTest.java
attilagyoriid/leetcode_java
dee660155db7a8c87fd06e1b6a9a914d79c8fa83
[ "MIT" ]
null
null
null
src/test/java/ag/algorithms/leetcode/solutions/arrays/MeetingRoomsTest.java
attilagyoriid/leetcode_java
dee660155db7a8c87fd06e1b6a9a914d79c8fa83
[ "MIT" ]
null
null
null
src/test/java/ag/algorithms/leetcode/solutions/arrays/MeetingRoomsTest.java
attilagyoriid/leetcode_java
dee660155db7a8c87fd06e1b6a9a914d79c8fa83
[ "MIT" ]
null
null
null
32.5
171
0.698225
2,481
package ag.algorithms.leetcode.solutions.arrays; import ag.algorithms.leetcode.solutions.model.Interval; import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; class MeetingRoomsTest { @Test void canAttendAll() { MeetingRooms meetingRooms = new MeetingRooms(); boolean canAttend = meetingRooms.canAttendAll(new Interval[]{new Interval(1, 4), new Interval(4, 5), new Interval(5, 8), new Interval(8, 16)}); Assertions.assertThat(canAttend).isTrue(); } @Test void canAttendAll_failure() { MeetingRooms meetingRooms = new MeetingRooms(); boolean canAttend = meetingRooms.canAttendAll(new Interval[]{new Interval(1, 4), new Interval(4, 5), new Interval(5, 8), new Interval(8, 16), new Interval(1, 4)}); Assertions.assertThat(canAttend).isFalse(); } }
3e05e53c9a3a7c5a6dfa1c40d27e5bd314669570
19,698
java
Java
src/main/java/com/android/cglib/p008dx/Code.java
MilkyBoat/present-for-best-TA
e992b3624e253b27cfb2b575651907854c22474a
[ "MIT" ]
12
2019-09-27T10:39:40.000Z
2022-01-06T14:31:48.000Z
src/main/java/com/android/cglib/p008dx/Code.java
MilkyBoat/present-for-best-TA
e992b3624e253b27cfb2b575651907854c22474a
[ "MIT" ]
null
null
null
src/main/java/com/android/cglib/p008dx/Code.java
MilkyBoat/present-for-best-TA
e992b3624e253b27cfb2b575651907854c22474a
[ "MIT" ]
5
2019-09-27T11:57:40.000Z
2022-01-06T14:33:32.000Z
37.236295
189
0.571124
2,482
package com.android.cglib.p008dx; import com.android.cglib.p008dx.p015c.p017b.C0231c; import com.android.cglib.p008dx.p015c.p017b.C0235f; import com.android.cglib.p008dx.p015c.p017b.C0241j; import com.android.cglib.p008dx.p015c.p017b.C0242k; import com.android.cglib.p008dx.p015c.p017b.C0244m; import com.android.cglib.p008dx.p015c.p017b.C0247n; import com.android.cglib.p008dx.p015c.p017b.C0249p; import com.android.cglib.p008dx.p015c.p017b.C0251r; import com.android.cglib.p008dx.p015c.p017b.C0252s; import com.android.cglib.p008dx.p015c.p017b.C0253t; import com.android.cglib.p008dx.p015c.p017b.C0254u; import com.android.cglib.p008dx.p015c.p018c.C0267l; import com.android.cglib.p008dx.p015c.p019d.C0282b; import com.android.cglib.p008dx.p015c.p019d.C0283c; import com.android.cglib.p008dx.p015c.p019d.C0284d; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.List; /* renamed from: com.android.cglib.dx.Code */ public final class Code { /* renamed from: a */ private final MethodId<?, ?> f802a; /* renamed from: b */ private final List<Label> f803b = new ArrayList(); /* renamed from: c */ private Label f804c; /* renamed from: d */ private boolean f805d; /* renamed from: e */ private final Local<?> f806e; /* renamed from: f */ private final List<Local<?>> f807f = new ArrayList(); /* renamed from: g */ private final List<Local<?>> f808g = new ArrayList(); /* renamed from: h */ private C0252s f809h = C0252s.f2000a; /* renamed from: i */ private final List<TypeId<?>> f810i = new ArrayList(); /* renamed from: j */ private final List<Label> f811j = new ArrayList(); /* renamed from: k */ private C0282b f812k = C0282b.f2078a; Code(C0051b bVar) { this.f802a = bVar.f823a; if (bVar.mo1153a()) { this.f806e = null; } else { this.f806e = Local.m860a(this, this.f802a.f850a); this.f807f.add(this.f806e); } for (TypeId<?> a : this.f802a.f853d.f860a) { this.f807f.add(Local.m860a(this, a)); } this.f804c = new Label(); m824a(this.f804c); this.f804c.f841c = true; } /* renamed from: a */ private <T> Local<T> m820a(Local<?> local, TypeId<T> typeId) { if (local.f846a.equals(typeId)) { return local; } StringBuilder sb = new StringBuilder(); sb.append("requested "); sb.append(typeId); sb.append(" but was "); sb.append(local.f846a); throw new IllegalArgumentException(sb.toString()); } /* renamed from: a */ private static C0247n m821a(Local<?> local, Local<?>[] localArr) { int i = local != null ? 1 : 0; C0247n nVar = new C0247n(localArr.length + i); if (local != null) { nVar.mo1612a(0, local.mo1167b()); } for (int i2 = 0; i2 < localArr.length; i2++) { nVar.mo1612a(i2 + i, localArr[i2].mo1167b()); } return nVar; } /* renamed from: a */ private C0249p m822a(C0283c cVar, C0283c cVar2) { if (cVar.mo1591c() == 6) { int c = cVar2.mo1591c(); if (c == 8) { return C0251r.f1920bv; } switch (c) { case 2: return C0251r.f1918bt; case 3: return C0251r.f1919bu; } } return C0251r.m1784a(cVar2, cVar); } /* renamed from: a */ private C0282b m823a(List<TypeId<?>> list) { C0282b bVar = new C0282b(list.size()); for (int i = 0; i < list.size(); i++) { bVar.mo1720a(i, ((TypeId) list.get(i)).f858b); } return bVar; } /* renamed from: a */ private void m824a(Label label) { if (label.f840b != this) { if (label.f840b != null) { throw new IllegalArgumentException("Cannot adopt label; it belongs to another Code"); } label.f840b = this; this.f803b.add(label); } } /* renamed from: a */ private void m825a(Label label, List<Label> list) { Label label2 = new Label(); m824a(label2); this.f804c.f843e = label2; this.f804c.f844f = label; this.f804c.f842d = list; this.f804c = label2; this.f804c.f841c = true; } /* renamed from: a */ private void m826a(Local<?> local, boolean z) { m827a((C0235f) new C0242k(z ? C0251r.m1795d((C0284d) local.f846a.f858b) : C0251r.m1792c((C0284d) local.f846a.f858b), this.f809h, local.mo1167b(), C0247n.f1778a)); } /* renamed from: a */ private void m827a(C0235f fVar) { m828a(fVar, (Label) null); } /* renamed from: a */ private void m828a(C0235f fVar, Label label) { if (this.f804c == null || !this.f804c.f841c) { throw new IllegalStateException("no current label"); } this.f804c.f839a.add(fVar); int b = fVar.mo1563d().mo1629b(); if (b != 6) { switch (b) { case 1: if (label != null) { StringBuilder sb = new StringBuilder(); sb.append("unexpected branch: "); sb.append(label); throw new IllegalArgumentException(sb.toString()); } return; case 2: if (label != null) { StringBuilder sb2 = new StringBuilder(); sb2.append("unexpected branch: "); sb2.append(label); throw new IllegalArgumentException(sb2.toString()); } break; case 3: if (label != null) { this.f804c.f843e = label; break; } else { throw new IllegalArgumentException("branch == null"); } case 4: if (label == null) { throw new IllegalArgumentException("branch == null"); } m825a(label, Collections.emptyList()); return; default: throw new IllegalArgumentException(); } this.f804c = null; } else if (label != null) { StringBuilder sb3 = new StringBuilder(); sb3.append("unexpected branch: "); sb3.append(label); throw new IllegalArgumentException(sb3.toString()); } else { m825a((Label) null, (List<Label>) new ArrayList<Label>(this.f811j)); } } /* renamed from: a */ private <D, R> void m829a(C0249p pVar, MethodId<D, R> methodId, Local<? super R> local, Local<? extends D> local2, Local<?>... localArr) { C0253t tVar = new C0253t(pVar, this.f809h, m821a(local2, localArr), this.f812k, methodId.f855f); m827a((C0235f) tVar); if (local != null) { m826a(local, false); } } /* renamed from: d */ private void m830d() { Iterator it = this.f803b.iterator(); int i = 0; while (it.hasNext()) { Label label = (Label) it.next(); if (label.mo1162a()) { it.remove(); } else { label.mo1163b(); int i2 = i + 1; label.f845g = i; i = i2; } } } /* access modifiers changed from: 0000 */ /* renamed from: a */ public void mo1106a() { if (this.f805d) { throw new AssertionError(); } this.f805d = true; int i = 0; for (Local a : this.f808g) { i += a.mo1166a(i); } ArrayList arrayList = new ArrayList(); int i2 = i; for (Local local : this.f807f) { C0267l a2 = C0267l.m1882a(i2 - i); i2 += local.mo1166a(i2); C0241j jVar = new C0241j(C0251r.m1789b((C0284d) local.f846a.f858b), this.f809h, local.mo1167b(), C0247n.f1778a, a2); arrayList.add(jVar); } ((Label) this.f803b.get(0)).f839a.addAll(0, arrayList); } public void addCatchClause(TypeId<? extends Throwable> typeId, Label label) { if (this.f810i.contains(typeId)) { StringBuilder sb = new StringBuilder(); sb.append("Already caught: "); sb.append(typeId); throw new IllegalArgumentException(sb.toString()); } m824a(label); this.f810i.add(typeId); this.f812k = m823a(this.f810i); this.f811j.add(label); } public void aget(Local<?> local, Local<?> local2, Local<Integer> local3) { m827a((C0235f) new C0254u(C0251r.m1810k((C0284d) local.f846a.f858b), this.f809h, C0247n.m1754a(local2.mo1167b(), local3.mo1167b()), this.f812k)); m826a(local, true); } public void aput(Local<?> local, Local<Integer> local2, Local<?> local3) { m827a((C0235f) new C0254u(C0251r.m1812l((C0284d) local3.f846a.f858b), this.f809h, C0247n.m1755a(local3.mo1167b(), local.mo1167b(), local2.mo1167b()), this.f812k)); } public <T> void arrayLength(Local<Integer> local, Local<T> local2) { m827a((C0235f) new C0254u(C0251r.f1875bC, this.f809h, C0247n.m1753a(local2.mo1167b()), this.f812k)); m826a(local, true); } /* access modifiers changed from: 0000 */ /* renamed from: b */ public int mo1111b() { int i = 0; for (Local a : this.f807f) { i += a.mo1165a(); } return i; } /* access modifiers changed from: 0000 */ /* renamed from: c */ public C0231c mo1112c() { if (!this.f805d) { mo1106a(); } m830d(); C0231c cVar = new C0231c(this.f803b.size()); for (int i = 0; i < this.f803b.size(); i++) { cVar.mo1552a(i, ((Label) this.f803b.get(i)).mo1164c()); } return cVar; } public void cast(Local<?> local, Local<?> local2) { if (local2.getType().f858b.mo1733j()) { C0253t tVar = new C0253t(C0251r.f1958ch, this.f809h, C0247n.m1753a(local2.mo1167b()), this.f812k, local.f846a.f859c); m827a((C0235f) tVar); m826a(local, true); return; } m827a((C0235f) new C0242k(m822a(local2.f846a.f858b, local.f846a.f858b), this.f809h, local.mo1167b(), local2.mo1167b())); } public <T> void compare(Comparison comparison, Label label, Local<T> local, Local<T> local2) { m824a(label); m828a((C0235f) new C0242k(comparison.rop(C0282b.m1956a(local.f846a.f858b, local2.f846a.f858b)), this.f809h, (C0244m) null, C0247n.m1754a(local.mo1167b(), local2.mo1167b())), label); } public <T extends Number> void compareFloatingPoint(Local<Integer> local, Local<T> local2, Local<T> local3, int i) { C0249p pVar; if (i == 1) { pVar = C0251r.m1806i((C0284d) local2.f846a.f858b); } else if (i == -1) { pVar = C0251r.m1804h((C0284d) local2.f846a.f858b); } else { StringBuilder sb = new StringBuilder(); sb.append("expected 1 or -1 but was "); sb.append(i); throw new IllegalArgumentException(sb.toString()); } m827a((C0235f) new C0242k(pVar, this.f809h, local.mo1167b(), C0247n.m1754a(local2.mo1167b(), local3.mo1167b()))); } public void compareLongs(Local<Integer> local, Local<Long> local2, Local<Long> local3) { m827a((C0235f) new C0242k(C0251r.f1901bc, this.f809h, local.mo1167b(), C0247n.m1754a(local2.mo1167b(), local3.mo1167b()))); } public <T> Local<T> getParameter(int i, TypeId<T> typeId) { if (this.f806e != null) { i++; } return m820a((Local) this.f807f.get(i), typeId); } public <T> Local<T> getThis(TypeId<T> typeId) { if (this.f806e != null) { return m820a(this.f806e, typeId); } throw new IllegalStateException("static methods cannot access 'this'"); } public <D, V> void iget(FieldId<D, V> fieldId, Local<V> local, Local<D> local2) { C0253t tVar = new C0253t(C0251r.m1816n((C0284d) local.f846a.f858b), this.f809h, C0247n.m1753a(local2.mo1167b()), this.f812k, fieldId.f838e); m827a((C0235f) tVar); m826a(local, true); } public void instanceOfType(Local<?> local, Local<?> local2, TypeId<?> typeId) { C0253t tVar = new C0253t(C0251r.f1959ci, this.f809h, C0247n.m1753a(local2.mo1167b()), this.f812k, typeId.f859c); m827a((C0235f) tVar); m826a(local, true); } public <D, R> void invokeDirect(MethodId<D, R> methodId, Local<? super R> local, Local<? extends D> local2, Local<?>... localArr) { m829a(C0251r.m1794d(methodId.mo1171b(true)), methodId, local, local2, localArr); } public <D, R> void invokeInterface(MethodId<D, R> methodId, Local<? super R> local, Local<? extends D> local2, Local<?>... localArr) { m829a(C0251r.m1797e(methodId.mo1171b(true)), methodId, local, local2, localArr); } public <R> void invokeStatic(MethodId<?, R> methodId, Local<? super R> local, Local<?>... localArr) { m829a(C0251r.m1782a(methodId.mo1171b(true)), methodId, local, null, localArr); } public <D, R> void invokeSuper(MethodId<D, R> methodId, Local<? super R> local, Local<? extends D> local2, Local<?>... localArr) { m829a(C0251r.m1791c(methodId.mo1171b(true)), methodId, local, local2, localArr); } public <D, R> void invokeVirtual(MethodId<D, R> methodId, Local<? super R> local, Local<? extends D> local2, Local<?>... localArr) { m829a(C0251r.m1788b(methodId.mo1171b(true)), methodId, local, local2, localArr); } public <D, V> void iput(FieldId<D, V> fieldId, Local<D> local, Local<V> local2) { C0253t tVar = new C0253t(C0251r.m1818o((C0284d) local2.f846a.f858b), this.f809h, C0247n.m1754a(local2.mo1167b(), local.mo1167b()), this.f812k, fieldId.f838e); m827a((C0235f) tVar); } public void jump(Label label) { m824a(label); m828a((C0235f) new C0242k(C0251r.f1992s, this.f809h, (C0244m) null, C0247n.f1778a), label); } public <T> void loadConstant(Local<T> local, T t) { C0249p e = t == null ? C0251r.f1991r : C0251r.m1798e((C0284d) local.f846a.f858b); if (e.mo1629b() == 1) { C0241j jVar = new C0241j(e, this.f809h, local.mo1167b(), C0247n.f1778a, Constants.m836a(t)); m827a((C0235f) jVar); return; } C0253t tVar = new C0253t(e, this.f809h, C0247n.f1778a, this.f812k, Constants.m836a(t)); m827a((C0235f) tVar); m826a(local, true); } public void mark(Label label) { m824a(label); if (label.f841c) { throw new IllegalStateException("already marked"); } label.f841c = true; if (this.f804c != null) { jump(label); } this.f804c = label; } public void monitorEnter(Local<?> local) { m827a((C0235f) new C0254u(C0251r.f1877bE, this.f809h, C0247n.m1753a(local.mo1167b()), this.f812k)); } public void monitorExit(Local<?> local) { m827a((C0235f) new C0254u(C0251r.f1877bE, this.f809h, C0247n.m1753a(local.mo1167b()), this.f812k)); } public <T> void move(Local<T> local, Local<T> local2) { m827a((C0235f) new C0242k(C0251r.m1783a((C0284d) local2.f846a.f858b), this.f809h, local.mo1167b(), local2.mo1167b())); } public <T> void newArray(Local<T> local, Local<Integer> local2) { C0253t tVar = new C0253t(C0251r.m1814m((C0284d) local.f846a.f858b), this.f809h, C0247n.m1753a(local2.mo1167b()), this.f812k, local.f846a.f859c); m827a((C0235f) tVar); m826a(local, true); } public <T> void newInstance(Local<T> local, MethodId<T, Void> methodId, Local<?>... localArr) { if (local == null) { throw new IllegalArgumentException(); } C0253t tVar = new C0253t(C0251r.f1897bY, this.f809h, C0247n.f1778a, this.f812k, methodId.f850a.f859c); m827a((C0235f) tVar); m826a(local, true); invokeDirect(methodId, null, local, localArr); } public <T> Local<T> newLocal(TypeId<T> typeId) { if (this.f805d) { throw new IllegalStateException("Cannot allocate locals after adding instructions"); } Local<T> a = Local.m860a(this, typeId); this.f808g.add(a); return a; } /* renamed from: op */ public <T1, T2> void mo1136op(BinaryOp binaryOp, Local<T1> local, Local<T1> local2, Local<T2> local3) { C0249p rop = binaryOp.rop(C0282b.m1956a(local2.f846a.f858b, local3.f846a.f858b)); C0247n a = C0247n.m1754a(local2.mo1167b(), local3.mo1167b()); if (rop.mo1629b() == 1) { m827a((C0235f) new C0242k(rop, this.f809h, local.mo1167b(), a)); return; } m827a((C0235f) new C0254u(rop, this.f809h, a, this.f812k)); m826a(local, true); } /* renamed from: op */ public <T> void mo1137op(UnaryOp unaryOp, Local<T> local, Local<T> local2) { m827a((C0235f) new C0242k(unaryOp.rop(local2.f846a), this.f809h, local.mo1167b(), local2.mo1167b())); } public Label removeCatchClause(TypeId<? extends Throwable> typeId) { int indexOf = this.f810i.indexOf(typeId); if (indexOf == -1) { StringBuilder sb = new StringBuilder(); sb.append("No catch clause: "); sb.append(typeId); throw new IllegalArgumentException(sb.toString()); } this.f810i.remove(indexOf); this.f812k = m823a(this.f810i); return (Label) this.f811j.remove(indexOf); } public void returnValue(Local<?> local) { if (!local.f846a.equals(this.f802a.f851b)) { StringBuilder sb = new StringBuilder(); sb.append("declared "); sb.append(this.f802a.f851b); sb.append(" but returned "); sb.append(local.f846a); throw new IllegalArgumentException(sb.toString()); } m827a((C0235f) new C0242k(C0251r.m1808j((C0284d) local.f846a.f858b), this.f809h, (C0244m) null, C0247n.m1753a(local.mo1167b()))); } public void returnVoid() { if (!this.f802a.f851b.equals(TypeId.VOID)) { StringBuilder sb = new StringBuilder(); sb.append("declared "); sb.append(this.f802a.f851b); sb.append(" but returned void"); throw new IllegalArgumentException(sb.toString()); } m827a((C0235f) new C0242k(C0251r.f1921bw, this.f809h, (C0244m) null, C0247n.f1778a)); } public <V> void sget(FieldId<?, V> fieldId, Local<V> local) { C0253t tVar = new C0253t(C0251r.m1820p((C0284d) local.f846a.f858b), this.f809h, C0247n.f1778a, this.f812k, fieldId.f838e); m827a((C0235f) tVar); m826a(local, true); } public <V> void sput(FieldId<?, V> fieldId, Local<V> local) { C0253t tVar = new C0253t(C0251r.m1822q((C0284d) local.f846a.f858b), this.f809h, C0247n.m1753a(local.mo1167b()), this.f812k, fieldId.f838e); m827a((C0235f) tVar); } public void throwValue(Local<? extends Throwable> local) { m827a((C0235f) new C0254u(C0251r.f1876bD, this.f809h, C0247n.m1753a(local.mo1167b()), this.f812k)); } }
3e05e750239c06571a7dd43edb19dc32faccf066
2,285
java
Java
adcom/adcshdwr.server/src/main/java/org/adorsys/adcshdwr/rest/CdrDsHstryEJB.java
francis-pouatcha/adcom
0e3ea1ce6c2045d31c7003fc87dbda533c09c767
[ "Apache-2.0" ]
null
null
null
adcom/adcshdwr.server/src/main/java/org/adorsys/adcshdwr/rest/CdrDsHstryEJB.java
francis-pouatcha/adcom
0e3ea1ce6c2045d31c7003fc87dbda533c09c767
[ "Apache-2.0" ]
null
null
null
adcom/adcshdwr.server/src/main/java/org/adorsys/adcshdwr/rest/CdrDsHstryEJB.java
francis-pouatcha/adcom
0e3ea1ce6c2045d31c7003fc87dbda533c09c767
[ "Apache-2.0" ]
null
null
null
24.569892
123
0.713348
2,483
package org.adorsys.adcshdwr.rest; import java.util.List; import javax.ejb.Stateless; import javax.enterprise.event.Event; import javax.inject.Inject; import javax.persistence.metamodel.SingularAttribute; import org.adorsys.adbase.enums.BaseHistoryTypeEnum; import org.adorsys.adcshdwr.event.CdrDrctSalesClosedEvent; import org.adorsys.adcshdwr.jpa.CdrDsHstry; import org.adorsys.adcshdwr.repo.CdrDsHstryRepository; @Stateless public class CdrDsHstryEJB { @Inject private CdrDsHstryRepository repository; @Inject @CdrDrctSalesClosedEvent private Event<CdrDsHstry> cdrDrctSalesClosedEvent; public CdrDsHstry create(CdrDsHstry entity) { CdrDsHstry cdrDsHstry = repository.save(attach(entity)); if (BaseHistoryTypeEnum.CLOSED.name().equals(cdrDsHstry.getHstryType())) { cdrDrctSalesClosedEvent.fire(cdrDsHstry); } return cdrDsHstry; } public CdrDsHstry deleteById(String id) { CdrDsHstry entity = repository.findBy(id); if (entity != null) { repository.remove(entity); } return entity; } public CdrDsHstry update(CdrDsHstry entity) { return repository.save(attach(entity)); } public CdrDsHstry findById(String id) { return repository.findBy(id); } public List<CdrDsHstry> listAll(int start, int max) { return repository.findAll(start, max); } public Long count() { return repository.count(); } public List<CdrDsHstry> findBy(CdrDsHstry entity, int start, int max, SingularAttribute<CdrDsHstry, ?>[] attributes) { return repository.findBy(entity, start, max, attributes); } public Long countBy(CdrDsHstry entity, SingularAttribute<CdrDsHstry, ?>[] attributes) { return repository.count(entity, attributes); } public List<CdrDsHstry> findByLike(CdrDsHstry entity, int start, int max, SingularAttribute<CdrDsHstry, ?>[] attributes) { return repository.findByLike(entity, start, max, attributes); } public Long countByLike(CdrDsHstry entity, SingularAttribute<CdrDsHstry, ?>[] attributes) { return repository.countLike(entity, attributes); } private CdrDsHstry attach(CdrDsHstry entity) { if (entity == null) return null; return entity; } }
3e05e7f009e59c148fbcd82a8b2a514f6f488a03
361
java
Java
app/src/main/java/com/mxt/anitrend/base/interfaces/view/CustomView.java
wax911/AniTrend-App
52b8d1d57d84a3ae7790c8c6f9069dadf8927afa
[ "MIT" ]
183
2018-04-22T16:46:56.000Z
2022-03-31T08:07:24.000Z
app/src/main/java/com/mxt/anitrend/base/interfaces/view/CustomView.java
wax911/AniTrend-App
52b8d1d57d84a3ae7790c8c6f9069dadf8927afa
[ "MIT" ]
199
2018-04-07T18:45:17.000Z
2021-12-31T19:16:23.000Z
app/src/main/java/com/mxt/anitrend/base/interfaces/view/CustomView.java
Kadantte/anitrend-app
685795c16b22ebc590841a43125f71ed67b0994a
[ "MIT" ]
41
2018-05-07T21:35:24.000Z
2022-01-23T05:27:36.000Z
18.05
57
0.648199
2,484
package com.mxt.anitrend.base.interfaces.view; /** * Created by max on 2017/06/24. * Designed to init constructors for custom views */ public interface CustomView { /** * Optionally included when constructing custom views */ void onInit(); /** * Clean up any resources that won't be needed */ void onViewRecycled(); }
3e05e8b04dde20da05459074d9f9fdf4cdb7abb4
578
java
Java
lazyStaticInitialization/src/main/java/org/johara/provider/DclInstanceConfigProvider.java
johnaohara/perf-testing
ccda31fc40f3a61e6e45bb6e03901693339269fc
[ "Apache-2.0" ]
null
null
null
lazyStaticInitialization/src/main/java/org/johara/provider/DclInstanceConfigProvider.java
johnaohara/perf-testing
ccda31fc40f3a61e6e45bb6e03901693339269fc
[ "Apache-2.0" ]
null
null
null
lazyStaticInitialization/src/main/java/org/johara/provider/DclInstanceConfigProvider.java
johnaohara/perf-testing
ccda31fc40f3a61e6e45bb6e03901693339269fc
[ "Apache-2.0" ]
1
2020-05-29T14:39:04.000Z
2020-05-29T14:39:04.000Z
27.52381
66
0.608997
2,485
package org.johara.provider; import org.johara.config.ConfigFactory; public class DclInstanceConfigProvider { private volatile String defaultConfigValue; public String getDefaultConfigValue() { if (defaultConfigValue == null) { synchronized (DclInstanceConfigProvider.class) { if (defaultConfigValue == null) { defaultConfigValue = ConfigFactory.getConfig() .getValue(ConfigFactory.CONFIG_ITEM);; } } } return defaultConfigValue; } }
3e05ea13cd2f27d5a69683df587d563ae6c796bf
145
java
Java
src/main/java/com/fererlab/pattern/structural/bridge/inheritance/ShapeInheritance.java
canmogol/design-patterns
16146bd7425afd554418db0d421937738595561a
[ "MIT" ]
1
2021-10-03T13:22:09.000Z
2021-10-03T13:22:09.000Z
src/main/java/com/fererlab/pattern/structural/bridge/inheritance/ShapeInheritance.java
canmogol/design-patterns
16146bd7425afd554418db0d421937738595561a
[ "MIT" ]
null
null
null
src/main/java/com/fererlab/pattern/structural/bridge/inheritance/ShapeInheritance.java
canmogol/design-patterns
16146bd7425afd554418db0d421937738595561a
[ "MIT" ]
null
null
null
18.125
59
0.793103
2,486
package com.fererlab.pattern.structural.bridge.inheritance; public abstract class ShapeInheritance { public abstract void applyColor(); }
3e05ead832a88b0a36af90630da93470516db007
4,630
java
Java
src/test/java/fr/ippon/tatami/service/GroupServiceTest.java
hegek87/tatami
9908ff8cecf1ed6898d8f5fe169d2f34f75f02f7
[ "Apache-2.0" ]
151
2015-01-11T19:03:26.000Z
2022-02-07T10:37:50.000Z
services/src/test/java/fr/ippon/tatami/service/GroupServiceTest.java
qiuwei/tatami
90fdbfc474dca03ede431460237a80f8e442cbe3
[ "Apache-2.0" ]
90
2015-03-09T13:31:48.000Z
2021-01-12T04:57:20.000Z
services/src/test/java/fr/ippon/tatami/service/GroupServiceTest.java
qiuwei/tatami
90fdbfc474dca03ede431460237a80f8e442cbe3
[ "Apache-2.0" ]
110
2015-01-05T18:17:49.000Z
2022-02-07T10:37:52.000Z
39.683761
103
0.710963
2,487
package fr.ippon.tatami.service; import fr.ippon.tatami.AbstractCassandraTatamiTest; import fr.ippon.tatami.domain.Group; import fr.ippon.tatami.domain.User; import fr.ippon.tatami.security.AuthenticationService; import fr.ippon.tatami.service.dto.UserGroupDTO; import org.junit.Test; import org.springframework.test.util.ReflectionTestUtils; import javax.inject.Inject; import java.util.Collection; import static org.junit.Assert.*; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; public class GroupServiceTest extends AbstractCassandraTatamiTest { @Inject public UserService userService; @Inject public GroupService groupService; @Test public void createAndGetGroup() { mockAuthentication("[email protected]"); User user = userService.getUserByLogin("[email protected]"); String groupName = "Group name"; String groupDescription = "Group description"; boolean publicGroup = true; groupService.createGroup(groupName, groupDescription, publicGroup); Collection<Group> groups = groupService.getGroupsForUser(user); assertEquals(1, groups.size()); String groupId = groups.iterator().next().getGroupId(); Group group = groupService.getGroupById("ippon.fr", groupId); assertEquals(groupName, group.getName()); assertEquals(groupDescription, group.getDescription()); assertTrue(group.isPublicGroup()); assertFalse(group.isArchivedGroup()); } @Test public void createGroup() { mockAuthentication("[email protected]"); User user = userService.getUserByLogin("[email protected]"); assertEquals(0, groupService.getGroupsForUser(user).size()); String groupName = "Group name"; String groupDescription = "Group description"; boolean publicGroup = true; groupService.createGroup(groupName, groupDescription, publicGroup); Collection<Group> groups = groupService.getGroupsForUser(user); assertEquals(1, groups.size()); Group group = groups.iterator().next(); assertEquals(groupName, group.getName()); assertEquals(groupDescription, group.getDescription()); assertTrue(group.isPublicGroup()); assertFalse(group.isArchivedGroup()); } @Test public void addAndRemoveGroupMember() { mockAuthentication("[email protected]"); User user = userService.getUserByLogin("[email protected]"); assertEquals(0, groupService.getGroupsForUser(user).size()); String groupName = "Group name"; String groupDescription = "Group description"; boolean publicGroup = true; groupService.createGroup(groupName, groupDescription, publicGroup); Collection<Group> groups = groupService.getGroupsForUser(user); assertEquals(1, groups.size()); Group group = groups.iterator().next(); String groupId = group.getGroupId(); User member = userService.getUserByLogin("[email protected]"); assertEquals(1, groupService.getGroupsForUser(user).size()); assertEquals(0, groupService.getGroupsForUser(member).size()); Collection<UserGroupDTO> members = groupService.getMembersForGroup(groupId, user.getLogin()); assertEquals(1, members.size()); groupService.addMemberToGroup(member, group); members = groupService.getMembersForGroup(groupId, user.getLogin()); assertEquals(2, members.size()); assertEquals(1, groupService.getGroupsForUser(user).size()); assertEquals(1, groupService.getGroupsForUser(member).size()); groupService.removeMemberFromGroup(member, group); members = groupService.getMembersForGroup(groupId, user.getLogin()); assertEquals(1, members.size()); assertEquals(1, groupService.getGroupsForUser(user).size()); assertEquals(0, groupService.getGroupsForUser(member).size()); // Clean up groupService.removeMemberFromGroup(user, group); assertEquals(0, groupService.getGroupsForUser(user).size()); } private void mockAuthentication(String login) { User authenticateUser = constructAUser(login); AuthenticationService mockAuthenticationService = mock(AuthenticationService.class); when(mockAuthenticationService.getCurrentUser()).thenReturn(authenticateUser); ReflectionTestUtils.setField(groupService, "authenticationService", mockAuthenticationService); ReflectionTestUtils.setField(userService, "authenticationService", mockAuthenticationService); } }
3e05eb290bc417ec5d25411233af93cfe5e36c46
5,134
java
Java
src/team492/FrcDisabled.java
coolioasjulio/Frc2018FirstPowerUp
43ddbfb67e247f908650a5201593d177c6b9c203
[ "MIT" ]
9
2018-01-14T04:29:09.000Z
2019-01-06T02:19:04.000Z
src/team492/FrcDisabled.java
coolioasjulio/Frc2018FirstPowerUp
43ddbfb67e247f908650a5201593d177c6b9c203
[ "MIT" ]
2
2018-09-25T16:34:43.000Z
2019-03-29T19:54:31.000Z
src/team492/FrcDisabled.java
coolioasjulio/Frc2018FirstPowerUp
43ddbfb67e247f908650a5201593d177c6b9c203
[ "MIT" ]
3
2018-06-26T00:04:24.000Z
2018-07-16T23:22:49.000Z
34.92517
115
0.573042
2,488
/* * Copyright (c) 2018 Titan Robotics Club (http://www.titanrobotics.com) * * 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 team492; import trclib.TrcRobot; import trclib.TrcUtil; import trclib.TrcRobot.RunMode; public class FrcDisabled implements TrcRobot.RobotMode { private static final String moduleName = "FrcDisabled"; private enum State { START, ENTER_RUN_MODE, EXIT_RUN_MODE, EXIT_TELEOP_MODE } private Robot robot; private State state; public FrcDisabled(Robot robot) { this.robot = robot; state = State.START; } // FrcDisabled // // Implements TrcRobot.RunMode interface. // @Override public void startMode(RunMode prevMode) { final String funcName = moduleName + ".startMode"; switch (state) { case EXIT_RUN_MODE: case EXIT_TELEOP_MODE: if (state == State.EXIT_TELEOP_MODE) { // // Exiting competition, close the log with proper FMS info as the log file name. // robot.closeTraceLog( String.format("%s_%s%03d", robot.eventName, robot.matchType, robot.matchNumber)); } else { // // Exiting test or practice mode, close the log with appropriate mode name. // robot.closeTraceLog(prevMode.toString()); } state = State.START; // // Let it fall through to the START state so it can open a new log file for the next run which // may not happen if the robot will be turned off. In that case, we will leave an orphaned Temp.log // file. That's okay. Just want to explain why the folder will be littered with Temp.log files. // case START: // // Opening trace log at the start of Disabled mode to avoid the 0.5 second penalty to autonomous // start. However, the trace log file will not have the proper name with FMS info since valid FMS // info cannot be obtained at this time. Therefore, we have this elaborate state machine to keep // track of what run mode we are in so we can get the FMS info at appropriate time and rename the // trace log file to its proper name when closing. // double startTime = TrcUtil.getCurrentTime(); robot.openTraceLog("Temp"); robot.setTraceLogEnabled(true); robot.globalTracer.traceInfo( funcName, "OpenTraceLog elapsed time = %.3f", TrcUtil.getCurrentTime() - startTime); robot.setTraceLogEnabled(false); state = State.ENTER_RUN_MODE; break; default: break; } } // startMode @Override public void stopMode(RunMode nextMode) { switch (state) { case ENTER_RUN_MODE: if (nextMode == RunMode.AUTO_MODE && robot.ds.isFMSAttached()) { // // Entering competition match, get FMS info. // robot.getFMSInfo(); state = State.EXIT_TELEOP_MODE; } else { // // Entering test or practice mode. // state = State.EXIT_RUN_MODE; } break; default: break; } } // stopMode @Override public void runPeriodic(double elapsedTime) { robot.updateDashboard(RunMode.DISABLED_MODE); robot.announceIdling(); } // runPeriodic @Override public void runContinuous(double elapsedTime) { } // runContinuous } // class FrcDisabled
3e05ecd7a6bc2bc104423e816237c0ac1abf5066
2,629
java
Java
app/src/main/java/com/example/dell/proyecto_final_one/InternetActivity.java
darwinjm/Proyecto-Final--Stady-Jam-2017
a7b0aa55532b64f6c82a1212b1b958af665887ff
[ "MIT" ]
1
2019-04-08T05:05:00.000Z
2019-04-08T05:05:00.000Z
app/src/main/java/com/example/dell/proyecto_final_one/InternetActivity.java
darwinjm/Proyecto-Final--Stady-Jam-2017
a7b0aa55532b64f6c82a1212b1b958af665887ff
[ "MIT" ]
null
null
null
app/src/main/java/com/example/dell/proyecto_final_one/InternetActivity.java
darwinjm/Proyecto-Final--Stady-Jam-2017
a7b0aa55532b64f6c82a1212b1b958af665887ff
[ "MIT" ]
null
null
null
35.053333
173
0.69418
2,489
package com.example.dell.proyecto_final_one; import android.content.Intent; import android.net.Uri; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.ImageButton; public class InternetActivity extends AppCompatActivity { private ImageButton botones; private Intent intent; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_internet); } public void libro1(View view) { intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse("http://upcommons.upc.edu/bitstream/handle/2117/21190/Contabilidad+para+todos.pdf;jsessionid=79F592B5DBC7E40AFB03D00F668C1A52?sequence=1")); startActivity(intent); } public void Face(View view) { intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse("https://www.facebook.com/groups/umsacontaduriapublica/?hc_ref=PAGES_TIMELINE")); startActivity(intent); } public void libro2(View view) { intent=new Intent(intent.ACTION_VIEW); intent.setData(Uri.parse("https://vparrales.files.wordpress.com/2012/08/14074128-primer-curso-de-contabilidad-elias-lara-flores-trillas-16a-edicion2.pdf")); startActivity(intent); } public void libro3(View view) { intent=new Intent(intent.ACTION_VIEW); intent.setData(Uri.parse("https://www.uaeh.edu.mx/investigacion/productos/4773/contabilidad.pdf")); startActivity(intent); } public void libro4(View view) { intent=new Intent(intent.ACTION_VIEW); intent.setData(Uri.parse("http://www.facebook.com")); startActivity(intent); } public void libro5(View view) { intent=new Intent(intent.ACTION_VIEW); intent.setData(Uri.parse("http://www.editorialpatria.com.mx/pdffiles/9786074386189.pdf")); startActivity(intent); } public void libro6(View view) { intent=new Intent(intent.ACTION_VIEW); intent.setData(Uri.parse("http://fade.espoch.edu.ec/libros/Contabilidad-basica.pdf")); startActivity(intent); } public void libro7(View view) { intent=new Intent(intent.ACTION_VIEW); intent.setData(Uri.parse("http://vmpc.economiayfinanzas.gob.bo/financiera0.asp")); startActivity(intent); } public void face2(View view) { intent=new Intent(intent.ACTION_VIEW); intent.setData(Uri.parse("https://www.facebook.com/groups/solocontaduriacpu/")); startActivity(intent); } }
3e05ed3471524b5c305a82ab46f5cc4ccb1cfd01
3,172
java
Java
CBP/library/api/fermat-cbp-api/src/main/java/com/bitdubai/fermat_cbp_api/all_definition/business_transaction/CryptoMoneyTransaction.java
guillermo20/fermat
f0a912adb66a439023ec4e70b821ba397e0f7760
[ "MIT" ]
3
2016-03-23T05:26:51.000Z
2016-03-24T14:33:05.000Z
CBP/library/api/fermat-cbp-api/src/main/java/com/bitdubai/fermat_cbp_api/all_definition/business_transaction/CryptoMoneyTransaction.java
yalayn/fermat
f0a912adb66a439023ec4e70b821ba397e0f7760
[ "MIT" ]
17
2015-11-20T20:43:17.000Z
2016-07-25T20:35:49.000Z
CBP/library/api/fermat-cbp-api/src/main/java/com/bitdubai/fermat_cbp_api/all_definition/business_transaction/CryptoMoneyTransaction.java
yalayn/fermat
f0a912adb66a439023ec4e70b821ba397e0f7760
[ "MIT" ]
26
2015-11-20T13:20:23.000Z
2022-03-11T07:50:06.000Z
27.824561
103
0.692623
2,490
package com.bitdubai.fermat_cbp_api.all_definition.business_transaction; import com.bitdubai.fermat_api.layer.all_definition.enums.CryptoCurrency; import com.bitdubai.fermat_cbp_api.all_definition.enums.OriginTransaction; import com.bitdubai.fermat_cbp_api.all_definition.enums.TransactionStatusRestockDestock; import java.math.BigDecimal; import java.sql.Timestamp; import java.util.UUID; /** * Created by franklin on 16/11/15. */ public interface CryptoMoneyTransaction { //TODO: Documentar /** * The property <code>TransactionId</code> represented identifier the record * * @return the UUID */ UUID getTransactionId(); void setTransactionId(UUID transactionId); /** * The property <code>ActorPublicKey</code> represented the public key Actor * * @return the Sting */ String getActorPublicKey(); void setActorPublicKey(String actorPublicKey); /** * The property <code>CryptoCurrency</code> represented the Crypto Currency * * @return the CryptoCurrency */ CryptoCurrency getCryptoCurrency(); void setCryptoCurrency(CryptoCurrency cryptoCurrency); /** * The property <code>WalletPublicKey</code> represented the public key Wallet * * @return the Sting */ String getCbpWalletPublicKey(); void setCbpWalletPublicKey(String cbpWalletPublicKey); /** * The property <code>getCryWalletPublicKey</code> represented the public key Bitcoin Wallet * * @return the Sting */ String getCryWalletPublicKey(); void setCryWalletPublicKey(String cryWalletPublicKey); /** * The property <code>Concept</code> represented the public key Bank * * @return the Sting */ String getConcept(); void setConcept(String concept); /** * The property <code>Amount</code> represented the amount in transaction * * @return the BigDecimal */ BigDecimal getAmount(); void setAmount(BigDecimal amount); /** * The property <code>Timestamp</code> represented the Date in transaction * * @return the Timestamp */ Timestamp getTimeStamp(); void setTimeStamp(Timestamp timeStamp); /** * The property <code>Memo</code> represented the Memo transaction * * @return the Sting */ String getMemo(); void setMemo(String memo); /** * The property <code>TransactionStatusRestockDestock</code> represented the Status in transaction * * @return the Sting */ TransactionStatusRestockDestock getTransactionStatus(); void setTransactionStatus(TransactionStatusRestockDestock transactionStatus); /** * The property <code>PriceReference</code> represented the Price Reference * @return BigDecimal */ BigDecimal getPriceReference(); void setPriceReference(BigDecimal priceReference); /** * The property <code>OriginTransaction</code> represented the Origin Transaction * * @return the OriginTransaction */ OriginTransaction getOriginTransaction(); void setOriginTransaction(OriginTransaction originTransaction); }
3e05ed9f4da190e5b89899404cd0dea022a3d531
3,773
java
Java
pi4j-core/src/main/java/com/pi4j/io/i2c/impl/I2CBusImpl.java
starksm64/pi4j
76680ed5cd7302d02ff3086fd08d3faf1106a6f1
[ "Apache-2.0" ]
null
null
null
pi4j-core/src/main/java/com/pi4j/io/i2c/impl/I2CBusImpl.java
starksm64/pi4j
76680ed5cd7302d02ff3086fd08d3faf1106a6f1
[ "Apache-2.0" ]
null
null
null
pi4j-core/src/main/java/com/pi4j/io/i2c/impl/I2CBusImpl.java
starksm64/pi4j
76680ed5cd7302d02ff3086fd08d3faf1106a6f1
[ "Apache-2.0" ]
null
null
null
30.427419
109
0.592367
2,491
package com.pi4j.io.i2c.impl; /* * #%L * ********************************************************************** * ORGANIZATION : Pi4J * PROJECT : Pi4J :: Java Library (Core) * FILENAME : I2CBusImpl.java * * This file is part of the Pi4J project. More information about * this project can be found here: http://www.pi4j.com/ * ********************************************************************** * %% * Copyright (C) 2012 - 2013 Pi4J * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * #L% */ import java.io.IOException; import com.pi4j.io.i2c.I2CBus; import com.pi4j.io.i2c.I2CDevice; import com.pi4j.jni.I2C; /** * This is implementation of i2c bus. This class keeps underlying linux file descriptor of * particular bus. As all reads and writes from/to i2c bus are blocked I/Os current implementation uses only * one file per bus for all devices. Device implementations use this class file handle. * * @author Daniel Sendula * */ public class I2CBusImpl implements I2CBus { /** Singleton instance of bus 0 */ private static I2CBus bus0 = null; /** Singleton instance of bus 1 */ private static I2CBus bus1 = null; /** * Factory method that returns bus implementation. * * @param busNumber bus number * @return appropriate bus implementation * @throws IOException thrown in case there is a problem opening bus file or bus number is not 0 or 1. */ public static I2CBus getBus(int busNumber) throws IOException { I2CBus bus = null; if (busNumber == 0) { bus = bus0; if (bus == null) { bus = new I2CBusImpl("/dev/i2c-0"); bus0 = bus; } } else if (busNumber == 1) { bus = bus1; if (bus == null) { bus = new I2CBusImpl("/dev/i2c-1"); bus1 = bus; } } else { throw new IOException("Unknown bus number " + busNumber); } return bus; } /** File handle for this i2c bus */ protected int fd; /** File name of this i2c bus */ protected String filename; /** * Constructor of i2c bus implementation. * * @param filename file name of device to be opened. * * @throws IOException thrown in case that file cannot be opened */ public I2CBusImpl(String filename) throws IOException { this.filename = filename; fd = I2C.i2cOpen(filename); if (fd < 0) { throw new IOException("Cannot open file handle for " + filename + " got " + fd + " back."); } } /** * Returns i2c device implementation ({@link I2CDeviceImpl}). * * @param address address of i2c device * * @return implementation of i2c device with given address * * @throws IOException never in this implementation */ @Override public I2CDevice getDevice(int address) throws IOException { return new I2CDeviceImpl(this, address); } /** * Closes this i2c bus * * @throws IOException never in this implementation */ @Override public void close() throws IOException { I2C.i2cClose(fd); } }
3e05efc594353c8322bc6005fe1fd114e614b810
2,352
java
Java
BubbleChatApp/app/src/main/java/com/kailang/bubblechat/service/ClientService.java
kailanguage/IM-kl
c0d65c744ea9b4b36c826d4f6370e08077282410
[ "MIT" ]
null
null
null
BubbleChatApp/app/src/main/java/com/kailang/bubblechat/service/ClientService.java
kailanguage/IM-kl
c0d65c744ea9b4b36c826d4f6370e08077282410
[ "MIT" ]
null
null
null
BubbleChatApp/app/src/main/java/com/kailang/bubblechat/service/ClientService.java
kailanguage/IM-kl
c0d65c744ea9b4b36c826d4f6370e08077282410
[ "MIT" ]
null
null
null
33.6
88
0.613095
2,492
package com.kailang.bubblechat.service; import android.app.Service; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.os.IBinder; import android.util.Log; import com.google.protobuf.ByteString; import com.kailang.bubblechat.network.client.MsgDataSource; import com.kailang.bubblechat.network.client.NettyClient; import com.kailang.bubblechat.network.codec.ChatMessage; public class ClientService extends Service { private MsgDataSource msgDataSource; public ClientService() { msgDataSource=MsgDataSource.getInstance(); } @Override public void onCreate() { super.onCreate(); NettyClient.getInstance().startClient(); } @Override public int onStartCommand(Intent intent, int flags, int startId) { Bundle bundle = intent.getExtras(); String userName = null; byte[] icon; int userID; if (bundle != null) { userName = bundle.getString("userName"); userID = bundle.getInt("userID"); icon=bundle.getByteArray("userIcon"); runClient(userID,userName,icon); Log.e("ClientService",userID+" "+userName+" "+icon.length); } return super.onStartCommand(intent, flags, startId); } @Override public IBinder onBind(Intent intent) { // TODO: Return the communication channel to the service. throw new UnsupportedOperationException("Not yet implemented"); } private void runClient(final int userID, final String userName, final byte[] icon) { Handler handler = new Handler(); handler.postDelayed(new Runnable() { @Override public void run() { ChatMessage.MyMsg loginMsg = ChatMessage.MyMsg.newBuilder() .setDataType(ChatMessage.MyMsg.DataType.User) .setUser(ChatMessage.User.newBuilder() .setUserID(userID).setUserName(userName) //.setUserIcon(ByteString.copyFrom(icon)) .build()) .build(); msgDataSource.sendMsg(loginMsg); //NettyClient.getInstance().sendMsg(loginMsg); //runClient(times + 1); } }, 4000); } }
3e05f0cf852f23615275551b8585d0a8f4490388
262
java
Java
src/main/java/fun/epoch/learn/design/pattern/structural/adapter/demo/Adapter.java
epochwz/java-lab
28801a8d0a181cf86d24965838c4674914cb0a3b
[ "MIT" ]
null
null
null
src/main/java/fun/epoch/learn/design/pattern/structural/adapter/demo/Adapter.java
epochwz/java-lab
28801a8d0a181cf86d24965838c4674914cb0a3b
[ "MIT" ]
null
null
null
src/main/java/fun/epoch/learn/design/pattern/structural/adapter/demo/Adapter.java
epochwz/java-lab
28801a8d0a181cf86d24965838c4674914cb0a3b
[ "MIT" ]
null
null
null
18.714286
63
0.675573
2,493
package fun.epoch.learn.design.pattern.structural.adapter.demo; /** * 适配目标接口 的 适配实现类 */ public class Adapter implements Target { private Adapted adapted = new Adapted(); @Override public void request() { adapted.adaptedRequest(); } }
3e05f1310ff4ae0428f001634c88e693df4b693a
1,825
java
Java
app/src/main/java/org/wikipedia/zero/ZeroMessage.java
Wikinaut/wikipedia-app
1b30d90b4d74a3d35005ed537c5ca1f32bca19cc
[ "Apache-2.0" ]
null
null
null
app/src/main/java/org/wikipedia/zero/ZeroMessage.java
Wikinaut/wikipedia-app
1b30d90b4d74a3d35005ed537c5ca1f32bca19cc
[ "Apache-2.0" ]
null
null
null
app/src/main/java/org/wikipedia/zero/ZeroMessage.java
Wikinaut/wikipedia-app
1b30d90b4d74a3d35005ed537c5ca1f32bca19cc
[ "Apache-2.0" ]
null
null
null
22.530864
100
0.580274
2,494
package org.wikipedia.zero; import android.graphics.Color; import android.os.Parcel; import android.os.Parcelable; public class ZeroMessage implements Parcelable { private String msg; private int fg; private int bg; public ZeroMessage(String msg, String fg, String bg) { this(msg, Color.parseColor(fg.toUpperCase()), Color.parseColor(bg.toUpperCase())); } public ZeroMessage(String msg, int fg, int bg) { this.msg = msg; this.fg = fg; this.bg = bg; } public String getMsg() { return msg; } public int getFg() { return fg; } public int getBg() { return bg; } @Override public int hashCode() { return toString().hashCode(); } @Override public boolean equals(Object obj) { try { return obj instanceof ZeroMessage && (obj == this || obj.hashCode() == this.hashCode()); } catch (Exception e) { return false; } } @Override public String toString() { return this.msg + ":" + this.fg + ":" + this.bg; } // Parcelable stuff @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel out, int flags) { out.writeString(this.msg); out.writeInt(this.fg); out.writeInt(this.bg); } public static final Parcelable.Creator<ZeroMessage> CREATOR = new Parcelable.Creator<ZeroMessage>() { public ZeroMessage createFromParcel(Parcel in) { return new ZeroMessage(in); } public ZeroMessage[] newArray(int size) { return new ZeroMessage[size]; } }; public ZeroMessage(Parcel in) { this(in.readString(), in.readInt(), in.readInt()); } }
3e05f13fc43cfada5c28171136ee4f7c2009b8d4
9,484
java
Java
src/main/java/com/lordjoe/utilities/FRectangle.java
lordjoe/VoterGuide
7a142649f69cb0ed82660cd2e88beebbbeb70a01
[ "Apache-2.0" ]
null
null
null
src/main/java/com/lordjoe/utilities/FRectangle.java
lordjoe/VoterGuide
7a142649f69cb0ed82660cd2e88beebbbeb70a01
[ "Apache-2.0" ]
null
null
null
src/main/java/com/lordjoe/utilities/FRectangle.java
lordjoe/VoterGuide
7a142649f69cb0ed82660cd2e88beebbbeb70a01
[ "Apache-2.0" ]
null
null
null
26.198895
109
0.570118
2,495
/**{ file @name FRectangle.java @function like Rectangle but with floating point data @author> Steven M. Lewis @copyright> ************************ * Copyright (c) 1996,97,98 * Steven M. Lewis * www.LordJoe.com ************************ @date> Mon Jun 22 21:48:24 PDT 1998 @version> 1.0 }*/ package com.lordjoe.utilities; import java.awt.*; import java.awt.event.*; /**{ class @name FRectangle @function like Rectangle but with floating point data @see java.awt.Rectangle }*/ public class FRectangle implements Struct { //- ******************* //- Fields /**{ field @name x @function The x coordinate of the rectangle. }*/ public double x; /**{ field @name y @function The y coordinate of the rectangle. }*/ public double y; /**{ field @name width @function The width of the rectangle. }*/ public double width; /**{ field @name height @function The height of the rectangle. }*/ public double height; //- ******************* //- Methods /**{ constructor @name FRectangle @function Constructor of FRectangle }*/ public FRectangle() { } /**{ constructor @name FRectangle @function Constructor of FRectangle @param x the x coordinate @param width the width of the rectangle @param height the height of the rectangle @param y the y coordinate }*/ public FRectangle(double x, double y, double width, double height) { this.x = x; this.y = y; this.width = width; this.height = height; } /**{ constructor @name FRectangle @function Constructor of FRectangle @param width the width of the rectangle @param height the height of the rectangle }*/ public FRectangle(double width, double height) { this(0, 0, width, height); } /**{ constructor @name FRectangle @function Constructor of FRectangle @param p the point @param d dimension }*/ public FRectangle(Point p, Dimension d) { this(p.x, p.y, d.width, d.height); } /**{ constructor @name FRectangle @function Constructor of FRectangle @param p the point }*/ public FRectangle(FPoint p) { this(p.x, p.y, 0, 0); } /**{ constructor @name FRectangle @function Constructor of FRectangle @param d dimension }*/ public FRectangle(Dimension d) { this(0.0, 0.0, (double) d.width, (double) d.height); } /**{ constructor @name FRectangle @function Constructor of FRectangle @param r - rectangle to copy }*/ public FRectangle(Rectangle r) { this((double) r.x, (double) r.y, (double) r.width, (double) r.height); } /**{ method @name setBounds @function Reshapes the rectangle. @param height the height of the rectangle @param width the width of the rectangle @param y the y coordinate @param x the x coordinate @policy rarely override @primary }*/ public void setBounds(double x, double y, double width, double height) { this.x = x; this.y = y; this.width = width; this.height = height; } /**{ method @name move @function Moves the rectangle. @param x the x coordinate @param y the y coordinate @policy rarely override @primary }*/ public void move(double x, double y) { this.x = x; this.y = y; } /**{ method @name translate @function Translates the rectangle. @param x the x coordinate @param y the y coordinate @policy rarely override @primary }*/ public void translate(double x, double y) { this.x += x; this.y += y; } /**{ method @name setSize @function Resizes the rectangle. @param width the width of the rectangle @param height the height of the rectangle @policy rarely override @primary }*/ public void setSize(double width, double height) { this.width = width; this.height = height; } /**{ method @name contains @function Checks if the specified point lies inside a rectangle. @param x the x coordinate @param y the y coordinate @return true if x,y is inside @policy rarely override @primary }*/ public boolean contains(double x, double y) { return (x >= this.x) && ((x - this.x) < this.width) && (y >= this.y) && ((y - this.y) < this.height); } /**{ method @name intersects @function Computes the intersection of two rectangles. @param r Rectangle to intersect @return intersecting rect @policy <Add Comment Here> @primary }*/ public boolean intersects(FRectangle r) { return !((r.x + r.width <= x) || (r.y + r.height <= y) || (r.x >= x + width) || (r.y >= y + height)); } /**{ method @name intersection @function Computes the intersection of two rectangles. @param r rectangle to test @return intersection rectangle @policy rarely override @primary }*/ public FRectangle intersection(FRectangle r) { double x1 = Math.max(x, r.x); double x2 = Math.min(x + width, r.x + r.width); double y1 = Math.max(y, r.y); double y2 = Math.min(y + height, r.y + r.height); return new FRectangle(x1, y1, x2 - x1, y2 - y1); } /**{ method @name union @function Computes the union of two rectangles. @param r rectangle to test @return union rectangle @policy rarely override @primary }*/ public FRectangle union(FRectangle r) { double x1 = Math.min(x, r.x); double x2 = Math.max(x + width, r.x + r.width); double y1 = Math.min(y, r.y); double y2 = Math.max(y + height, r.y + r.height); return new FRectangle(x1, y1, x2 - x1, y2 - y1); } /**{ method @name add @function Adds a point to a rectangle. This results in the smallest rectangle that contains both the rectangle and the point. @param newx x value @param newy y value @policy rarely override @primary }*/ public void add(double newx, double newy) { double x1 = Math.min(x, newx); double x2 = Math.max(x + width, newx); double y1 = Math.min(y, newy); double y2 = Math.max(y + height, newy); x = x1; y = y1; width = x2 - x1; height = y2 - y1; } /**{ method @name add @function Adds a point to a rectangle. This results in the smallest rectangle that contains both the rectangle and the point. @param pt point to add @policy rarely override @primary }*/ public void add(Point pt) { add(pt.x, pt.y); } /**{ method @name add @function Adds a rectangle to a rectangle. This results in the union of the two rectangles. @param r rectangle to add @policy rarely override @primary }*/ public void add(FRectangle r) { double x1 = Math.min(x, r.x); double x2 = Math.max(x + width, r.x + r.width); double y1 = Math.min(y, r.y); double y2 = Math.max(y + height, r.y + r.height); x = x1; y = y1; width = x2 - x1; height = y2 - y1; } /**{ method @name grow @function Grows the rectangle horizontally and vertically. @param h horizontal growth @param v vertical growth @policy rarely override @primary }*/ public void grow(double h, double v) { x -= h; y -= v; width += h * 2; height += v * 2; } /**{ method @name isEmpty @function test is area <= 0 @return true if area <= 0 @policy rarely override @primary }*/ public boolean isEmpty() { return (width <= 0) || (height <= 0); } /**{ method @name equals @function Compares two Objects for equality. Returns a boolean that indicates whether this Object is equivalent to the specified Object. This method is used when an Object is stored in a hashtable. @param obj the object to compare with @return true if these Objects are equal; false otherwise. @overrideReason> add Frectangle test @policy add super test @primary @see java.util.Hashtable @see java.util.Hashtable }*/ public boolean equals(Object obj) { if(obj == null) return false; if (obj instanceof FRectangle) { FRectangle r = (FRectangle) obj; return (x == r.x) && (y == r.y) && (width == r.width) && (height == r.height); } if (obj instanceof FRect) { FRect r = (FRect) obj; return (x == r.x) && (y == r.y) && (width == r.width) && (height == r.height); } return false; } /**{ method @name toString @function Returns a String that represents the value of this Object. It is recommended that all subclasses override this method. @return the string @overrideReason> add FRectangle code @policy add to super string @primary }*/ public String toString() { return getClass().getName() + "[x=" + x + ",y=" + y + ",width=" + width + ",height=" + height + "]"; } //- ******************* //- End Class FRectangle }
3e05f2c42ac2bbeae7448550116ec3a6045c455a
6,727
java
Java
mehta-applications-service/src/main/java/com/mehta/applications/service/impl/OrgServiceImpl.java
ManjeetMehta/spring-boot-1.5
f9c3635cad82c8dcf61bbc0c166a4358beed509c
[ "MIT" ]
1
2018-04-09T05:38:07.000Z
2018-04-09T05:38:07.000Z
mehta-applications-service/src/main/java/com/mehta/applications/service/impl/OrgServiceImpl.java
ManjeetMehta/spring-boot-1.5
f9c3635cad82c8dcf61bbc0c166a4358beed509c
[ "MIT" ]
null
null
null
mehta-applications-service/src/main/java/com/mehta/applications/service/impl/OrgServiceImpl.java
ManjeetMehta/spring-boot-1.5
f9c3635cad82c8dcf61bbc0c166a4358beed509c
[ "MIT" ]
1
2018-03-29T09:28:36.000Z
2018-03-29T09:28:36.000Z
27.569672
85
0.638323
2,496
package com.mehta.applications.service.impl; import java.util.ArrayList; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.mehta.applications.common.vo.AddressVo; import com.mehta.applications.common.vo.OrgDetailsVo; import com.mehta.applications.common.vo.OrgVo; import com.mehta.applications.common.vo.UserVo; import com.mehta.applications.model.Address; import com.mehta.applications.model.Org; import com.mehta.applications.repository.AddressRepository; import com.mehta.applications.repository.OrgRepository; import com.mehta.applications.service.AddressService; import com.mehta.applications.service.OrgService; @Service public class OrgServiceImpl implements OrgService { @Autowired OrgRepository orgRepository; @Autowired AddressRepository addressRepository; @Autowired AddressService addressService; private static final Logger logger = LoggerFactory.getLogger(OrgServiceImpl.class); @Override public Integer createOrg(OrgVo orgVo) { if (orgVo != null) { Org org = new Org(); org.setName(orgVo.getName()); org.setCountry(orgVo.getCountry()); org.setActive(orgVo.isActive()); Address address = null; if (orgVo.getAddressVo() != null && orgVo.getAddressVo().getId() != null) { Integer id = orgVo.getAddressVo().getId(); if (id != null) { address = addressRepository.findOne(id); if (address != null) { org.setAddress(address); } else { logger.error("Invalid address Id"); return null; } } } else { logger.error("Address Can't be null"); return null; } org = orgRepository.save(org); if (org != null) { return org.getId(); } } return null; } @Override public Integer createCompositeOrg(OrgVo orgVo) { if (orgVo != null) { Org org = new Org(); org.setName(orgVo.getName()); org.setCountry(orgVo.getCountry()); org.setActive(orgVo.isActive()); Address address = null; if (orgVo.getAddressVo() != null) { Integer id = orgVo.getAddressVo().getId(); if (id != null) { address = addressRepository.findOne(id); if (address != null) { org.setAddress(address); } else { logger.error("Invalid Address Id"); return null; } } else { Integer addressId = addressService.createAddress(orgVo.getAddressVo()); if (addressId != null) { address = addressRepository.findOne(addressId); if (address != null) { org.setAddress(address); } else { logger.error("Address Can't be creatd..."); return null; } } } } else { logger.error("Address Can't be null"); return null; } org = orgRepository.save(org); if (org != null) { return org.getId(); } } return null; } @Override public boolean updateOrg(Org org) { // TODO Auto-generated method stub return false; } @Override public OrgVo readOrg(Integer id) { OrgVo orgVo = null; if (id != null) { Org org = orgRepository.findOne(id); if (org != null) { orgVo = new OrgVo(); orgVo.setId(org.getId()); orgVo.setName(org.getName()); orgVo.setCountry(org.getCountry()); orgVo.setActive(org.isActive()); if (org.getAddress() != null) { AddressVo addressVo = new AddressVo(); addressVo.setId(org.getAddress().getId()); orgVo.setAddressVo(addressVo); addressVo.setCity(org.getAddress().getCity()); addressVo.setCountry(org.getAddress().getCountry()); addressVo.setPincode(org.getAddress().getPincode()); addressVo.setState(org.getAddress().getState()); if (org.getAddress().getUser() != null) { UserVo userVo = new UserVo(); userVo.setId(org.getAddress().getUser().getId()); addressVo.setUserVo(userVo); userVo.setUserName(org.getAddress().getUser().getUserName()); userVo.setEmail(org.getAddress().getUser().getEmail()); userVo.setActive(org.getAddress().getUser().getActive()); userVo.setPassword(org.getAddress().getUser().getPassword()); } orgVo.setAddressVo(addressVo); } } } return orgVo; } @Override public boolean deleteOrg(Integer id) { // TODO Auto-generated method stub return false; } @Override public List<OrgVo> listOrg() { List<OrgVo> orgVoList = null; List<Org> orgList = (List<Org>) orgRepository.findAll(); if (orgList != null) { orgVoList = new ArrayList<OrgVo>(); OrgVo orgVo = null; for (Org org : orgList) { if (org != null) { orgVo = new OrgVo(); orgVo.setName(org.getName()); orgVo.setCountry(org.getCountry()); orgVo.setActive(org.isActive()); AddressVo addressVo = new AddressVo(); addressVo.setId(org.getAddress().getId()); orgVo.setAddressVo(addressVo); orgVoList.add(orgVo); } } } return orgVoList; } @Override public List<OrgVo> listOrgByCountry(String country) { List<OrgVo> orgVoList = null; if (country != null && !(country.toString().trim().isEmpty())) { List<Org> orgList = orgRepository.findAllByCountry(country); if (orgList != null) { orgVoList = new ArrayList<OrgVo>(); OrgVo orgVo = null; for (Org org : orgList) { if (org != null) { orgVo = new OrgVo(); orgVo.setId(org.getId()); orgVo.setName(org.getName()); orgVo.setActive(org.isActive()); orgVo.setCountry(org.getCountry()); orgVoList.add(orgVo); } } } } return orgVoList; } @Override public OrgDetailsVo readOrgDetails(Integer id) { OrgDetailsVo orgDetailsVo = null; if (id != null) { Org org = orgRepository.findOne(id); if (org != null) { orgDetailsVo = new OrgDetailsVo(); orgDetailsVo.setId(org.getId()); orgDetailsVo.setName(org.getName()); orgDetailsVo.setCountry(org.getCountry()); orgDetailsVo.setActive(org.isActive()); if (org.getAddress() != null) { orgDetailsVo.setState(org.getAddress().getState()); orgDetailsVo.setCity(org.getAddress().getCity()); orgDetailsVo.setPincode(Integer.parseInt(org.getAddress().getPincode())); if (org.getAddress().getUser() != null) { orgDetailsVo.setName(org.getAddress().getUser().getUserName()); orgDetailsVo.setEmail(org.getAddress().getUser().getEmail()); orgDetailsVo.setPassword(org.getAddress().getUser().getPassword()); } } } } return orgDetailsVo; } }
3e05f3d28db1dbbcd4cb2876db8c7f5e882ad64f
8,047
java
Java
bmc-logging/src/main/java/com/oracle/bmc/logging/requests/ListLogsRequest.java
aalmiray/oci-java-sdk
4abfeb1a51bddde7a64f04b36dcd906a67db4a23
[ "UPL-1.0", "Apache-2.0" ]
null
null
null
bmc-logging/src/main/java/com/oracle/bmc/logging/requests/ListLogsRequest.java
aalmiray/oci-java-sdk
4abfeb1a51bddde7a64f04b36dcd906a67db4a23
[ "UPL-1.0", "Apache-2.0" ]
null
null
null
bmc-logging/src/main/java/com/oracle/bmc/logging/requests/ListLogsRequest.java
aalmiray/oci-java-sdk
4abfeb1a51bddde7a64f04b36dcd906a67db4a23
[ "UPL-1.0", "Apache-2.0" ]
1
2021-09-20T00:51:00.000Z
2021-09-20T00:51:00.000Z
31.806324
246
0.59488
2,497
/** * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. */ package com.oracle.bmc.logging.requests; import com.oracle.bmc.logging.model.*; @javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20200531") @lombok.Builder(builderClassName = "Builder", buildMethodName = "buildWithoutInvocationCallback") @lombok.Getter public class ListLogsRequest extends com.oracle.bmc.requests.BmcRequest<java.lang.Void> { /** * OCID of a log group to work with. */ private String logGroupId; /** * The logType that the log object is for, custom or service. */ private LogType logType; /** * The logType that the log object is for, custom or service. **/ public enum LogType { Custom("CUSTOM"), Service("SERVICE"), ; private final String value; private static java.util.Map<String, LogType> map; static { map = new java.util.HashMap<>(); for (LogType v : LogType.values()) { map.put(v.getValue(), v); } } LogType(String value) { this.value = value; } @com.fasterxml.jackson.annotation.JsonValue public String getValue() { return value; } @com.fasterxml.jackson.annotation.JsonCreator public static LogType create(String key) { if (map.containsKey(key)) { return map.get(key); } throw new IllegalArgumentException("Invalid LogType: " + key); } }; /** * Service created the log object */ private String sourceService; /** * Log object resource */ private String sourceResource; /** * Resource name */ private String displayName; /** * Lifecycle state of the log object */ private com.oracle.bmc.logging.model.LogLifecycleState lifecycleState; /** * For list pagination. The value of the `opc-next-page` or `opc-previous-page` response header from the previous \"List\" call. * For important details about how pagination works, see [List Pagination](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). * */ private String page; /** * The maximum number of items to return in a paginated \"List\" call. * */ private Integer limit; /** * The field to sort by (one column only). Default sort order is * ascending exception of `timeCreated` and `timeLastModified` columns (descending). * */ private SortBy sortBy; /** * The field to sort by (one column only). Default sort order is * ascending exception of `timeCreated` and `timeLastModified` columns (descending). * **/ public enum SortBy { TimeCreated("timeCreated"), DisplayName("displayName"), ; private final String value; private static java.util.Map<String, SortBy> map; static { map = new java.util.HashMap<>(); for (SortBy v : SortBy.values()) { map.put(v.getValue(), v); } } SortBy(String value) { this.value = value; } @com.fasterxml.jackson.annotation.JsonValue public String getValue() { return value; } @com.fasterxml.jackson.annotation.JsonCreator public static SortBy create(String key) { if (map.containsKey(key)) { return map.get(key); } throw new IllegalArgumentException("Invalid SortBy: " + key); } }; /** * The sort order to use, either 'asc' or 'desc' * */ private SortOrder sortOrder; /** * The sort order to use, either 'asc' or 'desc' * **/ public enum SortOrder { Asc("ASC"), Desc("DESC"), ; private final String value; private static java.util.Map<String, SortOrder> map; static { map = new java.util.HashMap<>(); for (SortOrder v : SortOrder.values()) { map.put(v.getValue(), v); } } SortOrder(String value) { this.value = value; } @com.fasterxml.jackson.annotation.JsonValue public String getValue() { return value; } @com.fasterxml.jackson.annotation.JsonCreator public static SortOrder create(String key) { if (map.containsKey(key)) { return map.get(key); } throw new IllegalArgumentException("Invalid SortOrder: " + key); } }; /** * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about * a particular request, please provide the request ID. * */ private String opcRequestId; public static class Builder implements com.oracle.bmc.requests.BmcRequest.Builder<ListLogsRequest, java.lang.Void> { private com.oracle.bmc.util.internal.Consumer<javax.ws.rs.client.Invocation.Builder> invocationCallback = null; private com.oracle.bmc.retrier.RetryConfiguration retryConfiguration = null; /** * Set the invocation callback for the request to be built. * @param invocationCallback the invocation callback to be set for the request * @return this builder instance */ public Builder invocationCallback( com.oracle.bmc.util.internal.Consumer<javax.ws.rs.client.Invocation.Builder> invocationCallback) { this.invocationCallback = invocationCallback; return this; } /** * Set the retry configuration for the request to be built. * @param retryConfiguration the retry configuration to be used for the request * @return this builder instance */ public Builder retryConfiguration( com.oracle.bmc.retrier.RetryConfiguration retryConfiguration) { this.retryConfiguration = retryConfiguration; return this; } /** * Copy method to populate the builder with values from the given instance. * @return this builder instance */ public Builder copy(ListLogsRequest o) { logGroupId(o.getLogGroupId()); logType(o.getLogType()); sourceService(o.getSourceService()); sourceResource(o.getSourceResource()); displayName(o.getDisplayName()); lifecycleState(o.getLifecycleState()); page(o.getPage()); limit(o.getLimit()); sortBy(o.getSortBy()); sortOrder(o.getSortOrder()); opcRequestId(o.getOpcRequestId()); invocationCallback(o.getInvocationCallback()); retryConfiguration(o.getRetryConfiguration()); return this; } /** * Build the instance of ListLogsRequest as configured by this builder * * Note that this method takes calls to {@link Builder#invocationCallback(com.oracle.bmc.util.internal.Consumer)} into account, * while the method {@link Builder#buildWithoutInvocationCallback} does not. * * This is the preferred method to build an instance. * * @return instance of ListLogsRequest */ public ListLogsRequest build() { ListLogsRequest request = buildWithoutInvocationCallback(); request.setInvocationCallback(invocationCallback); request.setRetryConfiguration(retryConfiguration); return request; } } }
3e05f47bd83e98a9a56487969f9e0f129ef24a18
1,431
java
Java
src/main/java/com/kosmo88/logistics_erp/sale/dto/SalesInsertOrderDTO.java
shugo9538/kosmo88_erp
7da8870a914865160867cb16da008419cd5105ef
[ "Apache-2.0" ]
null
null
null
src/main/java/com/kosmo88/logistics_erp/sale/dto/SalesInsertOrderDTO.java
shugo9538/kosmo88_erp
7da8870a914865160867cb16da008419cd5105ef
[ "Apache-2.0" ]
1
2021-09-24T07:39:11.000Z
2021-09-24T07:39:11.000Z
src/main/java/com/kosmo88/logistics_erp/sale/dto/SalesInsertOrderDTO.java
shugo9538/kosmo88_erp
7da8870a914865160867cb16da008419cd5105ef
[ "Apache-2.0" ]
null
null
null
18.113924
50
0.708595
2,498
package com.kosmo88.logistics_erp.sale.dto; import java.util.Date; import org.apache.ibatis.type.Alias; //주문서 등록 DTO @Alias("SalesInsertOrderDTO") public class SalesInsertOrderDTO { private int request_id; // 거래처코드 private String employee_id; // 사원번호 private int client_id; // 거래처코드 private int item_id; // 상품코드 private int department_id; // 부서코드 private int quantity; // 상품수량 private Date end_date; // 납기요청일자 public SalesInsertOrderDTO() {} public int getRequest_id() { return request_id; } public void setRequest_id(int request_id) { this.request_id = request_id; } public String getEmployee_id() { return employee_id; } public void setEmployee_id(String employee_id) { this.employee_id = employee_id; } public int getClient_id() { return client_id; } public void setClient_id(int client_id) { this.client_id = client_id; } public int getItem_id() { return item_id; } public void setItem_id(int item_id) { this.item_id = item_id; } public int getDepartment_id() { return department_id; } public void setDepartment_id(int department_id) { this.department_id = department_id; } public int getQuantity() { return quantity; } public void setQuantity(int quantity) { this.quantity = quantity; } public Date getEnd_date() { return end_date; } public void setEnd_date(Date end_date) { this.end_date = end_date; } }
3e05f50fb90668a1d191bc8d6ccbed1d16b313d4
38,101
java
Java
output/0418d8bbaef649f0ae3132645730e170.java
comprakt/comprakt-fuzz-tests
c0082d105d7c54ad31ab4ea461c3b8319358eaaa
[ "Apache-2.0", "MIT" ]
null
null
null
output/0418d8bbaef649f0ae3132645730e170.java
comprakt/comprakt-fuzz-tests
c0082d105d7c54ad31ab4ea461c3b8319358eaaa
[ "Apache-2.0", "MIT" ]
null
null
null
output/0418d8bbaef649f0ae3132645730e170.java
comprakt/comprakt-fuzz-tests
c0082d105d7c54ad31ab4ea461c3b8319358eaaa
[ "Apache-2.0", "MIT" ]
null
null
null
38.641988
334
0.48794
2,499
class Qm3Gt_0 { public int[][][][][] vau (int UBhJfIgbGhMFk, qWWuz5l1VTutm jMWpanfHs, mc778cS6uLq zxNorl9g, boolean YVu4R) { rQgzo c1zX = !this.YUb35xexUO0v = !new MnODo3().QH(); { if ( ( !!-P3fPl7U5().zo()).gxvB8ic()) { void _80LC; } return; int MduA7; while ( -!-8619.xOttgm) while ( new zs5fbrO()[ !hxfPnCI[ -null[ !new Spw7[ -new GU().oh()].A]]]) if ( true.wjc()) if ( ( ( -null.VmKnkpgelvCy23).J0opH1slJ()).IlBDNVhTrcP()) return; void FLFHQsgq3sM_RK; this[ 567473557.q]; return; new boolean[ !!-( -false.p29YbcpEP6Z)[ -null.GolyCDZt39lvm()]][ Ti().C1efSjtBv()]; boolean[][] zjCctQ; boolean[] tot5TMRdVM57; int[] xh4Zn9fcmwQ; } } public boolean fq () { qJA[][] zuIykt2dFJ = vlEkuR[ !wYYKlugZR.AO8aXAPD()]; while ( false[ 5963969[ -( faIRdJD().ppj145zl6())[ 18.hJFAiNw_blHHBb]]]) while ( 458061771[ L6hOf0kZ.IXTYxu_]) return; ; return null[ ( true.C).ekOWCtd5()]; void[] K3MqHIkY; { int U86tFKDAg; int[] DryzAiGl8; boolean yQ30h6ey; void[] mn; if ( !-!-G().ytYP9Bxv()) if ( true.F7WyvH__w_()) while ( new void[ -!!false[ -!( null[ --!this.Bmdbo])[ ( false[ ( -0157427[ -true.g6kPsaBS5o]).fWHzSv2SXPVd])[ new _3aMunk_VEfCM3()[ -null.o]]]]].JEPbm) while ( iXQWnvFQxPw.TJttINx()) { kBoP8ot E0aUK6K; } YktKIAB[] YtjC; boolean xnnVi7DiNp21B; return; void[][] u4D3B8K1; int[][][] YEk; if ( !this[ 050924885.e0gLHD8hE3nvEt]) --false[ 26343447[ null[ new I()[ this[ !!56.kb569Pv()]]]]]; B39_R5uFd[][][][] CRCMK5IC0sr; int TgKWSGg; } { int UuWYjC; -dMJhXfHTIjJRqO().f_qgBmvRNwVsgd(); { while ( !( !!!!true.mXZlC()).QPdoLw()) ; } boolean[][][][][][] MOE0o7180t8PM; int[] n17iBiyq; true.mfB; { boolean hNz52OKmj; } int[] wqTkJm6mto4r; { int[][][][] rpa4Hd; } Od dKZuU; Z0qgmX[] uJ9bJ3iBUp; int[] TgtIsASeaHcTs; -null.l0GVp0tFP(); boolean pXPPEXWkIFsS7M; ; while ( null.TNYCVesS8QKe()) ; void[] XrtI7yEhB9Tl; while ( !qTzFKHA_k()[ ( this.s4GIPreSc4)[ !new Bk22().IrUlhlTv7]]) { void[][][] M9eZD; } } if ( false.MLZM9eV79n6l()) if ( ( --new boolean[ ---false[ -!yrJuv6().lEQmddC]].f).ue4B17fpvqw()) -7.fGLg95SoL5;else if ( !new int[ null.ml()]._HaEldq) { int[] sWXnayaDD_JC; } void Tgu5OmjTCkGWH; int I; return -mwZi[ new i_1jzknxqG()[ new U().VVf9dC()]]; --!( !--false.erEGZuIjHFhM())[ ikCvZqVhuMcQ7.G2yCB8UuxLD7L]; while ( false[ 8[ false[ false[ -!087489877.FahulV9nUQaG()]]]]) while ( !( !true.voMNeYk_).hy()) return; int[][][][][] R; { void[] xGnSzoosNi; JJiiU92b qHHrI6G; XrqMPeJdGsMO rsc5z; j9se2Edx ZyTxJ8umbD3; return; void[] e411TuzR8Z; int[][] q0mhFObkz0tWg0; _ixP TYYF3TggXH; boolean[] HL; if ( ( !--!-this.YfVV6lFiICiQ())[ true.cj2KJRzBZrUb6]) while ( new void[ true.PkXCnFmrnAo()].pmAwTnGW()) --!!----null._RSqWZdPv_x(); --9990.vASf; int[][] E_S; while ( !-new EUQ04_qb()[ true[ true.MkAnk]]) { int gwFm0d; } boolean YDs3ZLti6H; return; KQxJwNpv7[] uuPCp8; } } public boolean[][][] OWw3t6; public pY51RGOofv[][] oekFID (wynH6G7H9sjz_[] _q3X3RdAXgwCKT, boolean[][] _wW6RkbzwhPIKx, boolean SQFuzI, boolean[] q) throws tUZBiUmcjzC { int EQZTpX_LBS368; int[] qD6qbHdAy; void[][] QD = --this.LMnw6h6XOYJ9Iv(); boolean[][][] yIL9N; ; RPUgkpE4dIs_jZ[][][][] nY0tPdhudk; ZcAY S1uuoioVDc = ( null[ gDv_JiK0()[ !new KWLyI().P6w]]).JStmd = jr0LBqwZ3qe0().Qk; } public static void mSS3SVMc (String[] ADI4ouFfgpz2i) { while ( -Hu3wl31Cm_doi().hqJMYjaUbj) { boolean[][] YkO; } int[] b6IvvoJqZ9V; int dRAPTO9LGwF = new void[ new KHHSzwpg().YQA0Jw()].WzM = -AdTFZCzVNzc.K_F0ObqOOe; ; { int[] WEZcaHW_O1Qb48; void ePRnl66L7O; void[][] Vu; } while ( DMw[ new tYPo().rPcfalI2wl01]) return; int[] DYv = null._5i9Yb() = !!new int[ !-!this.OBnzzO].KT(); boolean[][] uf; false._MDYIFO35v3P1N(); } public static void IOsGQAJ (String[] WyqKLU58AITU6) { return pIITn_71uS7().dJfu9(); 42.JtlaiQhm6gT; int BAXX9yWzwqtXO; boolean[] QUAiWdi8gVk = !-!!this.V2DAZP = new int[ new a().jMTZkb3Lor()][ !true.Nl92Twmi()]; return -!( !( new jCxPuctS2qae1()[ -false.JYuFpYGOIw()]).iQhQzLY).gpVCJe; { return; int oET2; void[] hVbaZZ3FyR; } void zm = ( -( new int[ false.V1][ cMZa82FGJ()[ ( !false[ -JrMxcy.I])[ -WnTtw4opc().MQbreaqPA4mrg]]]).EOIo5vFm0J74H)[ new cht1wCaseX0()[ -true.yTpVddje0()]]; new Wc76yx0fL()[ !-!!ebp4KJPs[ !!false.gQNDkV()]]; boolean[] qRnloRVB = ( this.eDQsz0DMcJw)[ !Fw[ false.q()]]; !!--!false[ !!true.zs]; if ( -new fqiswhW()[ null.I5YpZH4ZL]) return; int GvAOPRboYceU = new int[ !this.noYnwu1v7].MjpzCRU7Wf; void[] jQ8i = new void[ --!-92413.xi].zlZ = new int[ WLTk3Vc().WZJH7dAm()].RgI4jNUC(); int lh; if ( ( 4360[ -!-!-!bksa6.qu9Yu])[ !new PUSQI0nO().ypuVKh()]) this[ qySC0j().S]; boolean[][][] o = 19561[ !new TVVunYsnSvZg().Fv()]; P9lE yx6jObyI = !new dmF1SZRaLVFF().fL7QKL(); Pr1b8PVFU0aOR YowbnJa_jXfI2; } public int[] e_XWz; public int aQEQsdoHclCCjZ; public void[] xbq () { void cPeLkfPQtDl; { if ( -new Igo9RXvN()[ !!-( 059180[ !!007.qwftFeQ68xG5()]).FA63r09drLgE()]) -null.qToXz; -null[ kwAJyzTFJ().m1fqdd()]; void sEm_MYpa4; return; new boolean[ x().rzijedP][ 8._H()]; void[][] c; if ( !-null[ !new NCif2UK3wLt()[ -!this[ true[ --!--new void[ A2C9ZkYUycr[ -!-!null.XQNJ()]][ !-( !new LuAZx().ugshZiFg)[ !!-!-!-new rRU5F[ hsKa.WGMNc()].rkI0lXcaiFX]]]]]]) this.Z8e9tbqC1yNfC(); void[] Tz; } } public void[] RkP; public static void iG1pRr1fQKIa (String[] w8p) { return; mqNE SnieINLw = ----new qzK0().YQ; G5wM NTsy1KBO9cd; { void HPe6nyOCL1hCq; if ( !!!!-this[ ( A().T()).G579u3]) { int Sq5CeJfny; } int[][] UUFdZGT0l7kDS; boolean[][][][][][] Fj; { int[][] cNhIkup8yu2gv; } FwOh gKoVgt7NVSe; fHa0J2MB1d[] C0a; boolean n; ; void[] cXXv9d0; return; F7wZjpMwElA3Mr BMFyPb64Ef; int[][] MdACU0Q; void lk9; void jjiuLBdz; while ( -true[ AKV9Ni[ -!!!!!NX1oMDbXKz4l().kLvWg()]]) return; ; boolean Bd_oh; } int kjq = false.d() = false.tY2d; int ma2Y2Eh = -13898.Ul61C9i_EHRoVw; while ( -this[ !true[ false.t9m3jQNbHPY]]) ; boolean ac0Tx95cQhch; void[] wG1TY216 = true.bHpDPYk06r4gt; { return; int IkP; int[][] HXms_4zrTt; if ( null[ new IioWdQtctNC()[ !this.LukDjW1QfKH_()]]) return; int[] GegEc_; if ( true.GcAUayv90c) ---this.icCSjwN; { return; } return; true.p7NtIWJp; int[][][] qScK_xk; void[] LfW9Yd2; { boolean[][][] spf; } while ( new sv7hxcB[ !true.QdjE4PIr].PKxtzTWZI()) ; } true.TFLAs93EIahpdX(); void[] ayy9 = -9766.Keyqc; sW28MLq[] UTvXzeB6Br = !!-new void[ null[ 970304447[ !nE87A().Xw3y0FGdbhUgk()]]][ !!!( !!!!this.JI8i6kY9()).GZK4X066()] = ( this[ new int[ ( new sMxHWHfwyR().zPYT0itScqZ()).G].diz6EQEJSOPj4Y()])[ -true.T7Mbz()]; } public static void OLQf (String[] bAc) throws EgQmmR6 { ; void[][] QicVMC_rneDo1w = FqHqXqcaRchjh.GjVshE9VE() = ( this.F()).n8yD(); boolean y5FZav04; while ( new int[ !( new hadJAzS9X().gkJpARIYurp).iiqm5y4tr3RC].gZo_F) ; BMbjSDY BQyRUWSBZ0d; ; void[][] MasdOE5R = !!false.Z2dMaXnGmsmId; { while ( !1.s7e0ROfTc()) return; int[] YVv1t95Nf; void[] M; void kavWFEIS3rC; NQ28PHx QG9z; if ( -2240.uWDNAeUAabsAx()) !!!57735289.de47(); boolean[] Ga6Cz6; if ( -Y0cyh0u9()[ -!--7016.Vkfo0OFM]) { { void[] b6GvtzDklfB5g3; } } return; void lEUerzX; while ( new boolean[ ( --!r6a8FPMB3.Lof6n6f).jXLEF3g][ -2141[ null[ ytAGNmunveFkYe.j3YLYVWTy]]]) return; return; if ( ( !!true.Fj_wmN)[ !2497157.u3H3k()]) return; int EizzkF3NvLRk; { fsTGiQ fk7pmBEQ; } knWgq KeNiNk9Olg8; while ( true.X()) return; void[] Pw97; if ( this.EOj4VwGW_DrFLV) while ( 38286921.ft) ; int vjC9_z7m; } void[][][] D5LrLU7KU = -ohE2C.L5J; if ( !-!gQULdjoyDqaE()[ !!false[ true.uSWcu]]) return; ; { if ( new TGR().Lqrjf8dY7D0n()) return; { while ( this.A) return; } YBduoq lyjt; -true[ -new void[ -!!true[ !-auxFJYqV().yoAqWF]].ZZC6t5P]; 417053503.EZUpKQUepKy243(); cPlCW SnZ; true.a_HAZetRr47WP6; ; ; esvrkkjTz5Dac[][][][] qs4LRULbEsUd; { boolean ftrZ; } void[] Qepk2s; boolean[] EWU; -null.FY(); Y14c Tt18fJm2; boolean[][][] ucs0iLRu5; void O84goYywqvm; void[][] BUl1n2mRdMt; } while ( -!new jSI().LNsiTifbYl()) ; while ( new boolean[ true[ EPiLla5pw6Jxb().RmxT4Yfj()]][ -new H7u[ -!this.mabbj()].p6yVT8OHO]) while ( null.EKA1fit()) while ( null.X2AO()) null.R6SACUTg; void[][][] Gnva; } public int KIYgcMJ1Fjh9; public static void u (String[] cSDOb) { if ( !this[ -14588204.cID43g]) if ( ( new int[ !new hUOT5GDfK().uyiYdwDCm][ -true.rtPopR()]).oq7) ; IS7_3Lf idAu7DPZXXS; while ( this[ !FiOfviESc.axUBePT()]) while ( !!!r_bbiumSFmv2BD[ -!-( tc2m1[ cB2AvWQ3LuS9().Js4u])._8PzYZ9()]) { { boolean XUQhbuYAL_S1Dp; } } void[] cRoqiS = true.fC7zzjxP(); void[][] u; PMvQYftLyP[][] RvUpjXTLW = !!this[ n[ -!null.Ffsqj_BQw1yUX()]] = 460032[ true.anXa4q5jwGWv()]; int[] Om = -!F_u2G8yUsla.JK6wI66; int[][] RvH5Gyxq6; { while ( !cm9e0yAYb.rE8v) return; ; void EKF8Uy7iJyV5; boolean[] aXuQ6gtVkSNMQ; if ( false[ -this.f2iy]) while ( true.E4W_5()) ; if ( -!!this.i6QfYooRXtR) { { return; } } return; return; void[][][][] gFsot9qQiU; pJWAPB4[][][] KG0NB; { ; } int U1yyEscQl; void FbkiB; boolean[][][] _fuGl; while ( -!-new void[ !true[ false.m4n9vH8JbQ()]][ -new int[ cewokH.zK7w6h7it5()].QFcZAR]) new void[ true.QQII_7y7qQQ].RPXmMAhFQSZDJ(); -!new afsWHF().rfA6cIVjh0ZkD(); !-IeA8s2eV().lsac8aITn(); dfWDllxXrZjgiS()[ -06.OweRn7oQlPIi]; boolean[][] KW4W_R10r6l5ZZ; } ; while ( this[ !-!new boolean[ !!!( cUVgT2hAX()[ !!--!( !!!!new qN().dx_SganK)[ -new Y64Fs2Shagqb().mDbpqcAjgt()]]).WFMGfraf()][ ---!null[ --Bgf9W5y6().gCAj_B]]]) if ( -this.nkX) !!this[ --!false.ZzD]; while ( new KBwsL[ new void[ !n()[ !C0GYpi().qwGPMeA]].kYLo()].m6vk) if ( ( new int[ !S().iZ3zUm0tn52()].YPIF).BGP67w0tB()) if ( QV7FIv.Pg8ntTE()) ; !-S8VQEiCLPS5GE()[ Nis_Hi().HgwjwSz]; ; !bzmsuu.FMAfD; return !this.F9L(); boolean[][] UWsvCD; } public boolean[] qd8kZ6I83cJ () throws ANDxL { wGlNW8veO78r[] mDZoL; while ( O().lZ3NA0T()) if ( TcTRyPr()[ --QbSLOkJi().sJg]) return; { int v1; return; int[][][] _Q0xI8J; boolean[][][][] DWAlQmH8K; L[][][][] IVO; { void[][][][][][][] e7auS; } void xoWch5KUuirYws; NrHvP6HySufTWW bvRsjVavq4rJYK; zQkL9XZrISb[][][][] yf; int PrTUT; int QfBEZ5vO; int Ts; int BfziV7Osaev2dp; new boolean[ --T7Yc()[ new void[ RsfGbm9dQ_().eZLxxYnj9u9ub][ urdl0gMj.h4z()]]].s(); rPZetdWRzm suGlc2x_g; int KmL; void nBC9Cy1; } if ( !---new boolean[ -B4BxksF6va6().Q1xdwJZl()].y51ObhdIps6UN7) if ( ( FUekKgxSVLden0().E()).O874UUiwrpWFN()) null.WuOgo();else { PGibW6Hvndn_iX vmRykxcL; } while ( rJPj().dFRpk8kixTvd) { int[] wkZ0ZdJrr; } jF[][] _vGWx = -true.G74n; } } class ZICpz_TAFT93U { public static void Dd0CV4ljjEw (String[] tw9i3WNQKC4Ak2) { -this.LAB5eGMx; int[] ix = --new dp7gRS()[ !-!-new n7IkzR8W().KeCYfav7cr()] = Gd()._KemW_wOYF(); while ( -new _1jYzpbsUbmi5().y7gjYxoMt5sp) while ( -null[ WoHjGu1i().CW9EhDhVWf85Xp()]) while ( true.De57traccB7()) !--nVk4R4jiBSw_dh().hgjObFMK_gFj1G; { boolean[][] Ko82; int YeXasm8M; Ka1TiMY8lFAtb ITI; boolean lNoHrxpQTAFLji; --null.Eq3apaMPJd(); ; } { void m2t0cj8; while ( !-722.hGRtfg4veStZF) if ( zq().cIaKlNSRPKv2g5) { int Up5_Anh_hHQU; } BPS3gi[][][] rU5_tw27q; VzMO_EGcqzg MUfnNXo6z; { if ( !--P0.m()) if ( EUuI25n0LaJ().Zz()) true[ null.tjcaDq0ILFn()]; } boolean[][] r; boolean[] YbZsBVT; { ; } ; boolean[][] K3If; if ( new nynWBRm().e56CxqFzbSD7r7()) return; } int mz84yKxrdHLqYY = !-!-!-!--new _BtihKWFQvO().FJJPaA4B(); if ( !false[ 874162.uWIQGd]) !-Lou3_jBjD()[ !!!new bQhv8Q().nSkWebr2()]; if ( !( new int[ TA8Q418TBhT().hZciu].b7V()).aT()) while ( ( ( -new int[ -35[ -( true.Zh4zF6SUjrqZg())[ JUriplFiihk66m().PzAnnOF48k()]]].K6ICs0y08).fn0Qk).QcV()) { boolean[][][][] nvv4TddrGHI3; }else while ( !!7448139[ !!Z().h8aMlpfK]) ; void[] Q9Y = ( ---!PE.eu0Fkx6NSyJSw()).Ncs9 = new boolean[ !new t5NWPZQL().UPAZcn()].qTfpZ_; return; int DcQDyFj = !-null.k5MTm; fqvUSk[][][] a93Zt; } public static void pPWVfiosAjRQBu (String[] kF) throws Q { int[] qgMo4Fkvgp = false[ -1614971.lTbILjV()]; { OvV OPOf; ; ; if ( !1.S7()) return; while ( --false.OFj2WQmrQb1mR) this.sSPH3Ygn; boolean[][][][] PhXKdd3qib; return; if ( !5.W) ; int[] fJ; while ( -!( !-!--true.S()).nGOsS) while ( !-J0jmK3XDWE()[ false[ --!!!gCWrEl_rokC4V[ -----null.LmJfgPMtA()]]]) while ( new obt().yoz1VesGDZ) ; ; boolean _jdb; } this[ -!-!new RQYvXHf5().nC54c()]; bjXE()[ !new yC0vx2Zs_yJB()[ zef34[ false.pa6ajv]]]; int C; int[] fhkbmt; void[][] c6NVVUVXqHB50; ; boolean OTh6; boolean ha0D = !null.imwIS(); Bn1wNJB[][] MBNw = null.rYWBO = !this.SyLR9A3d3yhz; if ( --!-null.Iar) ; this.wwwzdgGD7k(); boolean[][][] oHBuZKlZmJs = false.WrdOjCPCV(); !new boolean[ this[ this.U8bjZ]].PaGm; { this.t6_INJ2; ; boolean aHy_; IbAQZalBPmUz P2; void _ivt; if ( othavirNVzAV.T()) if ( !!new mtbi().lWy()) ; void C; { if ( -new boolean[ -!-992418161.dbGpAL8AJp3wN()][ !8253732.cGrvbtOM1()]) ; } while ( !!bb_JpPpy6p7HC().MtWfd68Z_QFOWd()) if ( true[ ( 246292.xpg()).QCpz8tnYSM9Pt]) { return; } if ( 5[ -nSZOP.K]) if ( -this.MvQDNUkwkl3ygN) ; { return; } { void XD3R; } int[][] L6zy; { !92229.p_zNTSs(); } } MuzGpxN8 Qt32s4uEp = -!new boolean[ !this.rAg8el9][ new V().kQXHmeKite()]; !new r4Yq4Ztu1().Ritydg(); void[][] L5wfEiVc0P; } public static void pgUx (String[] o) { { while ( -!!null.Gb) XQQiqMFUW()[ null._y24uFR2P7u()]; boolean[][] BGaEa; { boolean[] bDbezbK1Zj0Z; } !JwyEI[ new void[ ( !-null.sZvlZrSeJ()).KOYOP][ -!true[ this.F3J]]]; boolean Oote8U7G; boolean n4A8EaZs; void yqhhFyeK20; { false.CIl2SW66mTG; } boolean qq5sAOwOjl; void Cs; while ( !-false[ !--!---!false[ true.mhmP7Gi]]) ; } { !( null.ogz).j(); } Q8C9DHLrPLu[] q2_n1; { vy4gywL3[] LXlA9dOKNQd; int[][][][] U9; 497.Vabrzhj(); { { int Q; } } return; } while ( true.DMt) ; } public static void lPu7IWnQUaE87 (String[] Uv8f2fdT) { if ( ( !false[ new void[ !( !new gAo8kjO6Q6U().Xc4fIwZR1).eHOm()].lEkg()]).xwBKk5Ycwv) return;else ; void[][][] b; boolean[][][][] L = new U()[ 29[ ( -!new h7IfTLwG_().WQ0ZAXQ1())[ tXiV.qCt1SmJPKqkJ]]]; { !!this[ -!new AjyI_c_vo5AA4v().kivQy()]; return; boolean O7Luq1R; if ( null.vXjHe3) if ( !new OIe9OI().B()) return; return; } ; ox5C3[][][] jSn = -W_V()[ Xhb_Dv().jpddQg2yKee9]; tRI5RNgS _LLQ1; while ( --this[ -!false.RhMgeFd9JFa6CP()]) if ( this.JHy8()) if ( false.zv7NlAdwngG_U()) { new boolean[ !null[ --new BtWa[ null.Vibmxmg6qK()].vBal_Dkqj()]].a(); } return null[ mv()[ ( new vVMl()[ -new HyLf().WuNrmEfpt]).Ot0]]; this.WxD(); { null[ false.vQmu8E()]; int IAoSdXK; void[][] W4UsHTbkuK; fid4Cwr _PAzgTd8bds; { ; } ; boolean AhlDJ0KQseXV; 1277[ -!-2770[ 6.bQ3]]; return; ; { void[] hC0rjHu; } int[] h; if ( true[ -9.D1Ou9xRDPHR5M()]) { boolean[] bpcGx; } wyKUWO8cU ijCryVhYHBPfqT; void RJyiE4MhExe; { boolean nsaAe; } } if ( LCtiUqal().U3wVn()) while ( ( this[ null._J])._U) if ( new f2JruK3[ ----null.wkU3bLoZ()][ new Pj9cjKc[ new vhu[ -false._W][ true.cjxHEKIkEvPC()]].I1zcm_8()]) if ( !!--!!!( -new j604A6H60_Si[ new boolean[ IafndOcMWwMEmt.YAK4LQ8FqfiN9_()][ !( -!new A().Lqm7ZcU7)[ 96625.I9ZZe()]]].okjkDI0bWn86ep()).rAamsYtE5M) vaqT().FMp; void _4TmyI; i[] tKKbOzx; int[][][] k8 = 602339.qEr232lrqms2dj(); ; void vpwTXCJWy = -!--!-!false.DoGhoOij9E(); ; while ( false[ qmgk().I]) if ( !G92qpYHWLv().Hf1O()) while ( !-new S6j66y9rgKoLs()[ -false.IWN()]) if ( !new boolean[ -SMx().fYdh6TlSJLDeo].Hxze7xC) while ( !new boolean[ !!---!true[ ( !!--this.f91DF9L())[ !true.Ec675]]][ !new SWaeiRGHFRw22v()[ false.I9lcqiup4O3()]]) mRAiDSWL0Tt()._fu(); int qkYmLFfH2 = Z2Qs75Kzv().RYELpZctYh1() = ( l8I_49XDgv[ false.fxaIy5eZaU7])[ this.zQcsHLKGN]; } } class fByAsbw1BqI { } class vjpVyKM7Nx { public static void nLKtyYTWIw8 (String[] v0c8GpUZ6vb60Z) { ; return -this[ !JdWE6AO0Zk()[ new MBRz6IDyT59gV().nnoPy()]]; while ( new int[ j9sIBkNkH3k7yB.FzgHmumZI()].yK2ZnnO()) ; H pGXqSBo; return; VKo MMwdJtW6s7A = -xVNZUalGayUR.TIEB9wuZZL = ( false[ false.JZgn0BX()])[ new int[ -true.cJYHZhc2D()].sBDmAsrdymD1Nt]; void[][][][] ehH23 = !!!-!!new iAbeqq26qlK().AXnZMxs; G3rhEvVPRDo[][][][] WF73aPojcSB = new dBnli_dG8COT().iArMKmDDk9(); TYODqenqGROPw GbInDt0VFgDmPD = false[ true.H9bpUNy14u] = -256958.Gmlr(); if ( true.BW()) if ( !new cz9JhrHcRv[ -false.fes1JiWvqxDMRu][ -( ( ( Ox3DAmcFF3uf().FCk()).AKykVXyqHs72()).sRIo1p())[ !-0407319.ZMiql5nrDhh()]]) ; { while ( T4I[ false.m()]) null.LOy_050tdc7XI; while ( -( new zjvZ2InqTldoyN[ null.rMkXo1FhDDrjn].QHHy()).eGOLzME()) if ( -true.x6vVDdkbQDFFhG()) new int[ !null[ -null.l9]][ true.lf8evGEa702r2d]; void Gfxytizg2JSFn; void v0Nm; int vUOR3K65; void yOyrUAEuT33u; while ( this.hlqQvMCJFwE) return; void[] GBR3j3zAJYZ; } ; int[] l; { void FosPX4cz50t9; dT[][][][][][][][][] y3aLpLHt4zlX; if ( -new rW8v7H[ !false.Am3ONfsMAwDLav].T) ; if ( true.JJLUv()) ; ; } while ( -73.sIhK()) { { GTDGonTtimT2 HedokHB5HjWHQK; } } void[][][] fnEB3zu_N = --o43Iw.ol7zf = -( !true.HW)[ false.o]; if ( false.VFCnynwRgTEg()) if ( 5._pWW4uOwRxZcT) return;else { MYVob[] yzgQu; } while ( true[ -!this.KJPx_no7GDS]) return; } public int vVM4K; public XxMjdbwg ZCkzbTxl2fy9D0 (void[] VR1Jx0mW) { { if ( !!-null[ 3949574.vh69_K5XRqhJLO()]) while ( -BZ0VdL2K3S4y().H7qqs()) ; -v[ !qqw8467r[ true[ new cIA5M().NgbdDyhXn4i6c()]]]; void[][] TuPh90t9t99E; -new void[ 31294.CJy2EK].T(); int xt6hhsgaEOM; ndVBAk9t4VKA[][] iHc5KSeghKY; void[][] JzT2h3eCis; boolean Tv6Mc7zFf; boolean G2_klwkSw; } int DFIxZG; void[][] j1mPWQ = new quzOGIJZ().JozfJT2 = -_n3y3HnvCSf().o87Z6MUCdz(); ek4P_q9bMpd4 UI; return --24048854.BDQL0T4(); F3CkhJDQtgIGj[] HoS6X3 = -HwXngLxPU92.nILIAp; boolean C; int[][] ThiWqdByhyK = true.F8cZMtkmnyJNT4 = !!!-!( !false[ aUmSRkbqWo()._ikNVb3kJNWIsD])[ false[ --5[ false.wM]]]; null.ovoHC(); int TpQNf1Ip0T = !--!!!T2he.pAWKwaaLZ; void[] aF_wy0g83mblz2 = new boolean[ !-!( ( Yf().KeZXCdiIHM()).uAHJq73DqDl()).Gg8Z].v() = !new juQcie()[ ( ( new wEEh0LCH4u()[ -32628335.XQ()])[ kd5sFUE_()[ -new void[ new void[ dIF_cxYydZY[ 93.RHHfN]].YKDJqb4fV()].oOqf0REonIXY()]])[ L68ujYMg[ -!new boolean[ true[ true.S()]][ this.hbPlh]]]]; { return; void A_pFZy; false.E7j7GVs; } if ( _fL02()[ !McovA8An_8.a8cvVLyO]) while ( !!339047.GQjz4e_cL5k()) 1044[ 73.PDtBKu8iO]; if ( !!this[ ( -14194.nvZG3).nea]) if ( new Qjgy79u().UtKb29()) if ( -!new Qf_bjXPM().Kna3G9()) this._X; kC7T5h QEeZ; while ( -!AZXq7wFfDn()[ null.oKtt()]) if ( null.r18yoZFueT_r()) if ( this.vFua3n()) while ( Av_()[ -null.JxAZKuUntO4]) ; if ( -320779949[ null.S7UeU4Q()]) Noah().vWkS(); } } class M { } class HYGMJ { public int[][][][] Mo_Ovh5 (void nCL73nu0cMXX5, rRkUAKAa Efo2AqfPD1ee, tUXD9XoXJV[] _, boolean QlpSX, int[] Zr5afuanmt, void rb5T, void[][][][][][] XdLg) throws Gd6JdB { int[][] wVaMzLymGc = Gg.tMmv650(); boolean[] gDCH = new int[ !-this.usswiklW].mP(); } public void[] tueRqLoa9 () { !!Ht4x5jt().ylmKIGyVVQJ; boolean[] weabQkt; ; void Ps5BVhYNZDk8 = -5[ !!ZqkJpl().RLT()] = -this[ false.WkCzzIB2vksG]; cR2r8K6P1X[][] CYrrld0cff2lk7; ; return; if ( !!B4()[ new ft().jwb_3pE()]) return; KhfeWkxgc5HG pa7Q6NolO; return; int[] StTliMYN = null.HHlajSRkv1w = !--false[ !!null.xpsd]; new boolean[ !!this[ false.LrwwkaTOx1dZ]].hwlp0SHGQA1; boolean[] EHEY1yL3Oiz = Z().p67NwZ6OE() = new int[ wnyNORfVm().EnsaPN()].yb79D0j44vNz_; boolean pO3lAqol2o8p2 = false.opP1wtkA() = null[ !--01.PjfbRhNB()]; if ( !null.j0YGj()) return; !!-true.Q(); boolean bS; if ( !-this.Z) if ( ( -!!!!new Uxf_R_7RW8dLSl()[ !true.SA4Sv3WBRI6()])[ true[ new Zl2LDyosF().dz9WZrw()]]) while ( -null[ !new ut5V8()[ new j6[ -ymtHz1aOh4W.IoOzT][ S0l2Ms2Z[ !new kG[ !--this[ new YG().wbdxF]].wyBSW7leKZ()]]]]) { ; } void[][][] nfiKBYwdUeW_1 = this.gQndWom1Cci() = !null[ !this[ -new fK9()[ !!this[ new rSmzFdup3cC().kjwKADMVSHB()]]]]; void kDfp; } public boolean[] w6kWW_qW; public boolean Ui0hQ0a1TqWV () throws wso2FRx { boolean g5tMUO6T; void T7S = -kJe2KG[ null[ -!false.G()]]; ; return; int[][][] Khve1f25WTbZ = true.sL1HAFyXpDB8K = !this[ null.o_Mm]; } public static void SG_sjTCk3Ckd (String[] f694dytB39nR) throws MYs9LO { void[][][] I6xo; boolean[][][][][][] G258eqoELL = 69.epCBfY9Dy_9(); boolean[] WoPy0 = !-Iy9LSl1iab.uiZnIFHweMQmKe; boolean[][] Boh2De6mmqn = -!new void[ true.uNvQZDwLsABa()].t = -!new Kay[ !( !!C26OAUJM().Ip2QvB()).U47uiAp()][ null.Fr4cDoHbhUZiad()]; void[][][] o3HwMs; --new void[ -new boolean[ !c_()[ --( ( -!true.aZcbVOr()).HBiM48V).pojKcgi5]][ new boolean[ ----( !( null.DARDhEYvn7kq4()).yJ7nARnh()).I_yNDm].MvN0ugvqmyG]][ ---hgI9yB97EO8_().cB8AkvLA2mU()]; ; int[] HKoxmo5bv = -!!NpIn9iFxJaW().HL2gzysZBTo = Ir8pMynkZG().qPjbcO4NHrTNwo(); } public int p; public static void n8p (String[] WHZcqTX9) { { void GXUe71jR9ju; QDOqcdu3PU1B[][][] Tk9RRlla; --!this[ !( new rOgCKVkCV().RjOKwsTzWGQ8fK).Et4S_kxsJD()]; void g0OoCFZHQ8GV4i; int[] ULpNk07E; void dJ; v[][][] iB7S_LFV; while ( 4010[ true.Cn()]) { D11MD3yg9UXo[][][] f; } while ( !34176[ J[ !( !( ( !DtrAV[ !new V1YGgcpLeGtI().Dz0ocP8Zespv5]).JK0KaEUdZw()).UOp())[ false.jPUezzK5ROT]]]) return; } huyA1nZ tYJajsBGsJH; boolean[] hLkDHp = !Jy().N() = !false.WOnranIso; void[][][][][] sBHzeLor9o = true[ -false.IfzUnfw32uV_g()] = true[ !( ( false.Ehh())[ !!sM.Bvwsn()]).R_bZZpHXodf]; int weRhojnFdxxH = ( null[ WiZb11XEN16We().IlxNu])[ _1v9S73Ws.RLf] = false[ Zp5WJhX.TXpkP()]; zz MI7 = uw6().lMAU9 = true.hu4Sqp(); { ZZ1rdk2Mmti[] xbkn9GCNJHE; while ( !-!-bR()[ !--new CMZc().DLAsGDWU6Cw]) while ( 1793461.yBRsNxMbsIm8) while ( !null.aAUK2p()) if ( ( --null.r).n0NPSxQAKU()) while ( -!dSBg5NhObSuF()[ Zt7NYP_yJ7Vd2().Be6jx24cvmif()]) return; return; while ( Vx487G.dfj32wFQYNRPM()) ; bLGNhT0[][] mCIPHVgpDQia; int[][] UP; r dfC; while ( !-( !( this[ !false.e4ocav]).BuIXUwLfXEdP7S()).NlShXKUx) while ( !this.kRBgRJ) if ( ( !skiQcWz().Q6w)[ -!!-dU8i5hCt.Gh0RCiY]) -new int[ -d.AU5LNfm][ !---null.oq4l()]; } } } class z1Fn { } class OVmAgPcyg { public void jGwOYH; public static void YYSp (String[] Rl2IvvvH) throws fS3 { int[][] Z5NFL8Qa; n9n_Yq3[][][] U5Ldg2Xp = !( !-!-!f3A9H().mW)[ -false.I()]; while ( !!a4eOKdlh().Ir7Cr0OLPWT()) if ( --!new fi1aD4().fYmjlezzDHZ()) return; while ( -new zjLfXqC6xa7lEJ()[ gmoBlY4m().I5]) ; if ( true[ -!!-this[ --new int[ false[ -true.Y2d5m]][ -!!--new boolean[ !-!-O8F[ !!-!!RQTyf1f.ePAV]].NyZn]]]) { return; }else if ( -new boolean[ !T_vb[ new hEioQqXMN().AsyL9SujQO()]].IUu39id8v) { int SPOira2wrg; } new YBI_wDHCRPvKs()._YlaKr; return; return -!-!OAM0aUVtUd().UXI; ; int[][] Agj7Ri1ycWr9F = new HYlDbGWstjlW().uu0 = ----null.WX6ZHtwGN63(); boolean Z2yqRHOsfKQl = !-!!ntJC2j39rMIQ().kAJCLZ; { while ( !false[ !this.RcXg2Kzm4vr]) if ( null[ !1395798.IJr]) while ( null[ null[ !this.THIe7DwTz]]) { pCgYb6DGmnM[][] M5RRhcAW_jE; } if ( mkX7SdWv3Hp6m3[ true.CBD6nXr()]) return; int TL3po0fKW; boolean R; if ( --new gTWiL8ClpcwVx().c6SL2CRi()) -new U6LSG6().r(); while ( -!-new boolean[ null.wpoBtDk()][ null.RrvCzAAz9k0y()]) return; while ( -new yQO8CRmAZGt[ -false[ new aogkCCIYcd().q1aY()]].DKWN4_BRxdAaqn()) if ( !BzBhV.sRIOW6OjUqZj()) { ; } } v[][][][] S = new clZSnll7()[ -!false[ true[ null[ false.MjZ4Atuw()]]]] = false.vQrMOtnAcZTgN(); CGWUTbnioApl8S ufPbkbVFcXEIvL = -!true.V6__tFf85D5O0; } public boolean[][] Cb; public static void RmO_ITXlaU (String[] KVcAZjTR_) throws WcueSdMo6S5 { void TuPZhMJ; if ( JFjkAgkCS8fn().eqZCF()) while ( true.RGkbCGYS) return; { while ( !!!true.HetQg94c()) if ( ( !null.aWf)[ dPZSoETXoCekl()[ ---!false.qy9n98fn]]) ; boolean T; void[] LCbLor3sAMKXje; } } public int hVB4V6wDz () throws Dc { !-54771898.lsotdmcbHErE; ; { int[][] e_3idBu; jNzzld[][][][][] oSbGV5JF0l7Okc; ; if ( !!new boolean[ !false.Gcqo9UKRWqlS()].z0Hrp) { return; } if ( -this.bNoZKUTC) return; int[][][][] ZX9aQD4QyKSH; boolean[][] cIkTv; boolean[][] kihnN6y; K7salsQFI_qw xBp_cJ; { int[][] jT; } } boolean[][][] L; if ( this.hY__SWNmkc) while ( this.l0v()) return;else { !!NHgDy6()[ !QX4CMMC3OM().c9p()]; } boolean Jz = -!-new jbBfSjtV3YJ()[ this.AGqH02LB()] = new X11TJqcemQFr93[ 15983905.f][ !!l().Vm4z4()]; void UBeqc; ; if ( 09141.hzi) ; while ( !!9037072[ aK0wR53Kfp1[ !uw2nIz826XDKG.mor_zIduHI()]]) if ( IiS.f()) !this[ !!-!FApYaVbhCN7().cSZk0c6]; int w5sM3c = 18062.dQCddoLJC0Lv = null.W5R8F6YlR2J; R_o2SA2N5 WImoAh = CQGhEW3Pf.l8SoPVPH() = -!!true.cF3HbRyyvF; V94G[] Gte6IHCOB = lqjKuO7p()[ -e2hMKq().T8ZqX3U1Ieaj] = --!dcKXcdKF()[ !-!new az2VjYW7vj().s]; ; } public static void Yt1R (String[] uTaUWOlX9vt) throws ZGcF9 { P1[] XR0zn3289VG = new ODgI4p3ghm_().K(); return; return 35039[ ( !taF7dirq1().mZ7RoFmGg51M()).uA0q0zfU]; int FmpMla; return -!--!!-!-this.UhvUVvaLcgV(); if ( !( 508602011.E())[ 0828[ this.rOWqhlYI_O]]) return;else { void[] uN; } i43M[][] Qu4JA458mS = false.ePkTcH; int wI_Jz; void xs0bkD; boolean[] sPSBMF = ---!-this[ VYR9nPEakd9y.gHKhGI1HDMSS()] = tyDv_RbavNYyv()[ !!!null.T12]; int oJUH3h = --9043494.KHw8aD30gP06(); void[][] lUhO2qe = !--!!--85168477[ !!OyhmUM7qZzlQ0[ this.oRU9kT2nDU7()]]; { int X8g8_; } void X5p7xeT = !b7d5ubYeVE_V2().E(); boolean[] axGx; boolean[] e; ; ; boolean nM8GP5_S4gfV1; WR58wDwb0L.SiX9WMyhXlQbk(); } public void mdhLrgK () { return 959896306.b8(); while ( !new int[ false.FGF()].KfxmY7GJo4k) { boolean O5e50; } void[][][] JzyWk0zcsPk; EfDmEXcNXQ7[][] UZyDUiCQTWWH = fC().LxP4DCj9z(); bJnIAqDLW[] dkyUaLLwIxkAK = --!!!new AzQRWmr().KKAd; } public static void e (String[] RTy7C) throws mzH { { while ( ba[ ( new Efxbh4wBTC()[ kfonFJtL5Oki()[ Y().dNFTFqUP()]]).MrBPBd47_wdCFA]) return; return; !70.qW; ; return; ; boolean AZpkRazaLvG1; if ( new mJJXp()[ !--( !!!true.ypn()).GKcTarhV()]) return; int gxQBo8t2XH5rQn; KqO5X6j[][] oXzZyJ451PW0; ecuimkUZM8i h9O; if ( !!IPeSg[ !!--this.ckYu2E()]) true[ fFBX_oiNAlqeWf.dnZ()]; int GKpjnpbD; VB7uV4WvQ Ttc4; if ( ( true.ARxhKF9)[ true.My3]) if ( !( new int[ !g3H().EpD2kDt26x].OmXYxdj19CwyY())[ rXwmABjy5CS().lv]) while ( new Hlde().f9ZOUH6) if ( CHBJfbV3CSJ().u5q1ae()) ; int xbOXWM; } -this.zy(); o.mhLpYsdffO(); void[] Aw; while ( !new nz97zlbXDK8xq()[ !-!new d().yKkBFSRNX3()]) { int FHnnd; } if ( !new IeaR0F93Un()[ --null.elGN2WW6()]) while ( !3670761[ -( true.o0sz6vQ)[ -( oArCiT7.xem7X_I5gxR0M1()).U()]]) if ( false.mz90k) if ( !!!!!-QT5hyzSj1wA8E[ -oRtc().bH6I8IiPA()]) ; return true.lJbAweDo(); } public static void ZlA8jdNSIiY (String[] QK5OEa4egH) throws t4Wi3LZ6e { eU4unC4h sLSNKWR; boolean mjQ; while ( !false[ -true.GWTV()]) UFiBZ12dWrx4().x7QeFJ8_98sp2t; s3RN_gXGAc aa1; ; int[] hVRWc; return this.i0PSmL(); ; if ( null.DtRW3()) if ( !-new int[ !!--!----!( !-!-!true[ !new void[ new Ti4T().uHoN103()].n])[ -!7.lkivu]].QmleC()) { void yPgOIm; } void[][][][][][][] m; boolean[][] fi4htK; while ( -!----false.Kio8yXh2Y()) return; void[] g = 239710433.AfgPe(); int n7dH_4N_nE = !new f0ZmeGYd2S().L0LSwfLY26MywU = 905975.Z7mvW23Qdh30Yq; int yZKJ18f = new void[ this.HVUYHjp3Yu07][ true.a3j8lvhw5k()] = null.Y5MnxF; false.Sv399RKMl(); return; while ( false.nJ()) ; cnI9KFY6yh Q3x4oYpK66Om3C = true.Av6dz(); return ( !565[ new GBFXh[ null.ISjk3xveTsf4()][ --this[ ---!new p().OTqq6eDMHY_()]]])._G9sPop6QGm; } public static void rIorCox4uPi (String[] oUt5r7Xs9) { { return; -new boolean[ !new void[ false.znZQIYzAPkeQ()][ this.kudwP1v]].v4yttV2; this[ new void[ !( null[ ---!null.P]).SMLwqtR].RvbIuPsYrQ()]; new POsHQW7Apgw().D(); ; ; boolean oUSQ; while ( !!--true[ aTYoBfaKXOZl.SNe4kNl0R]) return; while ( ( ( -_KE3jIzjOE.uxNI_nICKn()).LC()).UUgC56_KZpV) ; boolean bs885LY9ZHP_; ; boolean JMLSW; ; { void THo0fT_BSvaMh; } S6cTmBW[][][][] KG3fMv; { return; } } boolean Z5F_a; int k = -AKx0RAT8Huc().tN2jiLLup36(); !this[ !114346[ null.ObfHr0L()]]; QVbTd().x0Y(); ; new FFipjvt5Pjn().maJvCUK32NlCo(); { F4HliAQQA8uQ[][] cCqYgO; ec[][] c0RP; ; boolean[] pW07V926gMbCF; ZOK[][][][][] iSy; return; int ubKvJF7o78w7; boolean IAeQ; { void[] KHRKvUHh5; } -this.lUY(); } boolean myGTPJIm; boolean bX7BqxdGUhT = false._f2PNXlPTCG(); } public void[][] Tp; public static void jb (String[] duY15TcCmzUb) throws m { { false.Lkjw_17U9MM; return; !!new void[ false.wpr0kZswV][ ( !!this[ !Xx().YKOlIbYnuV()]).Zv8]; new int[ new AoTv4d().SoBJjEg()].Gh12a52C4J3B(); FU3kcEUgK9J DPGpr; boolean[][] Jfs04NdAc7ubc; -!!this[ !!417047[ !-!!this.DTeCEjMXt_()]]; void KkC27jP; { void x; } ; ; RMye[] h8QI; ; } true.SrHJKZM3qFv; if ( true.MVReZ626mmzz) if ( true.DTqJ6u0OI6Zu()) if ( -new void[ null.u9HFx].UA) if ( !!( false[ !PLaf4Aw()[ gz6()[ -this[ new drv()[ this.XWJEzZ]]]]])[ new ZYpg38VJp[ !new r60MHhwFY[ ---true.eA7TAq()][ null[ zZ3vl8PDs.DrGEwDmji]]][ new int[ !074159.lcJGJ()][ !false.xkc1WmriM0iq()]]]) return; return; int hv7g = ( !null.TiuNGZvdwxZm())[ new boolean[ -false[ -new uYlY5poYZKEI()[ -this.IqqZX2hdo]]][ ( !-false.d0)[ true.XToL6b96__T5Qw]]]; if ( -new vLG[ new nzjBgww44yrv[ ( true.llWnnXWkc0VOQZ).Xnf7R_hr8GtuU()][ !gE0KpHc()[ -this.gcSDx1yq4k()]]].L7RNjE()) { int[][][] Q; }else return; boolean lMrmLp; boolean[] oe6tlxx5Mgzi; void Jpmsw3RKML3; void[] eSX3qjT7WJ63n; } public nRly[][][] HK_s; public A1UbIFY2[] JBOQUabCHWugJ; } class YmT6aIjaDgI { }
3e05f56c2c1e1ae588a4332a18e33f949901cf11
1,524
java
Java
staff-service/src/main/java/com/virtualpairprogrammers/staffmanagement/services/StaffService.java
rejupillai/fleet-telemetry
9efe1d84be277d96dbe142c666e5f26fc477946b
[ "MIT" ]
null
null
null
staff-service/src/main/java/com/virtualpairprogrammers/staffmanagement/services/StaffService.java
rejupillai/fleet-telemetry
9efe1d84be277d96dbe142c666e5f26fc477946b
[ "MIT" ]
1
2021-06-17T20:09:51.000Z
2021-06-17T20:09:51.000Z
staff-service/src/main/java/com/virtualpairprogrammers/staffmanagement/services/StaffService.java
rejupillai/fleet-telemetry
9efe1d84be277d96dbe142c666e5f26fc477946b
[ "MIT" ]
1
2021-06-18T08:21:21.000Z
2021-06-18T08:21:21.000Z
41.189189
161
0.715879
2,500
package com.virtualpairprogrammers.staffmanagement.services; import java.util.Map; import java.util.stream.Collectors; import java.util.stream.Stream; import org.springframework.stereotype.Service; import com.virtualpairprogrammers.staffmanagement.domain.StaffRecord; @Service public class StaffService { private Map<String, String> drivers = Stream.of(new String[][] { {"Purani Dilli Trucking", "Man Singh"}, {"Amritsar Packers", "Pritam Singh"}, {"Worli Packers", "Mandeep Singh"}, {"Namma Bengaluru Logistics", "Mohd Sheik"}, {"Jammu Carriers", "Dilip Kumar"}}).collect(Collectors.toMap(data -> data[0], data -> data[1])); private Map<String, String> photos = Stream.of(new String[][] { {"Man Singh","https://storage.googleapis.com/indian-truck-drivers-image/mansingh.jpeg"}, {"Pritam Singh","https://storage.googleapis.com/indian-truck-drivers-image/pritamsingh.jpeg"}, {"Mandeep Singh","https://storage.googleapis.com/indian-truck-drivers-image/mandeepsingh.jpeg"}, {"Mohd Sheik","https://storage.googleapis.com/indian-truck-drivers-image/mohdsheik.jpeg"}, {"Dilip Kumar","https://storage.googleapis.com/indian-truck-drivers-image/dileepkumar.jpeg"}}).collect(Collectors.toMap(data -> data[0], data -> data[1])); public StaffRecord getDriverDetailsFor(String vehicleName) { String driverName = drivers.get(vehicleName); String staffPhoto = photos.get(driverName); return new StaffRecord(driverName, staffPhoto); } }
3e05f56f7d99b7bc8a2fb91f108906bb5ff6bf20
1,352
java
Java
src/bot/util/CompteurMessageProperties.java
posdon/Compteur
ebc1875a3fe257fde88c79b880f901da0f1db203
[ "MIT" ]
null
null
null
src/bot/util/CompteurMessageProperties.java
posdon/Compteur
ebc1875a3fe257fde88c79b880f901da0f1db203
[ "MIT" ]
null
null
null
src/bot/util/CompteurMessageProperties.java
posdon/Compteur
ebc1875a3fe257fde88c79b880f901da0f1db203
[ "MIT" ]
null
null
null
32.97561
91
0.721154
2,501
package bot.util; public enum CompteurMessageProperties { ALREADY_HOSTING_GAME ("Sorry, you are already hosting a game."), UNKNOWN_GAME("Sorry, the game '@{0}' doesn't exist."), UNKNOWN_HOST("Sorry, you aren't hosting a game."), CANT_START("Sorry, the game can't be started. Verify you complete all the prerequisites"), CANT_END("Sorry, the game can't be ended. Verify you complete all the prerequisites."), GAME_CREATION("You are now hosting the game '@{0}'."), LAUNCH_GAME("You launch your hosted game @{0}."), END_GAME("Your hosted game @{0} is ended."), SCENARIO_INFO("@{0} : No description yet."), GAME_INFO_SCENARIO("You are hosting a game based on scenario '@{0}'."), GAME_INFO_WAITING(" The game isn't running yet."), GAME_INFO_RUNNING(" The game is running."), GAME_INFO_NONE("You aren't hosting any game"); private String message; private CompteurMessageProperties(String message) { this.message = message; } public static String getMessage(CompteurMessageProperties message, String... params) { int indice = 0; String messageContent = message.message; for(String param : params) { messageContent = messageContent.replace("@{"+indice+"}", param); indice++; } return messageContent; } public static String getMessage(CompteurMessageProperties message) { return getMessage(message, ""); } }
3e05f59b2836076b20e9bd9f01f128d83a389644
5,306
java
Java
app/src/main/java/ro/pub/cs/systems/eim/practicaltest01/PracticalTest01MainActivity.java
catalinalbi/colocviu1test1
bb54ff815379305d607ea97b4257ff82c31dd427
[ "Apache-2.0" ]
null
null
null
app/src/main/java/ro/pub/cs/systems/eim/practicaltest01/PracticalTest01MainActivity.java
catalinalbi/colocviu1test1
bb54ff815379305d607ea97b4257ff82c31dd427
[ "Apache-2.0" ]
null
null
null
app/src/main/java/ro/pub/cs/systems/eim/practicaltest01/PracticalTest01MainActivity.java
catalinalbi/colocviu1test1
bb54ff815379305d607ea97b4257ff82c31dd427
[ "Apache-2.0" ]
null
null
null
42.448
122
0.61666
2,502
package ro.pub.cs.systems.eim.practicaltest01; import androidx.appcompat.app.AppCompatActivity; import android.app.Service; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; public class PracticalTest01MainActivity extends AppCompatActivity { Button left_button, right_button, secondary_activity_button; TextView left_text, right_text; Intent secondary; Boolean service_status = false; final private static int ANOTHER_ACTIVITY_REQUEST_CODE = 2017; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_practical_test01_main); left_button = findViewById(R.id.left_button); right_button = findViewById(R.id.right_button); secondary_activity_button = findViewById(R.id.secondary_activity_button); left_text = findViewById(R.id.left_text); right_text = findViewById(R.id.right_text); secondary = new Intent(this, PracticalTest01SecondaryActivity.class); left_button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Integer number = Integer.parseInt(left_text.getText().toString()); number++; left_text.setText(number.toString()); if (Integer.valueOf(right_text.getText().toString()) + Integer.valueOf(left_text.getText().toString()) >= Constants.THRESHHOLD && !service_status) { Intent intent = new Intent(getApplicationContext(), PracticalTest01Service.class); intent.putExtra("left", Integer.valueOf(left_text.getText().toString())); intent.putExtra("right", Integer.valueOf(right_text.getText().toString())); getApplicationContext().startService(intent); service_status = true; } } }); right_button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Integer number = Integer.parseInt(right_text.getText().toString()); number++; right_text.setText(number.toString()); if (Integer.valueOf(right_text.getText().toString()) + Integer.valueOf(left_text.getText().toString()) >= Constants.THRESHHOLD && !service_status) { Intent intent = new Intent(getApplicationContext(), PracticalTest01Service.class); intent.putExtra("left", left_text.getText().toString()); intent.putExtra("right", right_text.getText().toString()); getApplicationContext().startService(intent); service_status = true; } } }); secondary_activity_button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { //Bundle bundle = new Bundle(); //bundle.putInt("left", Integer.parseInt(left_text.getText().toString())); //bundle.putInt("right", Integer.parseInt(right_text.getText().toString())); //secondary.putExtras(bundle); secondary.putExtra("left", Integer.parseInt(left_text.getText().toString())); secondary.putExtra("right", Integer.parseInt(right_text.getText().toString())); startActivityForResult(secondary, ANOTHER_ACTIVITY_REQUEST_CODE); } }); } private MessageBroadcastReceiver messageBroadcastReceiver = new MessageBroadcastReceiver(); private class MessageBroadcastReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Log.d("broadcast", intent.getStringExtra("data")); } } protected void onSaveInstanceState(Bundle savedInstance) { savedInstance.putString("left", left_text.getText().toString()); savedInstance.putString("right", right_text.getText().toString()); super.onSaveInstanceState(savedInstance); } protected void onRestoreInstanceState(Bundle savedInstance) { left_text.setText(savedInstance.getString("left")); right_text.setText(savedInstance.getString("right")); } public void onActivityResult(int requestCode, int resultCode, Intent intent) { switch (resultCode) { case -1: Toast.makeText(this, "OK", Toast.LENGTH_LONG).show(); break; case 0: Toast.makeText(this, "CANCEL", Toast.LENGTH_LONG).show(); break; } } public void onDestroy() { Intent intent = new Intent(this, PracticalTest01Service.class); stopService(intent); super.onDestroy(); } }
3e05f63b07b60fb315c61fa831873df46559c758
1,321
java
Java
src/main/java/com/inqwell/any/ConstObjectDecor.java
inqwell/inq
31ce4cd6b9b123b1ec4462905ccbcf7c00d6efc3
[ "BSD-3-Clause" ]
1
2016-09-25T16:41:57.000Z
2016-09-25T16:41:57.000Z
src/main/java/com/inqwell/any/ConstObjectDecor.java
inqwell/inq
31ce4cd6b9b123b1ec4462905ccbcf7c00d6efc3
[ "BSD-3-Clause" ]
null
null
null
src/main/java/com/inqwell/any/ConstObjectDecor.java
inqwell/inq
31ce4cd6b9b123b1ec4462905ccbcf7c00d6efc3
[ "BSD-3-Clause" ]
2
2016-09-25T16:48:49.000Z
2020-05-26T20:00:33.000Z
16.935897
78
0.640424
2,503
/** * Copyright (C) 2011 Inqwell Ltd * * You may distribute under the terms of the Artistic License, as specified in * the README file. */ /* * $Archive: $ * $Author: sanderst $ * $Revision: 1.2 $ * $Date: 2011-04-07 22:18:20 $ */ package com.inqwell.any; public class ConstObjectDecor extends AbstractAny implements ObjectI { private static final long serialVersionUID = 1L; protected ObjectI delegate_; public ConstObjectDecor(ObjectI d) { delegate_ = d; } public Object getValue() { return delegate_.getValue(); } public void setValue(Object value) { constViolation(reason__); } public void accept(Visitor v) { v.visitAnyObject(this); } public Any bestowConstness() { return this; } public Any buildNew(Any a) { // Refer to delegate and don't bother to decorate seems to be the // appropriate thing to do. return delegate_.buildNew(a); } public Any copyFrom(Any a) { constViolation(reason__); return this; // not reached } public boolean equals(Any a) { return delegate_.equals(a); } public int hashCode() { return delegate_.hashCode(); } public Iter createIterator () {return DegenerateIter.i__;} public boolean isConst() { return true; } }
3e05f64efc15661cdf0461a975aead9a48361d5a
7,082
java
Java
src/eg/Prefs.java
Eadgyth/Programming-Editor
74bdc42234525911e96a682ef325334e74844242
[ "MIT" ]
6
2018-08-21T14:07:00.000Z
2021-07-21T19:37:27.000Z
src/eg/Prefs.java
Eadgyth/Java-Programming-Editor
74bdc42234525911e96a682ef325334e74844242
[ "MIT" ]
null
null
null
src/eg/Prefs.java
Eadgyth/Java-Programming-Editor
74bdc42234525911e96a682ef325334e74844242
[ "MIT" ]
1
2021-02-09T21:59:50.000Z
2021-02-09T21:59:50.000Z
32.635945
85
0.642756
2,504
package eg; import java.util.Properties; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.FileWriter; //--Eadgyth--/ import eg.utils.FileUtils; import eg.utils.SystemParams; import eg.ui.ViewSettingWin; /** * The preferences for the editor and for projects. The editor * properties correspond to the keys defined as constants in this * class. Other key/property pairs can be added. */ public final class Prefs { /** * Key for the indent unit which is a certain number of spaces */ public static final String INDENT_UNIT_KEY = "IndentUnit"; /** * Key for indentation of tabs; a 'Yes-No' property */ public static final String INDENT_TAB_KEY = "IndentTab"; /** * Key for the font name */ public static final String FONT_KEY = "Font"; /** * Key for the font size */ public static final String FONT_SIZE_KEY = "FontSize"; /** * Key for showing line numbers; a 'Yes-No' property */ public static final String LINE_NR_KEY = "LineNumbers"; /** * Key for enabling wordwrap; a 'Yes-No' property */ public static final String WORDWRAP_KEY = "Wordwrap"; /** * Key for showing the toolbar; a 'Yes-No' property */ public static final String TOOLBAR_KEY = "Toolbar"; /** * Key for showing the status bar; a 'Yes-No' property */ public static final String STATUSBAR_KEY = "Statusbar"; /** * Key for showing the tabbar; a 'Yes-No' property */ public static final String TABBAR_KEY = "Tabbar"; /** * Key for showing the file view; a 'Yes-No' property */ public static final String FILE_VIEW_KEY = "FileView"; /** * Key for the icon size which is 'Small' or 'Large' */ public static final String ICON_SIZE_KEY = "IconSize"; /** * Key for the background theme which is 'White', 'Blue', * 'Gray' or 'Black' */ public static final String THEME_KEY = "Theme"; /** * Key for the LaF which is 'System' or 'Java default' */ public static final String LAF_KEY = "LaF"; /** * Key for the language which is a constant in * {@link Languages} as String */ public static final String LANG_KEY = "Language"; /** * Key for the last used directory to save or open a file */ public static final String RECENT_DIR_KEY = "RecentDir"; /** * Prefix for keys of properties of the exchange editor */ public static final String EXCHG_PREFIX = "Exchg"; /** * The name of the properties file to store the configuration * of a project */ public static final String PROJ_CONFIG_FILE = "ProjConfig.properties"; private static final String PREFS_FILE = SystemParams.EADGYTH_DATA_DIR + File.separator + "Prefs.properties"; private static final Properties PREFS_FILE_PROP = new Properties(); private final Properties prop; private final File file; /** * Creates a <code>Prefs</code> that reads from and writes to the * Prefs.properties file. * <p> * The Prefs file is stored in the .eadgyth folder (see * {@link SystemParams EADGYTH_DATA_DIR}) if the folder exists. * <p> * Every new <code>Prefs</code> object accesses the same set of * properties which are loaded upon first creation. If the Prefs * file does not (yet) exist the editor properties are pre-set. */ public Prefs() { prop = PREFS_FILE_PROP; file = new File(PREFS_FILE); if (file.exists()) { if (prop.isEmpty()) { load(); } } else { setProperty(INDENT_UNIT_KEY, " "); setProperty(INDENT_TAB_KEY, "No"); setProperty(FONT_KEY, "Monospaced"); setProperty(EXCHG_PREFIX + FONT_KEY, "Monospaced"); setProperty(FONT_SIZE_KEY, "9"); setProperty(EXCHG_PREFIX + FONT_SIZE_KEY, "9"); setProperty(LINE_NR_KEY, "Yes"); setProperty(WORDWRAP_KEY, "No"); setProperty(TOOLBAR_KEY, "Yes"); setProperty(STATUSBAR_KEY, "Yes"); setProperty(TABBAR_KEY, "Yes"); setProperty(FILE_VIEW_KEY, "No"); setProperty(ICON_SIZE_KEY, ViewSettingWin.ICON_SIZES[1]); setProperty(THEME_KEY, ViewSettingWin.THEME_OPT[0]); setProperty(LAF_KEY, ViewSettingWin.LAF_OPT[1]); setProperty(LANG_KEY, String.valueOf(Languages.NORMAL_TEXT)); setProperty(EXCHG_PREFIX + LANG_KEY, String.valueOf(Languages.NORMAL_TEXT)); setProperty(RECENT_DIR_KEY, ""); } } /** * Creates a <code>Prefs</code> that reads from and writes to a * ProjConfig.properties file in the specified project directory. * The properties are loaded if the file exists. Every new * <code>Prefs</code> object accesses an own set of properties. * * @param projectDir the directory */ public Prefs(String projectDir) { prop = new Properties(); file = new File(projectDir + File.separator + PROJ_CONFIG_FILE); load(); } /** * Sets a new value for the property that corresponds to the * specified key or adds a new key/value pair if the key is * not contained in the property list * * @param key the property key * @param value the new value */ public void setProperty(String key, String value) { prop.setProperty(key, value); } /** * Sets a new value for the 'Yes-No' property that corresponds * to the specified key or adds a new key/value pair if the key * is not contained in the property list * * @param key the property key * @param state true for 'Yes', false for 'No' */ public void setYesNoProperty(String key, boolean state) { String value = state ? "Yes" : "No"; prop.setProperty(key, value); } /** * Returns the value of the property that corresponds to the * specified key * * @param key the property key * @return the value; the empty String if the property could not * be found */ public String property(String key) { return prop.getProperty(key, ""); } /** * Returns the value of the 'Yes-No' property that corresponds * to the specified key * * @param key the property key * @return true if the value is 'Yes', false otherwise */ public boolean yesNoProperty(String key) { return "Yes".equals(property(key)); } /** * Loads the properties from this properties file if it exists */ public void load() { if (!file.exists()) { return; } try (FileInputStream reader = new FileInputStream(file)) { prop.load(reader); } catch (IOException e) { FileUtils.log(e); } } /** * Writes the properties to this properties file if the parent * directory of the file exists */ public void store() { if (!file.getParentFile().exists()) { return; } try (FileWriter writer = new FileWriter(file)) { prop.store(writer, null); } catch (IOException | NullPointerException | ClassCastException e) { FileUtils.log(e); } } }
3e05f65e24f2cbd40f6b2cadd9c4334f7fbacd7f
2,423
java
Java
coeus-code/src/main/java/org/kuali/kra/award/document/authorizer/AwardAuthorizer.java
sasipolus/kc
6bf957db29c17162853c41710f5898631fb4a111
[ "ECL-2.0" ]
null
null
null
coeus-code/src/main/java/org/kuali/kra/award/document/authorizer/AwardAuthorizer.java
sasipolus/kc
6bf957db29c17162853c41710f5898631fb4a111
[ "ECL-2.0" ]
null
null
null
coeus-code/src/main/java/org/kuali/kra/award/document/authorizer/AwardAuthorizer.java
sasipolus/kc
6bf957db29c17162853c41710f5898631fb4a111
[ "ECL-2.0" ]
null
null
null
37.859375
94
0.733388
2,505
/* * Copyright 2005-2014 The Kuali Foundation * * Licensed under the Educational Community 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.osedu.org/licenses/ECL-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.kuali.kra.award.document.authorizer; import org.kuali.coeus.sys.framework.auth.perm.KcAuthorizationService; import org.kuali.coeus.sys.framework.auth.task.Task; import org.kuali.coeus.sys.framework.auth.task.TaskAuthorizerBase; import org.kuali.kra.award.document.authorization.AwardTask; import org.kuali.kra.award.home.Award; /** * An Award Authorizer determines if a user can perform * a given task on an award. */ public abstract class AwardAuthorizer extends TaskAuthorizerBase { private KcAuthorizationService kraAuthorizationService; @Override public final boolean isAuthorized(String userId, Task task) { return isAuthorized(userId, (AwardTask) task); } /** * Is the user authorized to execute the given Award task? * @param username the user's unique username * @param task the award task * @return true if the user is authorized; otherwise false */ public abstract boolean isAuthorized(String userId, AwardTask task); /** * Set the Kra Authorization Service. Usually injected by the Spring Framework. * @param kraAuthorizationService */ public void setKraAuthorizationService(KcAuthorizationService kraAuthorizationService) { this.kraAuthorizationService = kraAuthorizationService; } /** * Does the given user has the permission for this award? * @param username the unique username of the user * @param award the award * @param permissionName the name of the permission * @return true if the person has the permission; otherwise false */ protected final boolean hasPermission(String userId, Award award, String permissionName) { return kraAuthorizationService.hasPermission(userId, award, permissionName); } }
3e05f664e67a1695726ae294636fc7a156a12d98
530
java
Java
rxhttp/src/main/java/rxhttp/wrapper/param/NoBodyRequest.java
JacksonLi-LiBin/RxHttp
710ee807aea1f2d9660b173d6bad3851a6e0ba82
[ "Apache-2.0" ]
1
2019-09-19T03:19:58.000Z
2019-09-19T03:19:58.000Z
rxhttp/src/main/java/rxhttp/wrapper/param/NoBodyRequest.java
loulikong/RxHttp
760aefc0b44fbc71548e373926194a9d1a6974e3
[ "Apache-2.0" ]
null
null
null
rxhttp/src/main/java/rxhttp/wrapper/param/NoBodyRequest.java
loulikong/RxHttp
760aefc0b44fbc71548e373926194a9d1a6974e3
[ "Apache-2.0" ]
null
null
null
13.589744
35
0.556604
2,506
package rxhttp.wrapper.param; import okhttp3.CacheControl; import okhttp3.Headers; /** * 用于构建没有RequestBody请求的Request * User: ljx * Date: 2019/1/19 * Time: 17:24 */ public interface NoBodyRequest { /** * @return 带参数的url */ String getUrl(); /** * @return 不带参数的url */ String getSimpleUrl(); /** * @return 请求头信息 */ Headers getHeaders(); /** * @return tag */ Object getTag(); /** * @return 缓存控制器 */ CacheControl getCacheControl(); }
3e05f6879f6adc8f25f77a257673fcb4b3453df4
473
java
Java
src/test/java/ru/olegcherednik/utils/reflection/data/BaseData.java
oleg-cherednik/reflection-utils
14111718bc838acbbb143666e183134efac43dde
[ "Apache-2.0" ]
null
null
null
src/test/java/ru/olegcherednik/utils/reflection/data/BaseData.java
oleg-cherednik/reflection-utils
14111718bc838acbbb143666e183134efac43dde
[ "Apache-2.0" ]
3
2021-05-16T06:53:39.000Z
2021-12-04T15:39:09.000Z
src/test/java/ru/olegcherednik/utils/reflection/data/BaseData.java
oleg-cherednik/reflection-utils
14111718bc838acbbb143666e183134efac43dde
[ "Apache-2.0" ]
1
2021-05-16T07:09:04.000Z
2021-05-16T07:09:04.000Z
18.92
49
0.668076
2,507
package ru.olegcherednik.utils.reflection.data; /** * @author Oleg Cherednik * @since 27.02.2021 */ @SuppressWarnings("unused") abstract class BaseData { private static final String MONITOR = "dell"; @SuppressWarnings("FieldMayBeStatic") private final String baseName = "pizza"; private static int getVoltage() { return 220; } @SuppressWarnings("MethodMayBeStatic") private String getSeason() { return "winter"; } }
3e05f698d9aaf87adceff4a99ececcd535c97967
1,478
java
Java
core/src/main/java/fr/skytasul/quests/gui/ImmutableItemStack.java
neolithic-minecraft/BeautyQuests
bea796447e3d40c86f0d84d2dab9119182f3b95d
[ "MIT" ]
1
2020-01-19T01:40:26.000Z
2020-01-19T01:40:26.000Z
core/src/main/java/fr/skytasul/quests/gui/ImmutableItemStack.java
neolithic-minecraft/BeautyQuests
bea796447e3d40c86f0d84d2dab9119182f3b95d
[ "MIT" ]
null
null
null
core/src/main/java/fr/skytasul/quests/gui/ImmutableItemStack.java
neolithic-minecraft/BeautyQuests
bea796447e3d40c86f0d84d2dab9119182f3b95d
[ "MIT" ]
null
null
null
30.791667
83
0.773342
2,508
package fr.skytasul.quests.gui; import org.bukkit.Material; import org.bukkit.enchantments.Enchantment; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.material.MaterialData; public class ImmutableItemStack extends ItemStack { public ImmutableItemStack(ItemStack item){ super(item); } public void setAmount(int amount){ throw new UnsupportedOperationException("This ItemStack instance is immutable"); } public void setData(MaterialData data){ throw new UnsupportedOperationException("This ItemStack instance is immutable"); } public void setDurability(short durability){ throw new UnsupportedOperationException("This ItemStack instance is immutable"); } public boolean setItemMeta(ItemMeta itemMeta){ throw new UnsupportedOperationException("This ItemStack instance is immutable"); } public void setType(Material type){ throw new UnsupportedOperationException("This ItemStack instance is immutable"); } public void addEnchantment(Enchantment ench, int level){ throw new UnsupportedOperationException("This ItemStack instance is immutable"); } public void addUnsafeEnchantment(Enchantment ench, int level){ throw new UnsupportedOperationException("This ItemStack instance is immutable"); } public int removeEnchantment(Enchantment ench){ throw new UnsupportedOperationException("This ItemStack instance is immutable"); } }
3e05f6dc5f2e92aef206e1becc969f251f5d7ccf
1,095
java
Java
app/src/main/java/com/gianlu/timeless/api/models/Leader.java
LorenzoLeonardini/Timeless
245a71e0c62ac912452276b7eced6536314f9dd8
[ "Apache-2.0" ]
5
2021-01-17T13:43:37.000Z
2021-05-01T01:09:09.000Z
app/src/main/java/com/gianlu/timeless/api/models/Leader.java
LorenzoLeonardini/Timeless
245a71e0c62ac912452276b7eced6536314f9dd8
[ "Apache-2.0" ]
48
2021-02-23T04:52:19.000Z
2022-03-11T04:10:10.000Z
app/src/main/java/com/gianlu/timeless/api/models/Leader.java
LorenzoLeonardini/Timeless
245a71e0c62ac912452276b7eced6536314f9dd8
[ "Apache-2.0" ]
2
2021-12-07T09:46:54.000Z
2022-01-17T21:57:27.000Z
33.181818
81
0.690411
2,509
package com.gianlu.timeless.api.models; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.io.Serializable; import java.util.HashMap; public class Leader implements Serializable { public final int rank; public final User user; public final long total_seconds; public final long daily_average; public final HashMap<String, Long> languages; public Leader(JSONObject obj) throws JSONException { rank = obj.optInt("rank", -1); user = new User(obj.getJSONObject("user")); JSONObject running_total = obj.getJSONObject("running_total"); daily_average = running_total.getLong("daily_average"); total_seconds = running_total.getLong("total_seconds"); JSONArray languagesArray = running_total.getJSONArray("languages"); languages = new HashMap<>(); for (int i = 0; i < languagesArray.length(); i++) { JSONObject lang = languagesArray.getJSONObject(i); languages.put(lang.getString("name"), lang.getLong("total_seconds")); } } }
3e05f6eff0da24594de5e8d426c780ef7170894d
699
java
Java
src/main/java/me/kuku/onemanager/pojo/SystemConfigType.java
kukume/onemanager
dae677e2866e9bd618dbe319d056ccc5392a8bd6
[ "MIT" ]
1
2021-07-06T09:29:04.000Z
2021-07-06T09:29:04.000Z
src/main/java/me/kuku/onemanager/pojo/SystemConfigType.java
kukume/onemanager-java
dae677e2866e9bd618dbe319d056ccc5392a8bd6
[ "MIT" ]
null
null
null
src/main/java/me/kuku/onemanager/pojo/SystemConfigType.java
kukume/onemanager-java
dae677e2866e9bd618dbe319d056ccc5392a8bd6
[ "MIT" ]
1
2021-07-06T09:29:06.000Z
2021-07-06T09:29:06.000Z
20.558824
51
0.733906
2,510
package me.kuku.onemanager.pojo; import lombok.Getter; import lombok.ToString; @ToString @Getter public enum SystemConfigType { PASSWORD_FILE("passwordFile"), CUSTOM_CSS("customCss"), CUSTOM_SCRIPT("customScript"), SITE_NAME("siteName"), PASSWORD("password"), FAVICON("favicon"), KEYWORDS("keywords"), DESCRIPTION("description"), DISABLED_UA("disabledUa"); private final String type; SystemConfigType(String type){ this.type = type; } public static SystemConfigType parse(String type){ SystemConfigType[] arr = values(); for (SystemConfigType systemConfigType : arr) { if (systemConfigType.getType().equals(type)){ return systemConfigType; } } return null; } }
3e05f6fc8d908cd5a6271da1921bb91dc68287c1
3,500
java
Java
rfx-core/src/main/java/rfx/core/configs/RedisConnectionPoolConfig.java
rfxlab/rfx
ed419c407c289159a5e11b0c2b5b66ee3fe236b2
[ "Apache-2.0" ]
5
2017-03-27T15:31:28.000Z
2021-12-11T01:45:41.000Z
rfx-core/src/main/java/rfx/core/configs/RedisConnectionPoolConfig.java
rfxlab/rfx
ed419c407c289159a5e11b0c2b5b66ee3fe236b2
[ "Apache-2.0" ]
null
null
null
rfx-core/src/main/java/rfx/core/configs/RedisConnectionPoolConfig.java
rfxlab/rfx
ed419c407c289159a5e11b0c2b5b66ee3fe236b2
[ "Apache-2.0" ]
11
2016-05-25T04:42:07.000Z
2021-11-03T09:02:42.000Z
24.305556
100
0.764571
2,511
package rfx.core.configs; import redis.clients.jedis.JedisPoolConfig; import rfx.core.util.CommonUtil; import rfx.core.util.FileUtils; import com.google.gson.Gson; import com.google.gson.JsonSyntaxException; public class RedisConnectionPoolConfig { protected static RedisConnectionPoolConfig _instance = null; public static RedisConnectionPoolConfig theInstance() { if(_instance == null){ try { String json = FileUtils.readFileAsString(CommonUtil.getRedisPoolConnectionConfigFile()); _instance = new Gson().fromJson(json, RedisConnectionPoolConfig.class); } catch (Exception e) { if (e instanceof JsonSyntaxException) { e.printStackTrace(); System.err.println("Wrong JSON syntax in file "+CommonUtil.getRedisPoolConnectionConfigFile()); } else { e.printStackTrace(); } } } return _instance; } public static JedisPoolConfig getJedisPoolConfigInstance(){ return theInstance().getJedisPoolConfig(); } int connectionTimeout = 0; int maxTotal = 20; int maxIdle = 10; int minIdle = 1; int maxWaitMillis = 3000; int numTestsPerEvictionRun = 10; boolean testOnBorrow = true; boolean testOnReturn = true; boolean testWhileIdle = true; int timeBetweenEvictionRunsMillis = 60000; public int getMaxTotal() { return maxTotal; } public void setMaxTotal(int maxActive) { this.maxTotal = maxActive; } public int getMaxIdle() { return maxIdle; } public void setMaxIdle(int maxIdle) { this.maxIdle = maxIdle; } public int getMinIdle() { return minIdle; } public void setMinIdle(int minIdle) { this.minIdle = minIdle; } public int getMaxWaitMillis() { return maxWaitMillis; } public void setMaxWaitMillis(int maxWaitMillis) { this.maxWaitMillis = maxWaitMillis; } public int getNumTestsPerEvictionRun() { return numTestsPerEvictionRun; } public void setNumTestsPerEvictionRun(int numTestsPerEvictionRun) { this.numTestsPerEvictionRun = numTestsPerEvictionRun; } public boolean isTestOnBorrow() { return testOnBorrow; } public void setTestOnBorrow(boolean testOnBorrow) { this.testOnBorrow = testOnBorrow; } public boolean isTestOnReturn() { return testOnReturn; } public void setTestOnReturn(boolean testOnReturn) { this.testOnReturn = testOnReturn; } public boolean isTestWhileIdle() { return testWhileIdle; } public void setTestWhileIdle(boolean testWhileIdle) { this.testWhileIdle = testWhileIdle; } public int getTimeBetweenEvictionRunsMillis() { return timeBetweenEvictionRunsMillis; } public void setTimeBetweenEvictionRunsMillis(int timeBetweenEvictionRunsMillis) { this.timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis; } public int getConnectionTimeout() { return connectionTimeout; } public void setConnectionTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; } public String toJson() { return new Gson().toJson(this); } public JedisPoolConfig getJedisPoolConfig() { JedisPoolConfig config = new JedisPoolConfig(); config.setMaxTotal(this.maxTotal); config.setMaxIdle(this.maxIdle); config.setMinIdle(this.minIdle); config.setMaxWaitMillis(this.maxWaitMillis); config.setNumTestsPerEvictionRun(this.numTestsPerEvictionRun); config.setTestOnBorrow(this.testOnBorrow); config.setTestOnReturn(this.testOnReturn); config.setTestWhileIdle(this.testWhileIdle); config.setTimeBetweenEvictionRunsMillis(this.timeBetweenEvictionRunsMillis); return config; } }
3e05f71cebcbb55a88e913e1388ce63abf7b2ee3
1,467
java
Java
src/main/java/cn/yuanfeisy/model/LogDomain.java
YuanFeis/ysite
8fba5a2286595e827b5655f61fabb2bce64bf6e3
[ "Apache-2.0" ]
2
2020-06-12T03:52:39.000Z
2020-07-04T09:23:05.000Z
src/main/java/cn/yuanfeisy/model/LogDomain.java
YuanFeis/ysite
8fba5a2286595e827b5655f61fabb2bce64bf6e3
[ "Apache-2.0" ]
null
null
null
src/main/java/cn/yuanfeisy/model/LogDomain.java
YuanFeis/ysite
8fba5a2286595e827b5655f61fabb2bce64bf6e3
[ "Apache-2.0" ]
null
null
null
14.818182
52
0.548057
2,512
package cn.yuanfeisy.model; import java.io.Serializable; /** * 日志类 * Created by Donghua.Chen on 2018/4/29. */ public class LogDomain implements Serializable { private static final long serialVersionUID = 1L; /** * 日志主键 */ private Integer id; /** * 产生的动作 */ private String action; /** * 产生的数据 */ private String data; /** * 发生人id */ private Integer authorId; /** * 日志产生的ip */ private String ip; /** * 日志创建时间 */ private Integer created; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getAction() { return action; } public void setAction(String action) { this.action = action; } public String getData() { return data; } public void setData(String data) { this.data = data; } public Integer getAuthorId() { return authorId; } public void setAuthorId(Integer authorId) { this.authorId = authorId; } public String getIp() { return ip; } public void setIp(String ip) { this.ip = ip; } public Integer getCreated() { return created; } public void setCreated(Integer created) { this.created = created; } public static long getSerialVersionUID() { return serialVersionUID; } }
3e05f72c9ba98ac473ac0d5958bf87cffd03bf5c
1,027
java
Java
src/main/java/com/sinolease/base/core/AbstractDaoService.java
sure0328/alcohol
017078196e4206ad351e89f8258fb99d94024d4a
[ "Apache-2.0" ]
null
null
null
src/main/java/com/sinolease/base/core/AbstractDaoService.java
sure0328/alcohol
017078196e4206ad351e89f8258fb99d94024d4a
[ "Apache-2.0" ]
null
null
null
src/main/java/com/sinolease/base/core/AbstractDaoService.java
sure0328/alcohol
017078196e4206ad351e89f8258fb99d94024d4a
[ "Apache-2.0" ]
null
null
null
21.395833
103
0.670886
2,513
package com.sinolease.base.core; import java.io.Serializable; /** * Created by AlbertLy on 2016/10/18. */ public abstract class AbstractDaoService<T, ID extends Serializable> implements BaseDaoService<T, ID> { private BaseDao<T, ID> baseDao; public void setBaseDao(BaseDao<T, ID> baseDao) { this.baseDao = baseDao; } @Override public int insert(T record) { return baseDao.insert(record); } @Override public int insertSelective(T record) { return baseDao.insertSelective(record); } @Override public T selectByPrimaryKey(ID id) { return baseDao.selectByPrimaryKey(id); } @Override public int updateByPrimaryKey(T record) { return baseDao.updateByPrimaryKey(record); } @Override public int updateByPrimaryKeySelective(T record) { return baseDao.updateByPrimaryKeySelective(record); } @Override public int deleteByPrimaryKey(ID id) { return baseDao.deleteByPrimaryKey(id); } }
3e05f80eae7b6b0732b33e26705f1a6401350d0e
2,044
java
Java
src/main/java/org/orekit/estimation/measurements/gnss/PythonCycleSlipDetectors.java
petrushy/Orekit
7b7db21870c4020a63062314350e6d910e8b4a78
[ "Apache-2.0" ]
3
2019-06-21T13:26:42.000Z
2021-12-19T00:20:47.000Z
src/main/java/org/orekit/estimation/measurements/gnss/PythonCycleSlipDetectors.java
petrushy/Orekit
7b7db21870c4020a63062314350e6d910e8b4a78
[ "Apache-2.0" ]
null
null
null
src/main/java/org/orekit/estimation/measurements/gnss/PythonCycleSlipDetectors.java
petrushy/Orekit
7b7db21870c4020a63062314350e6d910e8b4a78
[ "Apache-2.0" ]
2
2019-04-08T09:34:15.000Z
2021-03-25T18:28:41.000Z
32.444444
95
0.714286
2,514
/* Copyright 2002-2020 CS GROUP * Licensed to CS GROUP (CS) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * CS 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. */ // this file was created by SCC 2020 and is largely a derived work from the // original java class/interface package org.orekit.estimation.measurements.gnss; import org.orekit.gnss.ObservationDataSet; import java.util.List; public class PythonCycleSlipDetectors implements CycleSlipDetectors { /** Part of JCC Python interface to object */ private long pythonObject; /** Part of JCC Python interface to object */ public void pythonExtension(long pythonObject) { this.pythonObject = pythonObject; } /** Part of JCC Python interface to object */ public long pythonExtension() { return this.pythonObject; } /** Part of JCC Python interface to object */ public void finalize() throws Throwable { pythonDecRef(); } /** Part of JCC Python interface to object */ public native void pythonDecRef(); /** * Detects if a cycle-slip occurs for a given list of observation data set. * * @param observations list of observation data set * @return a list of results computed by the cycle-slip detectors */ @Override public native List<CycleSlipDetectorResults> detect(List<ObservationDataSet> observations); }