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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3e027299848dd615bbe2b87b053f82a6976a364a | 1,683 | java | Java | src/main/java/com/revealprecision/revealserver/api/v1/dto/factory/GoalEntityFactory.java | akrosinc/reveal-server | c86c01d4dc2072cf0efed8cabff430e51de9e49c | [
"Apache-2.0"
]
| null | null | null | src/main/java/com/revealprecision/revealserver/api/v1/dto/factory/GoalEntityFactory.java | akrosinc/reveal-server | c86c01d4dc2072cf0efed8cabff430e51de9e49c | [
"Apache-2.0"
]
| null | null | null | src/main/java/com/revealprecision/revealserver/api/v1/dto/factory/GoalEntityFactory.java | akrosinc/reveal-server | c86c01d4dc2072cf0efed8cabff430e51de9e49c | [
"Apache-2.0"
]
| null | null | null | 33 | 108 | 0.739156 | 1,006 | package com.revealprecision.revealserver.api.v1.dto.factory;
import com.revealprecision.revealserver.api.v1.dto.request.GoalRequest;
import com.revealprecision.revealserver.enums.EntityStatus;
import com.revealprecision.revealserver.persistence.domain.Form;
import com.revealprecision.revealserver.persistence.domain.Goal;
import com.revealprecision.revealserver.persistence.domain.LookupEntityType;
import com.revealprecision.revealserver.persistence.domain.Plan;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.stream.Collectors;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class GoalEntityFactory {
public static Goal toEntity(GoalRequest request, Plan plan, Map<UUID, Form> forms,
List<LookupEntityType> lookupEntityTypes) {
Goal goal = Goal.builder()
.description(request.getDescription())
.priority(request.getPriority())
.plan(plan)
.build();
if (request.getActions() != null) {
var actions = request.getActions()
.stream()
.map(actionRequest -> ActionEntityFactory.toEntity(actionRequest, goal, forms, lookupEntityTypes))
.collect(Collectors.toSet());
goal.setActions(actions);
}
goal.setEntityStatus(EntityStatus.ACTIVE);
return goal;
}
public static Goal toEntityWithoutAction(GoalRequest goalRequest, Plan plan) {
Goal goal = Goal.builder()
.description(goalRequest.getDescription())
.priority(goalRequest.getPriority())
.plan(plan)
.build();
goal.setEntityStatus(EntityStatus.ACTIVE);
return goal;
}
}
|
3e02738b3aff4993182635dfda5ef4ca6fccfcea | 988 | java | Java | hyh/admin/src/test/java/com/loop/demo/admin/zuoshenniuke/exe2.java | a5601564/springboot-admin | 67dc5f37d85ef5e2eda4c4eec87445162f836f93 | [
"Apache-1.1"
]
| 49 | 2019-04-25T13:58:04.000Z | 2022-03-16T10:36:35.000Z | hyh/admin/src/test/java/com/loop/demo/admin/zuoshenniuke/exe2.java | sommer1991/springboot-admin | 67dc5f37d85ef5e2eda4c4eec87445162f836f93 | [
"Apache-1.1"
]
| null | null | null | hyh/admin/src/test/java/com/loop/demo/admin/zuoshenniuke/exe2.java | sommer1991/springboot-admin | 67dc5f37d85ef5e2eda4c4eec87445162f836f93 | [
"Apache-1.1"
]
| 26 | 2019-05-21T09:08:53.000Z | 2022-03-16T16:21:06.000Z | 22.454545 | 73 | 0.513158 | 1,007 | package com.loop.demo.admin.zuoshenniuke;
/**
* @Auther: 霍运浩
* @Date: 2019/1/29 0029 14:58
* @Description: 找出B中不属于A的数
* 找出数组B中不属于A的数,数组A有序而数组B无序。假设数组A有n个数,数组B有m个数,写出算法并分析时间复杂度。
* 使用二分查找法:
* 由于数组A是有序的,在一个有序序列中查找一个元素可以使用二分法(也称折半法)。原理就是将查找的元素与序列的中位数进行比较,
* 如果小于则去掉中位数及其之后的序列,如果大于则去掉中位数及其之前的序列,
* 如果等于则找到了。如果不等于那么再将其与剩下的序列继续比较直到找到或剩下的序列为空为止。
*/
public class exe2 {
public static void main(String[] args) {
int[] a={2,5,7,8};
int[] b={5,9,0,2};
int temp;
int left=0;
int right=a.length-1;
int mid=(right+left)/2;
for(int i=0;i<b.length;i++){
temp=b[i];
while(left<=right && a[mid]!=temp){
if(a[mid]>temp)
right=mid-1;
if(a[mid]<temp)
left=mid+1;
mid=(left+right)/2;
}
if(a[mid]!=temp){
System.out.println(temp);
}
}
}
}
|
3e027577657e733908e437a2bddf9f92268e6d36 | 346 | java | Java | src/test/java/com/ficticiusclean/veiculos/VeiculosApplicationTests.java | BManduca/veiculos | 785ea00bc94d36b4d4315618a2181ed1f856ba2b | [
"Apache-2.0"
]
| null | null | null | src/test/java/com/ficticiusclean/veiculos/VeiculosApplicationTests.java | BManduca/veiculos | 785ea00bc94d36b4d4315618a2181ed1f856ba2b | [
"Apache-2.0"
]
| null | null | null | src/test/java/com/ficticiusclean/veiculos/VeiculosApplicationTests.java | BManduca/veiculos | 785ea00bc94d36b4d4315618a2181ed1f856ba2b | [
"Apache-2.0"
]
| null | null | null | 20.352941 | 60 | 0.815029 | 1,008 | package com.ficticiusclean.veiculos;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class VeiculosApplicationTests {
@Test
public void contextLoads() {
}
}
|
3e0275bf9eae0750e45f59ab7ee9192ed1c60495 | 4,923 | java | Java | box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxFileVersion.java | h2kuo/box-android-content-sdk | 4c16a41e70343aa59d3368659571cb9f9985edd7 | [
"Apache-2.0"
]
| null | null | null | box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxFileVersion.java | h2kuo/box-android-content-sdk | 4c16a41e70343aa59d3368659571cb9f9985edd7 | [
"Apache-2.0"
]
| null | null | null | box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxFileVersion.java | h2kuo/box-android-content-sdk | 4c16a41e70343aa59d3368659571cb9f9985edd7 | [
"Apache-2.0"
]
| null | null | null | 31.356688 | 95 | 0.622182 | 1,009 | package com.box.androidsdk.content.models;
import com.box.androidsdk.content.BoxConstants;
import com.box.androidsdk.content.utils.BoxDateFormat;
import com.eclipsesource.json.JsonObject;
import com.eclipsesource.json.JsonValue;
import java.text.ParseException;
import java.util.Date;
import java.util.Map;
/**
* Class that represents a version of a file on Box.
*/
public class BoxFileVersion extends BoxEntity {
private static final long serialVersionUID = -4732748896882484735L;
public static final String TYPE = "file_version";
public static final String FIELD_NAME = "name";
public static final String FIELD_SHA1 = "sha1";
public static final String FIELD_DELETED_AT = "deleted_at";
public static final String FIELD_MODIFIED_BY = "modified_by";
public static final String FIELD_CREATED_AT = "created_at";
public static final String FIELD_MODIFIED_AT = "modified_at";
public static final String FIELD_SIZE = BoxConstants.FIELD_SIZE;
public static final String[] ALL_FIELDS = new String[]{
FIELD_NAME,
FIELD_SIZE,
FIELD_SHA1,
FIELD_MODIFIED_BY,
FIELD_CREATED_AT,
FIELD_MODIFIED_AT,
FIELD_DELETED_AT
};
/**
* Constructs an empty BoxFileVersion object.
*/
public BoxFileVersion() {
super();
}
/**
* Constructs a BoxFileVersion with the provided map values.
*
* @param map map of keys and values of the object.
*/
public BoxFileVersion(Map<String, Object> map) {
super(map);
}
/**
* Gets the name of the file version.
*
* @return the name of the file version.
*/
public String getName() {
return (String) mProperties.get(FIELD_NAME);
}
/**
* Gets the time the file version was created.
*
* @return the time the file version was created.
*/
public Date getCreatedAt() {
return (Date) mProperties.get(FIELD_CREATED_AT);
}
/**
* Gets the time the file version was last modified.
*
* @return the time the file version was last modified.
*/
public Date getModifiedAt() {
return (Date) mProperties.get(FIELD_MODIFIED_AT);
}
/**
* Gets the SHA1 hash of the file version.
*
* @return the SHA1 hash of the file version.
*/
public String getSha1() {
return (String) mProperties.get(FIELD_SHA1);
}
/**
* Gets the time that the file version was/will be deleted.
*
* @return the time that the file version was/will be trashed.
*/
public Date getDeletedAt() {
return (Date) mProperties.get(FIELD_DELETED_AT);
}
/**
* Gets the size of the file version in bytes.
*
* @return the size of the file version in bytes.
*/
public Long getSize() {
return (Long) mProperties.get(BoxConstants.FIELD_SIZE);
}
/**
* Gets info about the user who last modified the file version.
*
* @return info about the user who last modified the file version.
*/
public BoxUser getModifiedBy() {
return (BoxUser) mProperties.get(FIELD_MODIFIED_BY);
}
@Override
protected void parseJSONMember(JsonObject.Member member) {
try {
String memberName = member.getName();
JsonValue value = member.getValue();
if (memberName.equals(FIELD_NAME)) {
this.mProperties.put(FIELD_NAME, value.asString());
return;
} else if (memberName.equals(FIELD_SHA1)) {
this.mProperties.put(FIELD_SHA1, value.asString());
return;
} else if (memberName.equals(FIELD_DELETED_AT)) {
this.mProperties.put(FIELD_DELETED_AT, BoxDateFormat.parse(value.asString()));
return;
} else if (memberName.equals(FIELD_SIZE)) {
this.mProperties.put(FIELD_SIZE, Long.valueOf(value.toString()));
return;
} else if (memberName.equals(FIELD_MODIFIED_BY)) {
this.mProperties.put(FIELD_MODIFIED_BY, this.parseUserInfo(value.asObject()));
return;
} else if (memberName.equals(FIELD_CREATED_AT)) {
this.mProperties.put(FIELD_CREATED_AT, BoxDateFormat.parse(value.asString()));
return;
} else if (memberName.equals(FIELD_MODIFIED_AT)) {
this.mProperties.put(FIELD_MODIFIED_AT, BoxDateFormat.parse(value.asString()));
return;
}
} catch (ParseException e) {
assert false : "A ParseException indicates a bug in the SDK.";
}
super.parseJSONMember(member);
}
private BoxUser parseUserInfo(JsonObject jsonObject) {
BoxUser user = new BoxUser();
user.createFromJson(jsonObject);
return user;
}
} |
3e027684e0f533a9e9a9062ea218c3cb6c6d2434 | 2,039 | java | Java | EdgeEffectOverride/src/main/java/uk/co/androidalliance/edgeeffectoverride/MulticastOnScrollListener.java | sathishmscict/EdgeEffectOverride | 0c41dc3c867d7bf662f550acf028a635f04a83ba | [
"Apache-2.0"
]
| 277 | 2015-01-03T11:38:54.000Z | 2022-02-15T13:50:13.000Z | EdgeEffectOverride/src/main/java/uk/co/androidalliance/edgeeffectoverride/MulticastOnScrollListener.java | sathishmscict/EdgeEffectOverride | 0c41dc3c867d7bf662f550acf028a635f04a83ba | [
"Apache-2.0"
]
| 5 | 2015-01-31T09:17:56.000Z | 2017-02-11T18:37:50.000Z | EdgeEffectOverride/src/main/java/uk/co/androidalliance/edgeeffectoverride/MulticastOnScrollListener.java | sathishmscict/EdgeEffectOverride | 0c41dc3c867d7bf662f550acf028a635f04a83ba | [
"Apache-2.0"
]
| 84 | 2015-01-14T08:28:57.000Z | 2022-02-15T13:50:25.000Z | 34.559322 | 128 | 0.723884 | 1,010 | /*
* Copyright (c) 2014 Android Alliance, LTD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package uk.co.androidalliance.edgeeffectoverride;
import android.widget.AbsListView;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
public class MulticastOnScrollListener implements AbsListView.OnScrollListener {
private Set<AbsListView.OnScrollListener> mListeners = new HashSet<AbsListView.OnScrollListener>();
public MulticastOnScrollListener add(AbsListView.OnScrollListener scrollListener) {
mListeners.add(scrollListener);
return this;
}
public MulticastOnScrollListener clear() {
mListeners.clear();
return this;
}
@Override
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
Iterator iterator = this.mListeners.iterator();
while (iterator.hasNext()) {
((AbsListView.OnScrollListener) iterator.next()).onScroll(view, firstVisibleItem, visibleItemCount, totalItemCount);
}
}
@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
Iterator iterator = mListeners.iterator();
while (iterator.hasNext()) {
((AbsListView.OnScrollListener) iterator.next()).onScrollStateChanged(view, scrollState);
}
}
public MulticastOnScrollListener remove(AbsListView.OnScrollListener scrollListener) {
mListeners.remove(scrollListener);
return this;
}
}
|
3e0276a57ec0412bfb5599bf13b0974638880a23 | 7,003 | java | Java | aws-java-sdk-cloudformation/src/main/java/com/amazonaws/services/cloudformation/model/DescribeStacksResult.java | ericvincent83/aws-sdk-java | c491416f3ea9411a04d9bafedee6c6874a79e48d | [
"Apache-2.0"
]
| 3,372 | 2015-01-03T00:35:43.000Z | 2022-03-31T15:56:24.000Z | aws-java-sdk-cloudformation/src/main/java/com/amazonaws/services/cloudformation/model/DescribeStacksResult.java | ericvincent83/aws-sdk-java | c491416f3ea9411a04d9bafedee6c6874a79e48d | [
"Apache-2.0"
]
| 2,391 | 2015-01-01T12:55:24.000Z | 2022-03-31T08:01:50.000Z | aws-java-sdk-cloudformation/src/main/java/com/amazonaws/services/cloudformation/model/DescribeStacksResult.java | ericvincent83/aws-sdk-java | c491416f3ea9411a04d9bafedee6c6874a79e48d | [
"Apache-2.0"
]
| 2,876 | 2015-01-01T14:38:37.000Z | 2022-03-29T19:53:10.000Z | 31.403587 | 147 | 0.604027 | 1,011 | /*
* Copyright 2016-2021 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.cloudformation.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
* <p>
* The output for a <a>DescribeStacks</a> action.
* </p>
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeStacks" target="_top">AWS API
* Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DescribeStacksResult extends com.amazonaws.AmazonWebServiceResult<com.amazonaws.ResponseMetadata> implements Serializable, Cloneable {
/**
* <p>
* A list of stack structures.
* </p>
*/
private com.amazonaws.internal.SdkInternalList<Stack> stacks;
/**
* <p>
* If the output exceeds 1 MB in size, a string that identifies the next page of stacks. If no additional page
* exists, this value is null.
* </p>
*/
private String nextToken;
/**
* <p>
* A list of stack structures.
* </p>
*
* @return A list of stack structures.
*/
public java.util.List<Stack> getStacks() {
if (stacks == null) {
stacks = new com.amazonaws.internal.SdkInternalList<Stack>();
}
return stacks;
}
/**
* <p>
* A list of stack structures.
* </p>
*
* @param stacks
* A list of stack structures.
*/
public void setStacks(java.util.Collection<Stack> stacks) {
if (stacks == null) {
this.stacks = null;
return;
}
this.stacks = new com.amazonaws.internal.SdkInternalList<Stack>(stacks);
}
/**
* <p>
* A list of stack structures.
* </p>
* <p>
* <b>NOTE:</b> This method appends the values to the existing list (if any). Use
* {@link #setStacks(java.util.Collection)} or {@link #withStacks(java.util.Collection)} if you want to override the
* existing values.
* </p>
*
* @param stacks
* A list of stack structures.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeStacksResult withStacks(Stack... stacks) {
if (this.stacks == null) {
setStacks(new com.amazonaws.internal.SdkInternalList<Stack>(stacks.length));
}
for (Stack ele : stacks) {
this.stacks.add(ele);
}
return this;
}
/**
* <p>
* A list of stack structures.
* </p>
*
* @param stacks
* A list of stack structures.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeStacksResult withStacks(java.util.Collection<Stack> stacks) {
setStacks(stacks);
return this;
}
/**
* <p>
* If the output exceeds 1 MB in size, a string that identifies the next page of stacks. If no additional page
* exists, this value is null.
* </p>
*
* @param nextToken
* If the output exceeds 1 MB in size, a string that identifies the next page of stacks. If no additional
* page exists, this value is null.
*/
public void setNextToken(String nextToken) {
this.nextToken = nextToken;
}
/**
* <p>
* If the output exceeds 1 MB in size, a string that identifies the next page of stacks. If no additional page
* exists, this value is null.
* </p>
*
* @return If the output exceeds 1 MB in size, a string that identifies the next page of stacks. If no additional
* page exists, this value is null.
*/
public String getNextToken() {
return this.nextToken;
}
/**
* <p>
* If the output exceeds 1 MB in size, a string that identifies the next page of stacks. If no additional page
* exists, this value is null.
* </p>
*
* @param nextToken
* If the output exceeds 1 MB in size, a string that identifies the next page of stacks. If no additional
* page exists, this value is null.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeStacksResult withNextToken(String nextToken) {
setNextToken(nextToken);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getStacks() != null)
sb.append("Stacks: ").append(getStacks()).append(",");
if (getNextToken() != null)
sb.append("NextToken: ").append(getNextToken());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof DescribeStacksResult == false)
return false;
DescribeStacksResult other = (DescribeStacksResult) obj;
if (other.getStacks() == null ^ this.getStacks() == null)
return false;
if (other.getStacks() != null && other.getStacks().equals(this.getStacks()) == false)
return false;
if (other.getNextToken() == null ^ this.getNextToken() == null)
return false;
if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getStacks() == null) ? 0 : getStacks().hashCode());
hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode());
return hashCode;
}
@Override
public DescribeStacksResult clone() {
try {
return (DescribeStacksResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}
|
3e027854eb6ff00c9fbb9f6ea45f0a052cb684de | 2,142 | java | Java | server/src/main/java/com/objectcomputing/checkins/services/memberprofile/memberphoto/MemberPhotoServiceImpl.java | sonndinh/check-ins | ca664c8ec56f3315eae80c99b8890951bae2d68d | [
"Apache-2.0"
]
| null | null | null | server/src/main/java/com/objectcomputing/checkins/services/memberprofile/memberphoto/MemberPhotoServiceImpl.java | sonndinh/check-ins | ca664c8ec56f3315eae80c99b8890951bae2d68d | [
"Apache-2.0"
]
| null | null | null | server/src/main/java/com/objectcomputing/checkins/services/memberprofile/memberphoto/MemberPhotoServiceImpl.java | sonndinh/check-ins | ca664c8ec56f3315eae80c99b8890951bae2d68d | [
"Apache-2.0"
]
| null | null | null | 36.931034 | 93 | 0.720822 | 1,012 | package com.objectcomputing.checkins.services.memberprofile.memberphoto;
import com.google.api.services.admin.directory.Directory;
import com.google.api.services.admin.directory.model.UserPhoto;
import com.objectcomputing.checkins.util.googleapiaccess.GoogleApiAccess;
import io.micronaut.cache.annotation.CacheConfig;
import io.micronaut.cache.annotation.Cacheable;
import io.micronaut.context.env.Environment;
import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.inject.Singleton;
import javax.validation.constraints.NotNull;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Base64;
import java.util.Optional;
@Singleton
@CacheConfig("photo-cache")
public class MemberPhotoServiceImpl implements MemberPhotoService {
private static final Logger LOG = LoggerFactory.getLogger(MemberPhotoServiceImpl.class);
private final GoogleApiAccess googleApiAccess;
private final Environment environment;
public MemberPhotoServiceImpl(GoogleApiAccess googleApiAccess,
Environment environment) {
this.googleApiAccess = googleApiAccess;
this.environment = environment;
}
@Override
@Cacheable
public byte[] getImageByEmailAddress(@NotNull String workEmail) throws IOException {
byte[] photoData;
Directory directory = googleApiAccess.getDirectory();
try {
UserPhoto userPhoto = directory.users().photos().get(workEmail).execute();
photoData = Base64.getUrlDecoder().decode(userPhoto.getPhotoData());
} catch (IOException e) {
LOG.error("Error occurred while retrieving files from Google Directory API.", e);
Optional<URL> resource = environment.getResource("public/default_profile.jpg");
if(resource.isPresent()) {
URL defaultImageUrl = resource.get();
InputStream in = defaultImageUrl.openStream();
photoData = IOUtils.toByteArray(in);
} else photoData = new byte[0];
}
return photoData;
}
}
|
3e02788a91b352ee183e46c73808cb5d2d4fd8f4 | 239 | java | Java | association-service/src/main/java/com/feng/dao/UserMapper.java | zlxlovegithup/association | f6bb19504d909a898a397a92968f7232b2fa8982 | [
"Apache-2.0"
]
| 1 | 2020-12-03T05:47:08.000Z | 2020-12-03T05:47:08.000Z | association-service/src/main/java/com/feng/dao/UserMapper.java | zlxlovegithup/association | f6bb19504d909a898a397a92968f7232b2fa8982 | [
"Apache-2.0"
]
| null | null | null | association-service/src/main/java/com/feng/dao/UserMapper.java | zlxlovegithup/association | f6bb19504d909a898a397a92968f7232b2fa8982 | [
"Apache-2.0"
]
| null | null | null | 13.277778 | 54 | 0.677824 | 1,013 | package com.feng.dao;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.feng.entity.User;
/**
* <p>
* Mapper 接口
* </p>
*
* @author zlx
* @since 2020-03-03
*/
public interface UserMapper extends BaseMapper<User> {
}
|
3e02799209c31275041510ef0f121d307d2b6bde | 1,789 | java | Java | admins/om.j/ObjectManager/objectmanager-api/src/demo/objectmanager/model/Address.java | iboxdb/db4o-gpl | 16a56c3517d9b69f7fd1f915f4fd5b2218ced1f0 | [
"Net-SNMP",
"Xnet"
]
| 24 | 2019-08-25T12:58:07.000Z | 2022-03-04T11:20:37.000Z | admins/om.j/ObjectManager/objectmanager-api/src/demo/objectmanager/model/Address.java | iboxdb/db4o-gpl | 16a56c3517d9b69f7fd1f915f4fd5b2218ced1f0 | [
"Net-SNMP",
"Xnet"
]
| null | null | null | admins/om.j/ObjectManager/objectmanager-api/src/demo/objectmanager/model/Address.java | iboxdb/db4o-gpl | 16a56c3517d9b69f7fd1f915f4fd5b2218ced1f0 | [
"Net-SNMP",
"Xnet"
]
| 10 | 2019-08-30T10:25:41.000Z | 2022-02-13T17:40:23.000Z | 17.89 | 136 | 0.590833 | 1,014 | package demo.objectmanager.model;
/**
* User: treeder
* Date: Aug 29, 2006
* Time: 9:52:35 AM
*/
public class Address {
private Integer id;
Contact contact; // bi-directional
String street;
String city;
String state;
String zip;
boolean primary;
Boolean workAddress;
public Address() {
}
public Address(Integer id, Contact c, String street, String city, String state, String zip, boolean primary, Boolean workAddress) {
this.id = id;
contact = c;
this.street = street;
this.city = city;
this.state = state;
this.zip = zip;
this.primary = primary;
this.workAddress = workAddress;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Contact getContact() {
return contact;
}
public void setContact(Contact contact) {
this.contact = contact;
}
public String getStreet() {
return street;
}
public void setStreet(String street) {
this.street = street;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getZip() {
return zip;
}
public void setZip(String zip) {
this.zip = zip;
}
public boolean isPrimary() {
return primary;
}
public void setPrimary(boolean primary) {
this.primary = primary;
}
public Boolean getWorkAddress() {
return workAddress;
}
public void setWorkAddress(Boolean workAddress) {
this.workAddress = workAddress;
}
}
|
3e027a8d5696ab50416edf99b96562a3e70d2c2a | 11,674 | java | Java | biblemulticonverter/src/main/java/biblemulticonverter/format/ZefDicMyBible.java | schierlm/BibleMultiConverter | 6dccd03f9d4ec61f66149e93ac591bc7c76407f4 | [
"MIT"
]
| 79 | 2016-08-19T15:51:29.000Z | 2022-03-31T14:57:37.000Z | biblemulticonverter/src/main/java/biblemulticonverter/format/ZefDicMyBible.java | Rolf-Smit/BibleMultiConverter | 729ca739d7d1b57b6cfa8b202ee74ed69ed32452 | [
"MIT"
]
| 59 | 2015-08-19T20:22:03.000Z | 2022-03-27T23:20:16.000Z | biblemulticonverter/src/main/java/biblemulticonverter/format/ZefDicMyBible.java | Rolf-Smit/BibleMultiConverter | 729ca739d7d1b57b6cfa8b202ee74ed69ed32452 | [
"MIT"
]
| 33 | 2015-08-15T21:12:58.000Z | 2022-03-31T14:57:47.000Z | 35.92 | 182 | 0.715693 | 1,015 | package biblemulticonverter.format;
import java.io.File;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.Marshaller;
import javax.xml.namespace.QName;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.Text;
import biblemulticonverter.data.Bible;
import biblemulticonverter.data.Book;
import biblemulticonverter.data.BookID;
import biblemulticonverter.data.FormattedText.ExtraAttributePriority;
import biblemulticonverter.data.FormattedText.FormattingInstructionKind;
import biblemulticonverter.data.FormattedText.LineBreakKind;
import biblemulticonverter.data.FormattedText.RawHTMLMode;
import biblemulticonverter.data.FormattedText.Visitor;
import biblemulticonverter.schema.zefdic1.Dictionary;
import biblemulticonverter.schema.zefdic1.MyAnyType;
import biblemulticonverter.schema.zefdic1.ObjectFactory;
import biblemulticonverter.schema.zefdic1.RefLinkType;
import biblemulticonverter.schema.zefdic1.SeeType;
import biblemulticonverter.schema.zefdic1.TItem;
import biblemulticonverter.schema.zefdic1.TParagraph;
import biblemulticonverter.schema.zefdic1.TStyle;
/**
* Zefania Dictionary exporter for MyBible
*/
public class ZefDicMyBible implements ExportFormat {
public static final String[] HELP_TEXT = {
"Zefania Dictionary exporter for MyBible.",
"",
"Usage: ZefDicMyBible <outfile> [<idfields>]",
"",
"This version will export Zefania Dictionary modules optimized for use with MyBible.",
"In <idfields> you can optionally give a comma separated list of 'abbr', 'short' and 'long',",
"the default being 'long,short'. This specifies what kind of IDs (abbreviation, short",
"title and long title) are used to create items. Item fields mentioned later in the list will",
"create redirects if they have a different value.",
"For some features, it is required to add the following snippet to the end of",
"Templates\\dictionary.xsl (before the </xsl:stylesheet>):",
"",
" <xsl:template match=\"/DICTIONARY/item//labeledlink\">",
" <a class=\"alwaysunvisitedLink\">",
" <xsl:attribute name=\"href\"><xsl:value-of select=\"link/@href\"/></xsl:attribute>",
" <xsl:apply-templates select=\"linklabel\"/>",
" </a>",
" </xsl:template>",
" <xsl:template match=\"/DICTIONARY/item//raw\">",
" <xsl:value-of select=\".\" disable-output-escaping=\"yes\"/>",
" </xsl:template>"
};
@Override
public void doExport(Bible bible, String... exportArgs) throws Exception {
File file = new File(exportArgs[0]);
String[] idfields = (exportArgs.length > 1 ? exportArgs[1] : "long,short").split(",");
Dictionary xmlbible = createXMLBible(bible, idfields);
final Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
JAXBContext ctx = JAXBContext.newInstance(ObjectFactory.class);
Marshaller m = ctx.createMarshaller();
m.marshal(xmlbible, doc);
doc.normalize();
maskWhitespaceNodes(doc.getDocumentElement());
Transformer transformer = TransformerFactory.newInstance().newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
transformer.transform(new DOMSource(doc), new StreamResult(file));
}
private static void maskWhitespaceNodes(Element elem) {
for (int i = 0; i < elem.getChildNodes().getLength(); i++) {
Node n = elem.getChildNodes().item(i);
if (n instanceof Text && n.getNodeValue().length() > 0 && n.getNodeValue().trim().length() == 0) {
n.setNodeValue(n.getNodeValue() + "\uFEFF");
} else if (n instanceof Element) {
maskWhitespaceNodes((Element) n);
}
}
}
protected Dictionary createXMLBible(Bible bible, String[] idfields) throws Exception {
final ObjectFactory of = new ObjectFactory();
Dictionary doc = of.createDictionary();
doc.setRevision("1");
doc.setINFORMATION(of.createTINFORMATION());
doc.getINFORMATION().getTitleOrCreatorOrDescription().add(of.createTINFORMATIONTitle(bible.getName()));
Map<String, String> xrefMap = new HashMap<String, String>();
if (!idfields[0].equals("abbr")) {
for (Book bk : bible.getBooks()) {
String value;
switch (idfields[0].toLowerCase()) {
case "abbr":
value = bk.getAbbr();
break;
case "short":
value = bk.getShortName();
break;
case "long":
value = bk.getLongName();
break;
default:
value = null;
}
if (value != null && !value.equals(bk.getAbbr())) {
xrefMap.put(bk.getAbbr(), value);
}
}
}
for (Book bk : bible.getBooks()) {
if (bk.getId().equals(BookID.METADATA))
continue;
if (!bk.getId().equals(BookID.DICTIONARY_ENTRY)) {
System.out.println("WARNING: Unable to export book " + bk.getAbbr());
continue;
}
List<String> ids = new ArrayList<>();
for (String idfield : idfields) {
String value;
switch (idfield.toLowerCase()) {
case "abbr":
value = bk.getAbbr();
break;
case "short":
value = bk.getShortName();
break;
case "long":
value = bk.getLongName();
break;
default:
continue;
}
if (!ids.contains(value))
ids.add(value);
}
if (ids.isEmpty()) {
System.out.println("WARNING: Skipping book " + bk.getAbbr() + "due to missing ID.");
continue;
}
for (int i = 1; i < ids.size(); i++) {
TItem item = of.createTItem();
item.setId(ids.get(i));
TParagraph para = of.createTParagraph();
SeeType see = of.createSeeType();
see.setContent(ids.get(0));
para.getContent().add(of.createSee(see));
item.getContent().add(of.createTParagraphDescription(para));
doc.getItem().add(item);
}
final TItem item = of.createTItem();
item.setId(ids.get(0));
doc.getItem().add(item);
TParagraph description = of.createTParagraph();
item.getContent().add(of.createTParagraphDescription(description));
bk.getChapters().get(0).getProlog().accept(new ZefDicVisitor(description.getContent(), xrefMap));
}
return doc;
}
private static class ZefDicVisitor implements Visitor<RuntimeException> {
private static ObjectFactory of = new ObjectFactory();
private final List<Serializable> target;
private final Map<String, String> xrefMap;
public ZefDicVisitor(List<Serializable> target, Map<String, String> xrefMap) {
this.target = target;
this.xrefMap = xrefMap;
}
@Override
public int visitElementTypes(String elementTypes) throws RuntimeException {
return 0;
}
@Override
public Visitor<RuntimeException> visitHeadline(int depth) throws RuntimeException {
String tagName = "h" + (depth + 2 < 6 ? depth + 2 : 6);
addRaw("<" + tagName + ">");
MyAnyType holder = of.createMyAnyType();
target.add(of.createTParagraphQ(holder));
addRaw("</" + tagName + ">");
return new ZefDicVisitor(holder.getContent(), xrefMap);
}
@Override
public void visitStart() throws RuntimeException {
}
@Override
public void visitText(String text) throws RuntimeException {
if (text.length() > 0)
target.add(text);
}
@Override
public Visitor<RuntimeException> visitFootnote() throws RuntimeException {
System.out.println("WARNING: footnotes are not supported");
return null;
}
@Override
public Visitor<RuntimeException> visitCrossReference(String bookAbbr, BookID book, int firstChapter, String firstVerse, int lastChapter, String lastVerse) throws RuntimeException {
if (firstChapter != lastChapter) {
Visitor<RuntimeException> firstVisitor = visitCrossReference(bookAbbr, book, firstChapter, firstVerse, firstChapter, "999");
visitText(" ");
for (int i = firstChapter + 1; i < lastChapter; i++) {
visitCrossReference(bookAbbr, book, i, "1", i, "999").visitText("[" + i + "]");
visitText(" ");
}
visitCrossReference(bookAbbr, book, lastChapter, "1", lastChapter, lastVerse).visitText("[" + lastChapter + "]");
return firstVisitor;
}
MyAnyType link = of.createMyAnyType();
MyAnyType label = of.createMyAnyType();
target.add(new JAXBElement<MyAnyType>(new QName("labeledlink"), MyAnyType.class, link));
RefLinkType rl = of.createRefLinkType();
rl.setMscope(book.getZefID() + ";" + firstChapter + ";" + firstVerse + (firstVerse.equals(lastVerse) ? "" : "-" + lastVerse));
link.getContent().add(of.createTItemReflink(rl));
link.getContent().add(new JAXBElement<MyAnyType>(new QName("linklabel"), MyAnyType.class, label));
return new ZefDicVisitor(label.getContent(), xrefMap);
}
@Override
public Visitor<RuntimeException> visitFormattingInstruction(FormattingInstructionKind kind) throws RuntimeException {
return visitCSSFormatting(kind.getCss());
}
@Override
public Visitor<RuntimeException> visitCSSFormatting(String css) throws RuntimeException {
TStyle style = of.createTStyle();
style.setCss(css);
target.add(new JAXBElement<TStyle>(new QName("style"), TStyle.class, style));
return new ZefDicVisitor(style.getContent(), xrefMap);
}
@Override
public void visitVerseSeparator() throws RuntimeException {
System.out.println("WARNING: Verse separators are not supported");
}
@Override
public void visitLineBreak(LineBreakKind kind) throws RuntimeException {
target.add(of.createTParagraphBr(""));
if (kind == LineBreakKind.PARAGRAPH)
target.add(of.createTParagraphBr(""));
}
@Override
public Visitor<RuntimeException> visitGrammarInformation(char[] strongsPrefixes, int[] strongs, String[] rmac, int[] sourceIndices) throws RuntimeException {
System.out.println("WARNING: Grammar information is not supported");
return this;
}
@Override
public Visitor<RuntimeException> visitDictionaryEntry(String dictionary, String entry) throws RuntimeException {
if (xrefMap.containsKey(entry))
entry = xrefMap.get(entry);
MyAnyType link = of.createMyAnyType();
MyAnyType label = of.createMyAnyType();
target.add(new JAXBElement<MyAnyType>(new QName("labeledlink"), MyAnyType.class, link));
SeeType see = of.createSeeType();
see.setTarget("x-self");
see.setContent(entry);
link.getContent().add(of.createSee(see));
link.getContent().add(new JAXBElement<MyAnyType>(new QName("linklabel"), MyAnyType.class, label));
return new ZefDicVisitor(label.getContent(), xrefMap);
}
@Override
public void visitRawHTML(RawHTMLMode mode, String raw) throws RuntimeException {
if (!mode.equals(Boolean.getBoolean("rawhtml.online") ? RawHTMLMode.OFFLINE : RawHTMLMode.ONLINE)) {
addRaw(raw);
}
}
@Override
public Visitor<RuntimeException> visitVariationText(String[] variations) throws RuntimeException {
throw new IllegalStateException("Variations not supported");
}
@Override
public Visitor<RuntimeException> visitExtraAttribute(ExtraAttributePriority prio, String category, String key, String value) throws RuntimeException {
return prio.handleVisitor(category, this);
}
@Override
public boolean visitEnd() throws RuntimeException {
return false;
}
private void addRaw(String html) {
MyAnyType mat = of.createMyAnyType();
target.add(new JAXBElement<MyAnyType>(new QName("raw"), MyAnyType.class, mat));
mat.getContent().add(html);
}
}
}
|
3e027d1bbcc6cf0cbcb0b08e113bbbf7c6f46f89 | 1,661 | java | Java | src/test/java/net/sf/xmlunit/diff/OrderPreservingNamedNodeMap.java | twerszko/xmlunit-nsc | bb68d10cd9c188e3f160ffd6c4c1f4786d6ee086 | [
"BSD-3-Clause"
]
| null | null | null | src/test/java/net/sf/xmlunit/diff/OrderPreservingNamedNodeMap.java | twerszko/xmlunit-nsc | bb68d10cd9c188e3f160ffd6c4c1f4786d6ee086 | [
"BSD-3-Clause"
]
| null | null | null | src/test/java/net/sf/xmlunit/diff/OrderPreservingNamedNodeMap.java | twerszko/xmlunit-nsc | bb68d10cd9c188e3f160ffd6c4c1f4786d6ee086 | [
"BSD-3-Clause"
]
| 1 | 2019-04-23T03:25:16.000Z | 2019-04-23T03:25:16.000Z | 22.146667 | 81 | 0.593016 | 1,016 | package net.sf.xmlunit.diff;
import java.util.ArrayList;
import javax.annotation.Nullable;
import org.w3c.dom.Attr;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
public class OrderPreservingNamedNodeMap implements NamedNodeMap {
private final ArrayList<Attr> nodes = new ArrayList<Attr>();
public void add(Attr attr) {
nodes.add(attr);
}
@Override
public int getLength() {
return nodes.size();
}
@Override
public Node item(int index) {
return nodes.get(index);
}
@Override
@Nullable
public Node getNamedItem(String name) {
for (Attr attr : nodes) {
if (attr.getName().equals(name)) {
return attr;
}
}
return null;
}
@Override
public Node getNamedItemNS(String ns, String localName) {
for (Attr attr : nodes) {
String attrLocalName = attr.getLocalName();
String attrNamespaceURI = attr.getNamespaceURI();
if (localName.equals(attrLocalName) && ns.equals(attrNamespaceURI)) {
return attr;
}
}
return null;
}
// not implemented, not needed in our case
@Override
public Node removeNamedItem(String n) {
return fail();
}
@Override
public Node removeNamedItemNS(String n1, String n2) {
return fail();
}
@Override
public Node setNamedItem(Node n) {
return fail();
}
@Override
public Node setNamedItemNS(Node n) {
return fail();
}
private Node fail() {
throw new RuntimeException("not implemented");
}
} |
3e027d265fbf4ae0b66f61cf5b5c98b274675f2b | 2,320 | java | Java | src/main/java/com/icthh/xm/ms/dashboard/web/rest/BulkDashboardResource.java | xm-online/xm-ms-dashboard | b571b7bd2cfd9a073490a4119230218c73c36245 | [
"Apache-2.0"
]
| 7 | 2017-10-03T09:20:11.000Z | 2018-01-12T15:12:20.000Z | src/main/java/com/icthh/xm/ms/dashboard/web/rest/BulkDashboardResource.java | icthothouse/xm-ms-dashboard | f73789dc0c84b714217a0afdda5d41d03d999f04 | [
"Apache-2.0"
]
| 8 | 2020-02-13T14:22:28.000Z | 2021-06-14T07:21:31.000Z | src/main/java/com/icthh/xm/ms/dashboard/web/rest/BulkDashboardResource.java | icthothouse/xm-ms-dashboard | f73789dc0c84b714217a0afdda5d41d03d999f04 | [
"Apache-2.0"
]
| 1 | 2017-10-25T08:58:18.000Z | 2017-10-25T08:58:18.000Z | 33.623188 | 94 | 0.743103 | 1,017 | package com.icthh.xm.ms.dashboard.web.rest;
import com.codahale.metrics.annotation.Timed;
import com.icthh.xm.commons.permission.annotation.PrivilegeDescription;
import com.icthh.xm.ms.dashboard.service.bulk.AtomicBulkDashboardService;
import com.icthh.xm.ms.dashboard.service.dto.DashboardDto;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.Collection;
/**
* REST controller for managing bulk atomic and non atomic operations with Dashboard resource.
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/dashboards/bulk")
public class BulkDashboardResource {
private final AtomicBulkDashboardService atomicBulkDashboardService;
/**
* Request for atomic and non atomic bulk save of dashboards
*
* @param dashboardItems request body with list of dashboards objects
*/
@Timed
@PostMapping
@PreAuthorize("hasPermission('dashboard','DASHBOARD.CREATE.BULK')")
@PrivilegeDescription("Privilege to create dashboard bulk")
public void createDashboards(
@Valid @RequestBody Collection<DashboardDto> dashboardItems
) {
atomicBulkDashboardService.create(dashboardItems);
}
/**
* Request for atomic and non atomic bulk update of dashboards
*
* @param dashboardItems request body with list of dashboards objects
*/
@Timed
@PutMapping
@PreAuthorize("hasPermission('dashboard','DASHBOARD.UPDATE.BULK')")
@PrivilegeDescription("Privilege to update dashboard bulk")
public void updateDashboards(
@Valid @RequestBody Collection<DashboardDto> dashboardItems
) {
atomicBulkDashboardService.update(dashboardItems);
}
/**
* Request for atomic and non atomic bulk delete of dashboards
*
* @param dashboardItems request body with list of dashboards objects
*/
@Timed
@DeleteMapping
@PreAuthorize("hasPermission('dashboard','DASHBOARD.DELETE.BULK')")
@PrivilegeDescription("Privilege to delete dashboard bulk")
public void deleteDashboards(
@Valid @RequestBody Collection<DashboardDto> dashboardItems
) {
atomicBulkDashboardService.delete(dashboardItems);
}
}
|
3e027d550fc8f9532856016de3e58687c0bb12e5 | 595 | java | Java | src/main/java/com/alipay/api/response/AlipayMarketingUserulePidQueryResponse.java | guyueyingmu/alipay-sdk-java-all | 049aefbfa067197c2b559976a5f780a59f2030ca | [
"Apache-2.0"
]
| null | null | null | src/main/java/com/alipay/api/response/AlipayMarketingUserulePidQueryResponse.java | guyueyingmu/alipay-sdk-java-all | 049aefbfa067197c2b559976a5f780a59f2030ca | [
"Apache-2.0"
]
| null | null | null | src/main/java/com/alipay/api/response/AlipayMarketingUserulePidQueryResponse.java | guyueyingmu/alipay-sdk-java-all | 049aefbfa067197c2b559976a5f780a59f2030ca | [
"Apache-2.0"
]
| 1 | 2019-07-25T11:28:09.000Z | 2019-07-25T11:28:09.000Z | 19.193548 | 76 | 0.732773 | 1,018 | package com.alipay.api.response;
import com.alipay.api.internal.mapping.ApiField;
import com.alipay.api.AlipayResponse;
/**
* ALIPAY API: alipay.marketing.userule.pid.query response.
*
* @author auto create
* @since 1.0, 2018-07-13 17:18:06
*/
public class AlipayMarketingUserulePidQueryResponse extends AlipayResponse {
private static final long serialVersionUID = 8257974969375987268L;
/**
* 满足条件的所有pid,多个pid使用英文逗号隔开
*/
@ApiField("pids")
private String pids;
public void setPids(String pids) {
this.pids = pids;
}
public String getPids( ) {
return this.pids;
}
}
|
3e027d7e0943e4f9cc86fdba4fdbbf9e132fedf6 | 1,319 | java | Java | java/banana/src/main/java/github/banana/vm/AllocateTest.java | zhgxun/cNotes | 5458182ed6757e0b6db2797eceff8424b302ef0a | [
"Apache-2.0"
]
| 1 | 2019-03-01T16:04:12.000Z | 2019-03-01T16:04:12.000Z | java/banana/src/main/java/github/banana/vm/AllocateTest.java | zhgxun/cNotes | 5458182ed6757e0b6db2797eceff8424b302ef0a | [
"Apache-2.0"
]
| 8 | 2020-03-04T22:44:00.000Z | 2022-03-31T21:11:05.000Z | java/banana/src/main/java/github/banana/vm/AllocateTest.java | zhgxun/cNotes | 5458182ed6757e0b6db2797eceff8424b302ef0a | [
"Apache-2.0"
]
| 2 | 2018-03-12T06:19:06.000Z | 2019-07-08T09:01:30.000Z | 45.482759 | 142 | 0.709629 | 1,019 | package github.banana.vm;
/**
* 测试内存分配策略
* -verbose:gc -Xmx20m -Xms20m -Xmn10m -XX:+PrintGCDetails
*
* [GC (Allocation Failure) [PSYoungGen: 6837K->896K(9216K)] 6837K->5000K(19456K), 0.0048621 secs] [Times: user=0.01 sys=0.00, real=0.00 secs]
* Heap
* PSYoungGen total 9216K, used 5316K [0x00000007bf600000, 0x00000007c0000000, 0x00000007c0000000)
* eden space 8192K, 53% used [0x00000007bf600000,0x00000007bfa51078,0x00000007bfe00000)
* from space 1024K, 87% used [0x00000007bfe00000,0x00000007bfee0000,0x00000007bff00000)
* to space 1024K, 0% used [0x00000007bff00000,0x00000007bff00000,0x00000007c0000000)
* ParOldGen total 10240K, used 4104K [0x00000007bec00000, 0x00000007bf600000, 0x00000007bf600000)
* object space 10240K, 40% used [0x00000007bec00000,0x00000007bf002020,0x00000007bf600000)
* Metaspace used 3322K, capacity 4496K, committed 4864K, reserved 1056768K
* class space used 365K, capacity 388K, committed 512K, reserved 1048576K
*/
public class AllocateTest {
public static void main(String[] args) {
int length = 1024 * 1024;
byte[] bytes1, bytes2, bytes3, bytes4;
bytes1 = new byte[2 * length];
bytes2 = new byte[2 * length];
bytes3 = new byte[2 * length];
bytes4 = new byte[2 * length];
}
}
|
3e027f81f3c0a2155d8b41c30a41ed78ee9d008c | 704 | java | Java | src/main/java/org/asciidoc/intellij/parser/AsciiDocElementTypes.java | gitgabrio/asciidoctor-intellij-plugin | 32c0ad825b41da69c84691112cacebbe655cf17f | [
"Apache-2.0"
]
| 1 | 2020-07-16T10:36:46.000Z | 2020-07-16T10:36:46.000Z | src/main/java/org/asciidoc/intellij/parser/AsciiDocElementTypes.java | gitgabrio/asciidoctor-intellij-plugin | 32c0ad825b41da69c84691112cacebbe655cf17f | [
"Apache-2.0"
]
| null | null | null | src/main/java/org/asciidoc/intellij/parser/AsciiDocElementTypes.java | gitgabrio/asciidoctor-intellij-plugin | 32c0ad825b41da69c84691112cacebbe655cf17f | [
"Apache-2.0"
]
| null | null | null | 37.052632 | 78 | 0.81108 | 1,020 | package org.asciidoc.intellij.parser;
import com.intellij.psi.tree.IElementType;
import com.intellij.psi.tree.IFileElementType;
import org.asciidoc.intellij.AsciiDocLanguage;
import org.asciidoc.intellij.lexer.AsciiDocElementType;
/**
* @author yole
*/
public interface AsciiDocElementTypes {
IFileElementType FILE = new IFileElementType(AsciiDocLanguage.INSTANCE);
IElementType SECTION = new AsciiDocElementType("SECTION");
IElementType BLOCK_MACRO = new AsciiDocElementType("BLOCK_MACRO_ID");
IElementType BLOCK = new AsciiDocElementType("BLOCK");
IElementType BLOCK_ATTRIBUTES = new AsciiDocElementType("BLOCK_ATTRIBUTES");
IElementType LISTING = new AsciiDocElementType("LISTING");
}
|
3e0280059be11027afc223a27a920430bc45a279 | 606 | java | Java | src/main/java/com/indemnity83/irontank/reference/Reference.java | GTNewHorizons/irontanks | eca4b7a0d3073fdd26f1b22c826174e21fdfb38f | [
"MIT"
]
| null | null | null | src/main/java/com/indemnity83/irontank/reference/Reference.java | GTNewHorizons/irontanks | eca4b7a0d3073fdd26f1b22c826174e21fdfb38f | [
"MIT"
]
| 3 | 2020-09-28T05:52:28.000Z | 2021-11-11T18:25:17.000Z | src/main/java/com/indemnity83/irontank/reference/Reference.java | GTNewHorizons/irontanks | eca4b7a0d3073fdd26f1b22c826174e21fdfb38f | [
"MIT"
]
| 4 | 2020-05-25T12:25:16.000Z | 2021-02-27T19:58:19.000Z | 43.285714 | 94 | 0.79868 | 1,021 | package com.indemnity83.irontank.reference;
public class Reference {
public static final String MODID = "irontank";
public static final String VERSION = "GRADLETOKEN_VERSION";
public static final String MODNAME = "Iron Tanks";
public static final String SERVER_PROXY_CLASS = "com.indemnity83.irontank.proxy.ServerProxy";
public static final String CLIENT_PROXY_CLASS = "com.indemnity83.irontank.proxy.ClientProxy";
public static final String TILE_IRON_TANK = "com.indemnity83.irontank.block.TileIronTank";
public static final String DEPENDENCIES = "required-after:BuildCraft|Factory@[7.0.0,)";
}
|
3e0280beb32b923bfe581463544c81f3bd9cfb07 | 1,028 | java | Java | src/main/java/com/ctapweb/feature/type/LexicalVariation_Type.java | zweiss/ctap-multilingual | 42ab34f8ce803b1a336ee0ed7bc6a77b9b3245ac | [
"BSD-3-Clause"
]
| 2 | 2020-09-11T20:29:28.000Z | 2021-03-28T21:36:02.000Z | src/main/java/com/ctapweb/feature/type/LexicalVariation_Type.java | zweiss/ctap-multilingual | 42ab34f8ce803b1a336ee0ed7bc6a77b9b3245ac | [
"BSD-3-Clause"
]
| 4 | 2019-03-11T13:30:10.000Z | 2021-12-14T21:17:10.000Z | src/main/java/com/ctapweb/feature/type/LexicalVariation_Type.java | commul/multilingual-ctap-feature | 41ec398a91ce6a7bc84cfcbe45ce262744a139bc | [
"BSD-3-Clause"
]
| 2 | 2019-03-25T15:03:01.000Z | 2019-04-04T10:54:21.000Z | 27.052632 | 113 | 0.736381 | 1,022 |
/* First created by JCasGen Thu Dec 22 10:04:15 CET 2016 */
package com.ctapweb.feature.type;
import org.apache.uima.jcas.JCas;
import org.apache.uima.jcas.JCasRegistry;
import org.apache.uima.cas.impl.TypeImpl;
import org.apache.uima.cas.Type;
/**
* Updated by JCasGen Thu Dec 22 11:13:11 CET 2016
* @generated */
public class LexicalVariation_Type extends ComplexityFeatureBase_Type {
/** @generated */
@SuppressWarnings ("hiding")
public final static int typeIndexID = LexicalVariation.typeIndexID;
/** @generated
@modifiable */
@SuppressWarnings ("hiding")
public final static boolean featOkTst = JCasRegistry.getFeatOkTst("com.ctapweb.feature.type.LexicalVariation");
/** initialize variables to correspond with Cas Type and Features
* @generated
* @param jcas JCas
* @param casType Type
*/
public LexicalVariation_Type(JCas jcas, Type casType) {
super(jcas, casType);
casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl)this.casType, getFSGenerator());
}
}
|
3e0280e6938f0fd43f931ba918deab6804372eb4 | 2,271 | java | Java | modules/base/core-api/src/main/java/com/intellij/psi/PsiRecursiveElementWalkingVisitor.java | MC-JY/consulo | ebd31008fcfd03e144b46a9408d2842d0b06ffc8 | [
"Apache-2.0"
]
| 634 | 2015-01-01T19:14:25.000Z | 2022-03-22T11:42:50.000Z | modules/base/core-api/src/main/java/com/intellij/psi/PsiRecursiveElementWalkingVisitor.java | MC-JY/consulo | ebd31008fcfd03e144b46a9408d2842d0b06ffc8 | [
"Apache-2.0"
]
| 410 | 2015-01-19T09:57:51.000Z | 2022-03-22T16:24:59.000Z | modules/base/core-api/src/main/java/com/intellij/psi/PsiRecursiveElementWalkingVisitor.java | MC-JY/consulo | ebd31008fcfd03e144b46a9408d2842d0b06ffc8 | [
"Apache-2.0"
]
| 50 | 2015-03-10T04:14:49.000Z | 2022-03-22T07:08:45.000Z | 29.493506 | 114 | 0.729635 | 1,023 | /*
* Copyright 2000-2009 JetBrains s.r.o.
*
* 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.intellij.psi;
import com.intellij.openapi.progress.ProgressIndicatorProvider;
import javax.annotation.Nonnull;
import java.util.List;
/**
* Represents a PSI element visitor which recursively visits the children of the element
* on which the visit was started.
*/
public abstract class PsiRecursiveElementWalkingVisitor extends PsiElementVisitor implements PsiRecursiveVisitor {
private final boolean myVisitAllFileRoots;
private final PsiWalkingState myWalkingState = new PsiWalkingState(this) {
@Override
public void elementFinished(@Nonnull PsiElement element) {
PsiRecursiveElementWalkingVisitor.this.elementFinished(element);
}
};
protected PsiRecursiveElementWalkingVisitor() {
this(false);
}
protected PsiRecursiveElementWalkingVisitor(boolean visitAllFileRoots) {
myVisitAllFileRoots = visitAllFileRoots;
}
@Override
public void visitElement(final PsiElement element) {
ProgressIndicatorProvider.checkCanceled();
myWalkingState.elementStarted(element);
}
protected void elementFinished(PsiElement element) {
}
@Override
public void visitFile(final PsiFile file) {
if (myVisitAllFileRoots) {
final FileViewProvider viewProvider = file.getViewProvider();
final List<PsiFile> allFiles = viewProvider.getAllFiles();
if (allFiles.size() > 1) {
if (file == viewProvider.getPsi(viewProvider.getBaseLanguage())) {
for (PsiFile lFile : allFiles) {
lFile.acceptChildren(this);
}
return;
}
}
}
super.visitFile(file);
}
public void stopWalking() {
myWalkingState.stopWalking();
}
}
|
3e0281354ca86e0dd94dad317fdea59cc922e4f0 | 338 | java | Java | Server/src/main/java/com/insilicokdd/admin/Secured.java | iliancho99/Insilica | 0a5d17705c2428380c4bb2b0060f5a886509ee5a | [
"MIT"
]
| null | null | null | Server/src/main/java/com/insilicokdd/admin/Secured.java | iliancho99/Insilica | 0a5d17705c2428380c4bb2b0060f5a886509ee5a | [
"MIT"
]
| 5 | 2020-03-05T00:13:02.000Z | 2021-12-09T21:58:19.000Z | Server/src/main/java/com/insilicokdd/admin/Secured.java | iliancho99/Insilica | 0a5d17705c2428380c4bb2b0060f5a886509ee5a | [
"MIT"
]
| 1 | 2020-01-19T19:58:24.000Z | 2020-01-19T19:58:24.000Z | 26 | 49 | 0.813609 | 1,024 | package com.insilicokdd.admin;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.*;
import java.lang.annotation.RetentionPolicy;
import javax.ws.rs.NameBinding;
@NameBinding
@Retention(RetentionPolicy.RUNTIME)
@Target({TYPE, METHOD})
public @interface Secured { } |
3e0281fa5322dc597bffdb5065cc7b2b6bb58c14 | 4,753 | java | Java | smart-integration/src/test/java/org/smartdata/integration/util/Util.java | zhiqiangx/SSM | e6f6c47eb3fcf1cf3ae104e2b7def401d3ac1a48 | [
"Apache-2.0"
]
| 199 | 2017-04-19T06:37:24.000Z | 2022-03-31T12:14:22.000Z | smart-integration/src/test/java/org/smartdata/integration/util/Util.java | huangjing-nl/SSM | 1e162942a50c97882e6a8932c05ffd9ba1239765 | [
"Apache-2.0"
]
| 1,091 | 2017-04-14T07:09:55.000Z | 2022-01-20T11:15:54.000Z | smart-integration/src/test/java/org/smartdata/integration/util/Util.java | huangjing-nl/SSM | 1e162942a50c97882e6a8932c05ffd9ba1239765 | [
"Apache-2.0"
]
| 170 | 2017-04-14T03:45:30.000Z | 2022-03-31T12:14:24.000Z | 33.95 | 98 | 0.693457 | 1,025 | /**
* 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.smartdata.integration.util;
import io.restassured.RestAssured;
import io.restassured.response.Response;
import org.apache.commons.lang.StringUtils;
import org.smartdata.agent.SmartAgent;
import org.smartdata.integration.rest.RestApiBase;
import org.smartdata.server.SmartDaemon;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static io.restassured.path.json.JsonPath.with;
public class Util {
public static void waitSlaveServerAvailable() throws InterruptedException {
Util.retryUntil(new RetryTask() {
@Override
public boolean retry() {
Response response = RestAssured.get(RestApiBase.SYSTEMROOT + "/servers");
List<String> ids = with(response.asString()).get("body.id");
return ids.size() > 0;
}
}, 15);
}
public static void waitSlaveServersDown() throws InterruptedException {
Util.retryUntil(new RetryTask() {
@Override
public boolean retry() {
Response response = RestAssured.get(RestApiBase.SYSTEMROOT + "/servers");
List<String> ids = with(response.asString()).get("body.id");
return ids.size() == 0;
}
}, 15);
}
public static void waitAgentAvailable() throws InterruptedException {
Util.retryUntil(new RetryTask() {
@Override
public boolean retry() {
Response response = RestAssured.get(RestApiBase.SYSTEMROOT + "/agents");
List<String> ids = with(response.asString()).get("body.id");
return ids.size() > 0;
}
}, 15);
}
public static void waitAgentsDown() throws InterruptedException {
Util.retryUntil(new RetryTask() {
@Override
public boolean retry() {
Response response = RestAssured.get(RestApiBase.SYSTEMROOT + "/agents");
List<String> ids = with(response.asString()).get("body.id");
return ids.size() == 0;
}
}, 15);
}
public static void retryUntil(RetryTask retryTask, int maxRetries) throws InterruptedException {
retryUntil(retryTask, maxRetries, 1000);
}
public static void retryUntil(RetryTask retryTask, int maxRetries, long interval)
throws InterruptedException {
boolean met = false;
int retries = 0;
while (!met && retries < maxRetries) {
met = retryTask.retry();
retries += 1;
if (!met) {
Thread.sleep(interval);
}
}
if (!met) {
throw new RuntimeException("Failed after retry " + maxRetries + "times.");
}
}
public static Process startNewServer() throws IOException {
return Util.buildProcess(
System.getProperty("java.class.path").split(java.io.File.pathSeparator),
SmartDaemon.class.getCanonicalName(),
new String[0]);
}
public static Process startNewAgent() throws IOException {
return Util.buildProcess(
System.getProperty("java.class.path").split(java.io.File.pathSeparator),
SmartAgent.class.getCanonicalName(),
new String[0]);
}
public static Process buildProcess(
String[] options, String[] classPath, String mainClass, String[] arguments)
throws IOException {
String java = System.getProperty("java.home") + "/bin/java";
List<String> commands = new ArrayList<>();
commands.add(java);
commands.addAll(Arrays.asList(options));
commands.add("-cp");
commands.add(StringUtils.join(classPath, File.pathSeparator));
commands.add(mainClass);
commands.addAll(Arrays.asList(arguments));
return new ProcessBuilder(commands).start();
}
public static Process buildProcess(String mainClass, String[] arguments) throws IOException {
return buildProcess(new String[0], mainClass, arguments);
}
public static Process buildProcess(String[] classPath, String mainClass, String[] arguments)
throws IOException {
return buildProcess(new String[0], classPath, mainClass, arguments);
}
}
|
3e0282e72f33048047c4d7ce6601989e19cccf7a | 1,426 | java | Java | ecommerce/src/main/java/com/tul/ecommerce/domain/usecase/shoppingcart/EditItemShoppingCartService.java | jhovannycanas/tul | 7915efe71bdbd64c57a4edd1a4715920fab98b4a | [
"Apache-2.0"
]
| null | null | null | ecommerce/src/main/java/com/tul/ecommerce/domain/usecase/shoppingcart/EditItemShoppingCartService.java | jhovannycanas/tul | 7915efe71bdbd64c57a4edd1a4715920fab98b4a | [
"Apache-2.0"
]
| null | null | null | ecommerce/src/main/java/com/tul/ecommerce/domain/usecase/shoppingcart/EditItemShoppingCartService.java | jhovannycanas/tul | 7915efe71bdbd64c57a4edd1a4715920fab98b4a | [
"Apache-2.0"
]
| null | null | null | 47.533333 | 120 | 0.801543 | 1,026 | package com.tul.ecommerce.domain.usecase.shoppingcart;
import com.tul.ecommerce.domain.model.Product;
import com.tul.ecommerce.domain.model.ShoppingCart;
import com.tul.ecommerce.domain.model.ShoppingCartItem;
import com.tul.ecommerce.domain.port.in.shoppingcart.AddItemShoppingCartUseCase;
import com.tul.ecommerce.domain.port.in.shoppingcart.EditItemShoppingCartUseCase;
import com.tul.ecommerce.domain.port.out.ProductRepository;
import com.tul.ecommerce.domain.port.out.ShoppingCartRepository;
import lombok.RequiredArgsConstructor;
import java.util.UUID;
@RequiredArgsConstructor
public class EditItemShoppingCartService implements EditItemShoppingCartUseCase {
private final ProductRepository productRepository;
private final ShoppingCartRepository shoppingCartRepository;
@Override
public ShoppingCart editItem(UUID id, AddItemShoppingCartUseCase.ShoppingCartCommand shoppingCartCommand) {
shoppingCartRepository.findById(id).orElseThrow(() -> new RuntimeException("Carrito de compras no encontrado"));
Product product = this.productRepository.findByUuid(shoppingCartCommand.getProduct())
.orElseThrow(() -> new RuntimeException("Producto no encontrado"));
ShoppingCartItem shoppingCartItem = new ShoppingCartItem(product, 0.0,
shoppingCartCommand.getQuantity());
return shoppingCartRepository.editItem(id, shoppingCartItem);
}
}
|
3e02846fcb5b6341df61239c0056ac31d8d713cb | 2,685 | java | Java | spring-beans/src/main/java/org/springframework/beans/factory/config/InstantiationAwareBeanPostProcessorAdapter.java | ericbottard/spring-framework | 859e1e800345d528b17f23e74dfaf8bf4185b070 | [
"Apache-2.0"
]
| 1,962 | 2017-05-11T12:59:45.000Z | 2022-03-31T07:03:55.000Z | spring-beans/src/main/java/org/springframework/beans/factory/config/InstantiationAwareBeanPostProcessorAdapter.java | ericbottard/spring-framework | 859e1e800345d528b17f23e74dfaf8bf4185b070 | [
"Apache-2.0"
]
| 22 | 2019-06-15T14:54:14.000Z | 2022-03-31T19:51:18.000Z | spring-beans/src/main/java/org/springframework/beans/factory/config/InstantiationAwareBeanPostProcessorAdapter.java | ericbottard/spring-framework | 859e1e800345d528b17f23e74dfaf8bf4185b070 | [
"Apache-2.0"
]
| 1,068 | 2017-07-05T02:04:46.000Z | 2022-03-29T03:42:22.000Z | 31.22093 | 118 | 0.779516 | 1,027 | /*
* Copyright 2002-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.beans.factory.config;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Constructor;
import org.springframework.beans.BeansException;
import org.springframework.beans.PropertyValues;
/**
* Adapter that implements all methods on {@link SmartInstantiationAwareBeanPostProcessor}
* as no-ops, which will not change normal processing of each bean instantiated
* by the container. Subclasses may override merely those methods that they are
* actually interested in.
*
* <p>Note that this base class is only recommendable if you actually require
* {@link InstantiationAwareBeanPostProcessor} functionality. If all you need
* is plain {@link BeanPostProcessor} functionality, prefer a straight
* implementation of that (simpler) interface.
*
* @author Rod Johnson
* @author Juergen Hoeller
* @since 2.0
*/
public abstract class InstantiationAwareBeanPostProcessorAdapter implements SmartInstantiationAwareBeanPostProcessor {
@Override
public Class<?> predictBeanType(Class<?> beanClass, String beanName) {
return null;
}
@Override
public Constructor<?>[] determineCandidateConstructors(Class<?> beanClass, String beanName) throws BeansException {
return null;
}
@Override
public Object getEarlyBeanReference(Object bean, String beanName) throws BeansException {
return bean;
}
@Override
public Object postProcessBeforeInstantiation(Class<?> beanClass, String beanName) throws BeansException {
return null;
}
@Override
public boolean postProcessAfterInstantiation(Object bean, String beanName) throws BeansException {
return true;
}
@Override
public PropertyValues postProcessPropertyValues(
PropertyValues pvs, PropertyDescriptor[] pds, Object bean, String beanName)
throws BeansException {
return pvs;
}
@Override
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
return bean;
}
@Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
return bean;
}
}
|
3e028492563d4f1588310969f9163253f1925fe9 | 1,361 | java | Java | packages/react-native-media-player/android/src/main/java/com/yajananrao/mediaplayer/MediaPlayerPackage.java | YajanaRao/Nadha | 1aafd79b3b121325240ec72537a4a5adecf7aea0 | [
"MIT"
]
| 1 | 2020-06-21T19:46:17.000Z | 2020-06-21T19:46:17.000Z | packages/react-native-media-player/android/src/main/java/com/yajananrao/mediaplayer/MediaPlayerPackage.java | YajanaRao/Nadha | 1aafd79b3b121325240ec72537a4a5adecf7aea0 | [
"MIT"
]
| 38 | 2020-05-23T07:38:03.000Z | 2021-09-02T11:35:09.000Z | packages/react-native-media-player/android/src/main/java/com/yajananrao/mediaplayer/MediaPlayerPackage.java | YajanaRao/Nadha | 1aafd79b3b121325240ec72537a4a5adecf7aea0 | [
"MIT"
]
| 3 | 2020-06-14T18:59:02.000Z | 2020-09-17T07:17:03.000Z | 30.244444 | 89 | 0.706833 | 1,028 | package com.yajananrao.mediaplayer;
import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import android.util.Log;
public class MediaPlayerPackage implements ReactPackage {
private static final String TAG = "MediaPlayerPackage";
private SeekBarViewManager seekBarView;
@Override
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
if(seekBarView == null){
Log.i(TAG,"Creating seekbar instance in view manager");
seekBarView = new SeekBarViewManager();
}
Log.i(TAG, "sending seekbar instance to react native");
return Collections.<ViewManager>singletonList(
seekBarView
);
}
@Override
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
List<NativeModule> modules = new ArrayList<>();
if(seekBarView == null){
Log.i(TAG, "Creating seekbar instance in native module");
seekBarView = new SeekBarViewManager();
}
modules.add(new MediaPlayerModule(reactContext, seekBarView));
return modules;
}
}
|
3e0284b1c52f9fa310c214578a0044d1cd15f001 | 7,854 | java | Java | src/main/java/net/silentchaos512/gear/item/gear/CoreElytra.java | SAMUELPV/Silent-Gear | e5b01992e8f553e3d29cbfebeb48a4fe2280bf40 | [
"MIT"
]
| null | null | null | src/main/java/net/silentchaos512/gear/item/gear/CoreElytra.java | SAMUELPV/Silent-Gear | e5b01992e8f553e3d29cbfebeb48a4fe2280bf40 | [
"MIT"
]
| null | null | null | src/main/java/net/silentchaos512/gear/item/gear/CoreElytra.java | SAMUELPV/Silent-Gear | e5b01992e8f553e3d29cbfebeb48a4fe2280bf40 | [
"MIT"
]
| null | null | null | 35.7 | 148 | 0.716068 | 1,029 | package net.silentchaos512.gear.item.gear;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.LinkedHashMultimap;
import com.google.common.collect.Multimap;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.ai.attributes.Attribute;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.ai.attributes.Attributes;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.EquipmentSlotType;
import net.minecraft.item.ElytraItem;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World;
import net.minecraftforge.common.capabilities.ICapabilityProvider;
import net.minecraftforge.fml.ModList;
import net.silentchaos512.gear.api.item.GearType;
import net.silentchaos512.gear.api.item.ICoreArmor;
import net.silentchaos512.gear.api.part.PartType;
import net.silentchaos512.gear.api.stats.ItemStat;
import net.silentchaos512.gear.api.stats.ItemStats;
import net.silentchaos512.gear.client.util.GearClientHelper;
import net.silentchaos512.gear.compat.caelus.CaelusCompat;
import net.silentchaos512.gear.compat.curios.CuriosCompat;
import net.silentchaos512.gear.config.Config;
import net.silentchaos512.gear.gear.part.PartData;
import net.silentchaos512.gear.util.Const;
import net.silentchaos512.gear.util.GearHelper;
import net.silentchaos512.gear.util.TextUtil;
import net.silentchaos512.gear.util.TraitHelper;
import javax.annotation.Nullable;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import java.util.function.Consumer;
public class CoreElytra extends ElytraItem implements ICoreArmor {
private static final int DURABILITY_MULTIPLIER = 25;
private static final UUID ARMOR_UUID = UUID.fromString("f099f401-82f6-4565-a0b5-fd464f2dc72c");
private static final List<PartType> REQUIRED_PARTS = ImmutableList.of(
PartType.MAIN,
PartType.BINDING
);
private static final Set<ItemStat> RELEVANT_STATS = ImmutableSet.of(
ItemStats.DURABILITY,
ItemStats.REPAIR_EFFICIENCY,
ItemStats.ARMOR
);
private static final Set<ItemStat> EXCLUDED_STATS = ImmutableSet.of(
ItemStats.REPAIR_VALUE,
ItemStats.HARVEST_LEVEL,
ItemStats.HARVEST_SPEED,
ItemStats.REACH_DISTANCE,
ItemStats.MELEE_DAMAGE,
ItemStats.MAGIC_DAMAGE,
ItemStats.ATTACK_SPEED,
ItemStats.ATTACK_REACH,
ItemStats.RANGED_DAMAGE,
ItemStats.RANGED_SPEED
);
public CoreElytra(Properties builder) {
super(builder.maxDamage(100));
}
@Override
public GearType getGearType() {
return GearType.ELYTRA;
}
@Override
public Set<ItemStat> getRelevantStats(ItemStack stack) {
return RELEVANT_STATS;
}
@Override
public Set<ItemStat> getExcludedStats(ItemStack stack) {
return EXCLUDED_STATS;
}
@Override
public boolean isValidSlot(String slot) {
return EquipmentSlotType.CHEST.getName().equalsIgnoreCase(slot) || "back".equalsIgnoreCase(slot);
}
@Override
public Collection<PartType> getRequiredParts() {
return REQUIRED_PARTS;
}
@Override
public boolean supportsPart(ItemStack gear, PartData part) {
PartType type = part.getType();
boolean canAdd = part.get().canAddToGear(gear, part);
boolean supported = (requiresPartOfType(part.getType()) && canAdd) || canAdd;
return (type == PartType.MAIN && supported)
|| type == PartType.LINING
|| supported;
}
@Override
public boolean hasTexturesFor(PartType partType) {
return partType == PartType.MAIN || partType == PartType.BINDING;
}
@Override
public float getRepairModifier(ItemStack stack) {
return DURABILITY_MULTIPLIER;
}
@Nullable
@Override
public EquipmentSlotType getEquipmentSlot(ItemStack stack) {
return EquipmentSlotType.CHEST;
}
@Override
public int getMaxDamage(ItemStack stack) {
return DURABILITY_MULTIPLIER * getStatInt(stack, getDurabilityStat());
}
@Override
public void setDamage(ItemStack stack, int damage) {
if (GearHelper.isUnbreakable(stack))
return;
if (!Config.Common.gearBreaksPermanently.get())
damage = MathHelper.clamp(damage, 0, getMaxDamage(stack));
super.setDamage(stack, damage);
}
@Override
public <T extends LivingEntity> int damageItem(ItemStack stack, int amount, T entity, Consumer<T> onBroken) {
return GearHelper.damageItem(stack, amount, entity, t -> {
GearHelper.onBroken(stack, t instanceof PlayerEntity ? (PlayerEntity) t : null, this.getEquipmentSlot(stack));
onBroken.accept(t);
});
}
@Override
public boolean getIsRepairable(ItemStack toRepair, ItemStack repair) {
return GearHelper.getIsRepairable(toRepair, repair);
}
@Override
public void onArmorTick(ItemStack stack, World world, PlayerEntity player) {
GearHelper.inventoryTick(stack, world, player, 0, true);
}
@Override
public void inventoryTick(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) {
GearHelper.inventoryTick(stack, worldIn, entityIn, itemSlot, isSelected);
}
@Override
public void fillItemGroup(ItemGroup group, NonNullList<ItemStack> items) {
GearHelper.fillItemGroup(this, group, items);
}
@Override
public boolean makesPiglinsNeutral(ItemStack stack, LivingEntity wearer) {
return TraitHelper.hasTrait(stack, Const.Traits.BRILLIANT);
}
@Nullable
@Override
public ICapabilityProvider initCapabilities(ItemStack stack, @Nullable CompoundNBT nbt) {
if (ModList.get().isLoaded(Const.CURIOS)) {
return CuriosCompat.createElytraProvider(stack, this);
}
return super.initCapabilities(stack, nbt);
}
@Override
public Multimap<Attribute, AttributeModifier> getAttributeModifiers(EquipmentSlotType slot, ItemStack stack) {
Multimap<Attribute, AttributeModifier> multimap = LinkedHashMultimap.create();
if (isValidSlot(slot.getName())) {
addAttributes(slot.getName(), stack, multimap, true);
}
return multimap;
}
public void addAttributes(String slot, ItemStack stack, Multimap<Attribute, AttributeModifier> multimap, boolean includeArmor) {
float armor = getStat(stack, ItemStats.ARMOR);
if (armor > 0 && includeArmor) {
multimap.put(Attributes.ARMOR, new AttributeModifier(ARMOR_UUID, "Elytra armor modifier", armor, AttributeModifier.Operation.ADDITION));
}
GearHelper.getAttributeModifiers(slot, stack, multimap, false);
CaelusCompat.tryAddFlightAttribute(multimap);
}
@Override
public ITextComponent getDisplayName(ItemStack stack) {
return GearHelper.getDisplayName(stack);
}
@Override
public void addInformation(ItemStack stack, @Nullable World worldIn, List<ITextComponent> tooltip, ITooltipFlag flagIn) {
if (!ModList.get().isLoaded(Const.CAELUS)) {
tooltip.add(TextUtil.misc("caelusNotInstalled").mergeStyle(TextFormatting.RED));
}
GearClientHelper.addInformation(stack, worldIn, tooltip, flagIn);
}
}
|
3e02855387274b5a62ca0c93f164f52fb95a527f | 4,124 | java | Java | core/hcommon/src/main/java/org/iipg/web/cmd/DefaultCmdServer.java | SagittariusZhu/hurricane | bc210d4c32143bcd70ea451d24195bce9f91c27f | [
"Apache-2.0"
]
| null | null | null | core/hcommon/src/main/java/org/iipg/web/cmd/DefaultCmdServer.java | SagittariusZhu/hurricane | bc210d4c32143bcd70ea451d24195bce9f91c27f | [
"Apache-2.0"
]
| 2 | 2020-02-12T19:30:52.000Z | 2020-11-16T16:46:17.000Z | core/hcommon/src/main/java/org/iipg/web/cmd/DefaultCmdServer.java | SagittariusZhu/hurricane | bc210d4c32143bcd70ea451d24195bce9f91c27f | [
"Apache-2.0"
]
| null | null | null | 32.21875 | 112 | 0.663676 | 1,030 | package org.iipg.web.cmd;
import java.io.File;
import java.io.IOException;
import org.eclipse.jetty.security.ConstraintSecurityHandler;
import org.eclipse.jetty.security.HashLoginService;
import org.eclipse.jetty.security.SecurityHandler;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.HandlerCollection;
import org.eclipse.jetty.servlet.ServletHandler;
import org.eclipse.jetty.webapp.WebAppContext;
public class DefaultCmdServer {
public static final int DEFAULT_PORT = 12345;
public static final String DEFAULT_APPNAME = "wcmd";
public static final String DEFAULT_WEBAPP = "./webapps";
private int port = DEFAULT_PORT;
private String appName = DEFAULT_APPNAME;
private String webApp = DEFAULT_WEBAPP;
private String tempPath = System.getProperty("java.io.tmpdir");
private String jettyHome = System.getProperty("jetty.home");
private String webName = "";
private boolean isSecurity = false;
public void start() {
Thread thread = new Thread(){
public void run() {
initServer();
}
};
thread.start();
}
private void initServer() {
Server server = new Server(port);
HandlerCollection collection = new HandlerCollection();
//handler 1
ServletHandler handler = new ServletHandler();
handler.addServletWithMapping(HManageServlet.class, "/" + appName + "/*");
collection.addHandler(handler);
//handler webapp
if (webName.length() > 0) {
WebAppContext context = new WebAppContext();
if (isSecurity) {
HashLoginService realm = new HashLoginService("Test Realm", this.jettyHome + "/etc/realm.properties");
SecurityHandler securityHandler = new ConstraintSecurityHandler();
securityHandler.setLoginService(realm);
context.setSecurityHandler(securityHandler);
}
context.setContextPath("/" + webName);
context.setDefaultsDescriptor(webApp + "/etc/webdefault.xml");
context.setTempDirectory(new File(tempPath));
context.setResourceBase(webApp);
context.setParentLoaderPriority(true);
context.setDescriptor(webApp + "/WEB-INF/web.xml");
collection.addHandler(context);
System.out.println("Add WebAppContext " + webName);
}
server.setHandler(collection);
try {
server.start();
System.out.println("IIPG Web Command Server started" +
"\n context : /" + appName +
"\n port : " + port);
server.join();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static void main(String[] args) {
(new DefaultCmdServer()).start();
}
public void setProperty(String propName, Object value) {
if (propName.equals("cmdPrefix")) {
CommandFactory.setCmdPrefix((String) value);
} else if (propName.equals("serverPort")) {
this.port = (int) value;
} else if (propName.equals("appName")) {
this.appName = (String) value;
} else if (propName.equals("webApp")) {
this.webApp = (String) value;
if (!(new File(this.webApp)).isAbsolute()) {
try {
File dir = new File (".");
System.out.println ("Current dir : " + dir.getCanonicalPath());
this.webApp = dir.getCanonicalPath() + File.separator + this.webApp;
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
} else if (propName.equals("tempPath")) {
this.tempPath = (String) value;
} else if (propName.equals("webName")) {
this.webName = (String) value;
} else if (propName.equals("jettyHome")) {
this.jettyHome = (String) value;
if (!(new File(this.jettyHome)).isAbsolute()) {
try {
File dir = new File (".");
System.out.println ("Current dir : " + dir.getCanonicalPath());
this.jettyHome = dir.getCanonicalPath() + File.separator + this.jettyHome;
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
}
|
3e0285ed32aca7257bad7d1c99c00f9ca5204dd5 | 38,681 | java | Java | com.zutubi.pulse.core/src/test/com/zutubi/pulse/core/plugins/PluginManagerTest.java | Zutubi/pulse | 6a41105ae8438018b055611268c20dac5585f890 | [
"Apache-2.0"
]
| 11 | 2017-04-14T16:58:09.000Z | 2019-06-27T09:44:31.000Z | com.zutubi.pulse.core/src/test/com/zutubi/pulse/core/plugins/PluginManagerTest.java | Zutubi/pulse | 6a41105ae8438018b055611268c20dac5585f890 | [
"Apache-2.0"
]
| null | null | null | com.zutubi.pulse.core/src/test/com/zutubi/pulse/core/plugins/PluginManagerTest.java | Zutubi/pulse | 6a41105ae8438018b055611268c20dac5585f890 | [
"Apache-2.0"
]
| 7 | 2017-07-02T04:32:32.000Z | 2022-03-10T07:49:52.000Z | 36.320188 | 116 | 0.657222 | 1,031 | /* Copyright 2017 Zutubi Pty Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.zutubi.pulse.core.plugins;
import com.google.common.io.Files;
import com.zutubi.util.io.FileSystemUtils;
import com.zutubi.util.io.ZipUtils;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.List;
import java.util.zip.ZipInputStream;
import static com.zutubi.util.io.FileSystemUtils.delete;
import static java.util.Arrays.asList;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
public class PluginManagerTest extends BasePluginSystemTestCase
{
private static final String PRODUCER_ID = "com.zutubi.bundles.producer";
private static final String CONSUMER_ID = "com.zutubi.bundles.consumer";
private static final String EXTENSION_JAR = "jar";
private File producer1;
private File producer11;
private File producer2;
private File consumer1;
private File bad;
private File failonstartup;
private File failonshutdown;
protected void setUp() throws Exception
{
super.setUp();
producer1 = getInputFile("com.zutubi.bundles.producer_1.0.0", EXTENSION_JAR);
producer11 = getInputFile("com.zutubi.bundles.producer_1.1.0", EXTENSION_JAR);
producer2 = getInputFile("com.zutubi.bundles.producer_2.0.0", EXTENSION_JAR);
consumer1 = getInputFile("com.zutubi.bundles.consumer_1.0.0", EXTENSION_JAR);
failonstartup = getInputFile("com.zutubi.bundles.failonstartup_1.0.0", EXTENSION_JAR);
failonshutdown = getInputFile("com.zutubi.bundles.failonshutdown_1.0.0", EXTENSION_JAR);
// should rename this - this is an empty file..
bad = getInputFile("bad", EXTENSION_JAR);
}
public void testInstallPlugin() throws Exception
{
startupPluginCore();
File installedPluginFile = new File(paths.getPluginStorageDir(), producer1.getName());
assertFalse(installedPluginFile.isFile());
Plugin installedPlugin = manager.install(producer1.toURI());
assertPlugin(installedPlugin, PRODUCER_ID, "1.0.0", Plugin.State.ENABLED);
assertEquals(1, manager.getPlugins().size());
// verify that the plugin has been installed.
assertTrue(installedPluginFile.isFile());
assertEquals(0, installedPlugin.getErrorMessages().size());
assertEquals(1, manager.equinox.getBundleCount(PRODUCER_ID));
assertEquals(0, paths.getPluginWorkDir().list().length);
assertEquals(1, paths.getPluginStorageDir().list().length);
}
public void testInstallWithAutostartEnabled() throws Exception
{
startupPluginCore();
Plugin installedPlugin = manager.install(producer1.toURI());
assertPlugin(installedPlugin, PRODUCER_ID, "1.0.0", Plugin.State.ENABLED);
assertEquals(0, installedPlugin.getErrorMessages().size());
assertEquals(1, manager.equinox.getBundleCount(PRODUCER_ID));
}
public void testDefaultManifest() throws Exception
{
startupPluginCore();
try
{
manager.install(getInputURL(EXTENSION_JAR).toURI());
fail("Should not be able to install jar with default manifest");
}
catch (Exception e)
{
assertThat(e.getMessage(), containsString("Required header 'Bundle-Name' not present"));
}
assertNoInstalledJars();
}
public void testBadVersion() throws Exception
{
startupPluginCore();
try
{
manager.install(getInputURL(EXTENSION_JAR).toURI());
fail("Should not be able to install jar with a poorly formatted version");
}
catch (Exception e)
{
assertThat(e.getMessage(), containsString("Version contains less than three segments"));
}
assertNoInstalledJars();
}
public void testInstallFileAlreadyExists() throws Exception
{
startupPluginCore();
manager.install(producer1.toURI());
try
{
manager.install(producer1.toURI());
fail("Should not be able to install when plugin file already exists");
}
catch (PluginException e)
{
assertThat(e.getMessage(), containsString("already exists"));
}
assertEquals(1, manager.getPlugins().size());
assertEquals(1, manager.equinox.getBundleCount(PRODUCER_ID));
}
public void testInstallSameIdAlreadyExists() throws Exception
{
startupPluginCore();
manager.install(producer1.toURI());
try
{
manager.install(producer11.toURI());
fail("Should not be able to install when plugin of same id already exists");
}
catch (PluginException e)
{
assertThat(e.getMessage(), containsString("is already installed"));
}
assertEquals(1, manager.getPlugins().size());
assertEquals(1, manager.equinox.getBundleCount(PRODUCER_ID));
}
public void testInstallWithMissingDependency() throws Exception
{
startupPluginCore();
// install the consumer before we install the producer.
Plugin installedConsumer = manager.install(consumer1.toURI());
assertPlugin(installedConsumer, CONSUMER_ID, "1.0.0", Plugin.State.ERROR);
assertEquals("Failed to resolve bundle dependencies.", installedConsumer.getErrorMessages().get(0));
assertEquals(0, manager.equinox.getBundleCount(CONSUMER_ID));
}
public void testInstallingAPluginBeforeInstallingItsDependency() throws PluginException
{
startupPluginCore();
// install the consumer before we install the producer.
Plugin installedConsumer = manager.install(consumer1.toURI());
assertPlugin(installedConsumer, CONSUMER_ID, "1.0.0", Plugin.State.ERROR);
assertEquals("Failed to resolve bundle dependencies.", installedConsumer.getErrorMessages().get(0));
assertTrue(new File(paths.getPluginStorageDir(), consumer1.getName()).isFile());
// install the missing consumer dependency
Plugin installedProducer = manager.install(producer1.toURI());
assertPlugin(installedProducer, PRODUCER_ID, "1.0.0", Plugin.State.ENABLED);
assertTrue(new File(paths.getPluginStorageDir(), producer1.getName()).isFile());
// and ensure that we can now start the consumer.
installedConsumer.enable();
assertPlugin(installedConsumer, CONSUMER_ID, "1.0.0", Plugin.State.ENABLED);
assertEquals(0, installedConsumer.getErrorMessages().size());
assertEquals(1, manager.equinox.getBundleCount(CONSUMER_ID));
assertEquals(1, manager.equinox.getBundleCount(PRODUCER_ID));
}
public void testEnablePlugin() throws Exception
{
startupPluginCore();
Plugin plugin = manager.install(producer1.toURI());
plugin.disable();
restartPluginCore();
plugin = manager.getPlugin(PRODUCER_ID);
assertPlugin(plugin, PRODUCER_ID, "1.0.0", Plugin.State.DISABLED);
assertEquals(0, manager.equinox.getBundleCount(PRODUCER_ID));
plugin.enable();
assertPlugin(plugin, PRODUCER_ID, "1.0.0", Plugin.State.ENABLED);
assertEquals(1, manager.equinox.getBundleCount(PRODUCER_ID));
}
public void testDisablePlugin() throws Exception
{
startupPluginCore();
Plugin plugin = manager.install(producer1.toURI());
assertPlugin(plugin, PRODUCER_ID, "1.0.0", Plugin.State.ENABLED);
plugin.disable();
assertEquals(Plugin.State.DISABLING, plugin.getState());
// restart the plugin system.
restartPluginCore();
// the plugin should be disabled after restart.
plugin = manager.getPlugin(PRODUCER_ID);
assertPlugin(plugin, PRODUCER_ID, "1.0.0", Plugin.State.DISABLED);
}
public void testEnableDisableCorrectlyPersistsAcrossRestarts() throws Exception
{
startupPluginCore();
Plugin plugin = manager.install(producer1.toURI());
assertPlugin(plugin, PRODUCER_ID, "1.0.0", Plugin.State.ENABLED);
plugin.disable();
restartPluginCore();
plugin = manager.getPlugin(PRODUCER_ID);
assertPlugin(plugin, PRODUCER_ID, "1.0.0", Plugin.State.DISABLED);
assertEquals(0, manager.equinox.getBundleCount(PRODUCER_ID));
restartPluginCore();
plugin = manager.getPlugin(PRODUCER_ID);
assertPlugin(plugin, PRODUCER_ID, "1.0.0", Plugin.State.DISABLED);
assertEquals(0, manager.equinox.getBundleCount(PRODUCER_ID));
plugin.enable();
assertPlugin(plugin, PRODUCER_ID, "1.0.0", Plugin.State.ENABLED);
assertEquals(1, manager.equinox.getBundleCount(PRODUCER_ID));
restartPluginCore();
plugin = manager.getPlugin(PRODUCER_ID);
assertPlugin(plugin, PRODUCER_ID, "1.0.0", Plugin.State.ENABLED);
assertEquals(1, manager.equinox.getBundleCount(PRODUCER_ID));
}
public void testDisablingRequiredPluginEffectOnDependent() throws Exception
{
startupPluginCore();
Plugin producer = manager.install(producer1.toURI());
assertPlugin(producer, PRODUCER_ID, "1.0.0", Plugin.State.ENABLED);
Plugin consumer = manager.install(consumer1.toURI());
assertPlugin(consumer, CONSUMER_ID, "1.0.0", Plugin.State.ENABLED);
producer.disable();
assertEquals(Plugin.State.DISABLING, producer.getState());
restartPluginCore();
producer = manager.getPlugin(PRODUCER_ID);
assertPlugin(producer, PRODUCER_ID, "1.0.0", Plugin.State.DISABLED);
consumer = manager.getPlugin(CONSUMER_ID);
assertPlugin(consumer, CONSUMER_ID, "1.0.0", Plugin.State.ERROR);
producer.enable();
assertPlugin(producer, PRODUCER_ID, "1.0.0", Plugin.State.ENABLED);
restartPluginCore();
producer = manager.getPlugin(PRODUCER_ID);
assertPlugin(producer, PRODUCER_ID, "1.0.0", Plugin.State.ENABLED);
consumer = manager.getPlugin(CONSUMER_ID);
assertPlugin(consumer, CONSUMER_ID, "1.0.0", Plugin.State.ENABLED);
}
public void testRequestInstall() throws Exception
{
startupPluginCore();
Plugin plugin = manager.requestInstall(producer1.toURI());
assertPlugin(plugin, PRODUCER_ID, "1.0.0", Plugin.State.INSTALLING);
assertEquals(0, manager.equinox.getBundleCount(PRODUCER_ID));
restartPluginCore();
plugin = manager.getPlugin(PRODUCER_ID);
assertPlugin(plugin, PRODUCER_ID, "1.0.0", Plugin.State.ENABLED);
assertEquals(1, manager.equinox.getBundleCount(PRODUCER_ID));
}
public void testRequestInstallMultiple() throws Exception
{
startupPluginCore();
Plugin consumer = manager.requestInstall(consumer1.toURI());
assertPlugin(consumer, CONSUMER_ID, "1.0.0", Plugin.State.INSTALLING);
assertEquals(0, manager.equinox.getBundleCount(CONSUMER_ID));
Plugin producer = manager.requestInstall(producer1.toURI());
assertPlugin(producer, PRODUCER_ID, "1.0.0", Plugin.State.INSTALLING);
assertEquals(0, manager.equinox.getBundleCount(PRODUCER_ID));
restartPluginCore();
consumer = manager.getPlugin(CONSUMER_ID);
assertPlugin(consumer, CONSUMER_ID, "1.0.0", Plugin.State.ENABLED);
assertEquals(1, manager.equinox.getBundleCount(CONSUMER_ID));
producer = manager.getPlugin(PRODUCER_ID);
assertPlugin(producer, PRODUCER_ID, "1.0.0", Plugin.State.ENABLED);
assertEquals(1, manager.equinox.getBundleCount(PRODUCER_ID));
}
public void testInstallAllSinglePlugin() throws Exception
{
startupPluginCore();
File installedPluginFile = new File(paths.getPluginStorageDir(), producer1.getName());
assertFalse(installedPluginFile.isFile());
List<? extends Plugin> installedPlugins = manager.installAll(asList(producer1.toURI()));
assertEquals(1, installedPlugins.size());
Plugin installedPlugin = installedPlugins.get(0);
assertPlugin(installedPlugin, PRODUCER_ID, "1.0.0", Plugin.State.ENABLED);
assertEquals(1, manager.getPlugins().size());
// verify that the plugin has been installed.
assertTrue(installedPluginFile.isFile());
assertEquals(0, installedPlugin.getErrorMessages().size());
assertEquals(1, manager.equinox.getBundleCount(PRODUCER_ID));
assertEquals(0, paths.getPluginWorkDir().list().length);
assertEquals(1, paths.getPluginStorageDir().list().length);
}
public void testInstallAllMultiplePlugins() throws Exception
{
startupPluginCore();
List<? extends Plugin> installedPlugins = manager.installAll(asList(producer1.toURI(), consumer1.toURI()));
assertEquals(2, installedPlugins.size());
assertEquals(2, manager.getPlugins().size());
Plugin producerPlugin = installedPlugins.get(0);
assertPlugin(producerPlugin, PRODUCER_ID, "1.0.0", Plugin.State.ENABLED);
Plugin consumerPlugin = installedPlugins.get(1);
assertPlugin(consumerPlugin, CONSUMER_ID, "1.0.0", Plugin.State.ENABLED);
}
public void testInstallAllOutOfDependencyOrder() throws Exception
{
startupPluginCore();
List<? extends Plugin> installedPlugins = manager.installAll(asList(consumer1.toURI(), producer1.toURI()));
assertEquals(2, installedPlugins.size());
assertEquals(2, manager.getPlugins().size());
Plugin consumerPlugin = installedPlugins.get(0);
assertPlugin(consumerPlugin, CONSUMER_ID, "1.0.0", Plugin.State.ENABLED);
Plugin producerPlugin = installedPlugins.get(1);
assertPlugin(producerPlugin, PRODUCER_ID, "1.0.0", Plugin.State.ENABLED);
}
public void testInstallAllMissingDependency() throws PluginException
{
startupPluginCore();
List<? extends Plugin> plugins = manager.installAll(asList(consumer1.toURI()));
assertEquals(1, plugins.size());
Plugin installedConsumer = plugins.get(0);
assertPlugin(installedConsumer, CONSUMER_ID, "1.0.0", Plugin.State.ERROR);
assertEquals("Failed to resolve bundle.", installedConsumer.getErrorMessages().get(0));
assertEquals(0, manager.equinox.getBundleCount(CONSUMER_ID));
}
public void testUpgradeDisabledPlugin() throws Exception
{
startupPluginCore();
Plugin plugin = manager.install(producer1.toURI());
plugin.disable();
restartPluginCore();
plugin = manager.getPlugin(PRODUCER_ID);
assertPlugin(plugin, PRODUCER_ID, "1.0.0", Plugin.State.DISABLED);
// upgraded plugin should retain the state of the original. So, upgrading a disabled plugin
// will remain disabled.
plugin = plugin.upgrade(producer11.toURI());
assertPlugin(plugin, PRODUCER_ID, "1.1.0", Plugin.State.DISABLED);
assertEquals(1, manager.getPlugins().size());
// ensure that the correct plugin is cached in the core.
plugin = manager.getPlugin(PRODUCER_ID);
assertPlugin(plugin, PRODUCER_ID, "1.1.0", Plugin.State.DISABLED);
restartPluginCore();
// ensure that the correct plugin is available on restart.
plugin = manager.getPlugin(PRODUCER_ID);
assertPlugin(plugin, PRODUCER_ID, "1.1.0", Plugin.State.DISABLED);
// it is not until we attempt to enable the plugin that the version change is detected.
plugin.enable();
assertPlugin(plugin, PRODUCER_ID, "1.1.0", Plugin.State.ENABLED);
}
public void testUpgradeEnabledPlugin() throws Exception
{
startupPluginCore();
Plugin plugin = manager.install(producer1.toURI());
assertPlugin(plugin, PRODUCER_ID, "1.0.0", Plugin.State.ENABLED);
// upgrading an enabled plugin requires a core restart.
plugin = plugin.upgrade(producer11.toURI());
assertPlugin(plugin, PRODUCER_ID, "1.0.0", Plugin.State.UPGRADING);
// restart the plugin system.
restartPluginCore();
plugin = manager.getPlugin(PRODUCER_ID);
assertPlugin(plugin, PRODUCER_ID, "1.1.0", Plugin.State.ENABLED);
assertEquals(1, manager.equinox.getBundleCount(PRODUCER_ID));
}
public void testMultiplePluginUpgrades() throws Exception
{
startupPluginCore();
Plugin plugin = manager.install(producer1.toURI());
assertPlugin(plugin, PRODUCER_ID, "1.0.0", Plugin.State.ENABLED);
assertEquals(0, paths.getPluginWorkDir().list().length);
plugin = plugin.upgrade(producer11.toURI());
assertPlugin(plugin, PRODUCER_ID, "1.0.0", Plugin.State.UPGRADING);
assertEquals(1, paths.getPluginWorkDir().list().length);
assertTrue(new File(paths.getPluginWorkDir(), producer11.getName()).isFile());
plugin = plugin.upgrade(producer2.toURI());
assertPlugin(plugin, PRODUCER_ID, "1.0.0", Plugin.State.UPGRADING);
assertEquals(1, paths.getPluginWorkDir().list().length);
assertTrue(new File(paths.getPluginWorkDir(), producer2.getName()).isFile());
// restart the plugin system.
restartPluginCore();
plugin = manager.getPlugin(PRODUCER_ID);
assertPlugin(plugin, PRODUCER_ID, "2.0.0", Plugin.State.ENABLED);
assertEquals(0, paths.getPluginWorkDir().list().length);
assertEquals(1, paths.getPluginStorageDir().list().length);
}
public void testManualUpgradeOfEnabledPlugin() throws Exception
{
startupPluginCore();
Plugin plugin = manager.install(producer1.toURI());
assertPlugin(plugin, PRODUCER_ID, "1.0.0", Plugin.State.ENABLED);
shutdownPluginCore();
// manually upgrade the plugin in the plugin store directory.
assertTrue(new File(paths.getPluginStorageDir(), producer1.getName()).delete());
manuallyDeploy(producer11);
startupPluginCore();
plugin = manager.getPlugin(PRODUCER_ID);
assertPlugin(plugin, PRODUCER_ID, "1.1.0", Plugin.State.ENABLED);
assertEquals(1, manager.equinox.getBundleCount(PRODUCER_ID));
}
public void testManualUpgradeWithoutRemovingExisting() throws Exception
{
startupPluginCore();
Plugin plugin = manager.install(producer1.toURI());
assertPlugin(plugin, PRODUCER_ID, "1.0.0", Plugin.State.ENABLED);
shutdownPluginCore();
manuallyDeploy(producer11);
startupPluginCore();
plugin = manager.getPlugin(PRODUCER_ID);
assertPlugin(plugin, PRODUCER_ID, "1.1.0", Plugin.State.ENABLED);
assertEquals(1, manager.equinox.getBundleCount(PRODUCER_ID));
}
public void testManualDowngradeWithoutRemovingExisting() throws Exception
{
startupPluginCore();
Plugin plugin = manager.install(producer11.toURI());
assertPlugin(plugin, PRODUCER_ID, "1.1.0", Plugin.State.ENABLED);
shutdownPluginCore();
manuallyDeploy(producer1);
startupPluginCore();
plugin = manager.getPlugin(PRODUCER_ID);
assertPlugin(plugin, PRODUCER_ID, "1.1.0", Plugin.State.ENABLED);
assertEquals(1, manager.equinox.getBundleCount(PRODUCER_ID));
}
public void testLoadInternalPlugins() throws Exception
{
FileSystemUtils.copy(paths.getInternalPluginStorageDir(), producer1);
startupPluginCore();
assertEquals(1, manager.equinox.getBundleCount(PRODUCER_ID));
}
public void testLoadPrepackagedPlugins() throws Exception
{
FileSystemUtils.copy(paths.getPrepackagedPluginStorageDir(), producer1);
startupPluginCore();
Plugin plugin = manager.getPlugin(PRODUCER_ID);
assertPlugin(plugin, PRODUCER_ID, "1.0.0", Plugin.State.ENABLED);
}
public void testUpgradePrepackagedPlugins() throws Exception
{
FileSystemUtils.copy(paths.getPrepackagedPluginStorageDir(), producer1);
startupPluginCore();
Plugin plugin = manager.getPlugin(PRODUCER_ID);
assertPlugin(plugin, PRODUCER_ID, "1.0.0", Plugin.State.ENABLED);
shutdownPluginCore();
// add upgrade to the prepackaged plugin directory
FileSystemUtils.cleanOutputDir(paths.getPrepackagedPluginStorageDir());
FileSystemUtils.copy(paths.getPrepackagedPluginStorageDir(), producer11);
startupPluginCore();
plugin = manager.getPlugin(PRODUCER_ID);
assertPlugin(plugin, PRODUCER_ID, "1.1.0", Plugin.State.ENABLED);
}
public void testDowngradePrepackagedPlugins() throws Exception
{
FileSystemUtils.copy(paths.getPrepackagedPluginStorageDir(), producer2);
startupPluginCore();
Plugin plugin = manager.getPlugin(PRODUCER_ID);
assertPlugin(plugin, PRODUCER_ID, "2.0.0", Plugin.State.ENABLED);
shutdownPluginCore();
// add downgrade to the prepackaged plugin directory
FileSystemUtils.cleanOutputDir(paths.getPrepackagedPluginStorageDir());
FileSystemUtils.copy(paths.getPrepackagedPluginStorageDir(), producer11);
startupPluginCore();
// plugins do not downgrade
plugin = manager.getPlugin(PRODUCER_ID);
assertPlugin(plugin, PRODUCER_ID, "2.0.0", Plugin.State.ENABLED);
}
public void testDoNotUpgradeUninstalledPrepackagedPlugins() throws Exception
{
startupPluginCore();
Plugin plugin = manager.install(producer1.toURI());
plugin.uninstall();
restartPluginCore();
assertNull(manager.getPlugin(plugin.getId()));
shutdownPluginCore();
FileSystemUtils.copy(paths.getPrepackagedPluginStorageDir(), producer11);
startupPluginCore();
assertNull(manager.getPlugin(PRODUCER_ID));
}
public void testUninstallPlugin() throws Exception
{
startupPluginCore();
Plugin plugin = manager.install(producer1.toURI());
assertEquals(Plugin.State.ENABLED, plugin.getState());
assertEquals("1.0.0", plugin.getVersion().toString());
plugin.uninstall();
assertEquals(Plugin.State.UNINSTALLING, plugin.getState());
restartPluginCore();
plugin = manager.getPlugin(PRODUCER_ID);
assertNull(plugin);
}
public void testUninstallDisabledPlugin() throws Exception
{
startupPluginCore();
Plugin plugin = manager.install(producer1.toURI());
plugin.disable();
restartPluginCore();
plugin = manager.getPlugin(PRODUCER_ID);
assertEquals(Plugin.State.DISABLED, plugin.getState());
plugin.uninstall();
assertNull(manager.getPlugin(plugin.getId()));
restartPluginCore();
plugin = manager.getPlugin(PRODUCER_ID);
assertNull(plugin);
}
/**
* Test for CIB-1630. The problem here is that a plugin exists in the registry as uninstalled, however the
* plugin jar is picked up on a startup scan. The plugin should be re-installed.
*
* A side complication is that it is difficult to distinguish between a plugin that is manually installed and a
* plugin that is uninstalled - but we fail to delete the jar file.
*
* @throws Exception on error
*/
public void testUninstallAndReinstallPlugin() throws Exception
{
startupPluginCore();
Plugin plugin = manager.install(producer1.toURI());
assertEquals(Plugin.State.ENABLED, plugin.getState());
restartPluginCore();
plugin = manager.getPlugin(plugin.getId());
plugin.uninstall();
assertEquals(Plugin.State.UNINSTALLING, plugin.getState());
restartPluginCore();
plugin = manager.getPlugin(PRODUCER_ID);
assertNull(plugin);
shutdownPluginCore();
manuallyDeploy(producer1);
startupPluginCore();
}
public void testReinstallAfterUninstall() throws Exception
{
startupPluginCore();
Plugin plugin = manager.install(producer1.toURI());
assertEquals(Plugin.State.ENABLED, plugin.getState());
plugin.uninstall();
restartPluginCore();
plugin = manager.getPlugin(PRODUCER_ID);
assertNull(plugin);
plugin = manager.install(producer1.toURI());
assertNotNull(plugin);
assertEquals(Plugin.State.ENABLED, plugin.getState());
}
public void testManualUninstall() throws Exception
{
startupPluginCore();
Plugin plugin = manager.install(producer1.toURI());
assertEquals(Plugin.State.ENABLED, plugin.getState());
shutdownPluginCore();
delete(new File(paths.getPluginStorageDir(), producer1.getName()));
startupPluginCore();
plugin = manager.getPlugin(PRODUCER_ID);
assertNull(plugin);
}
public void testUninstalledJarFileDeleted() throws Exception
{
manuallyDeploy(producer1);
assertPluginDeletedOnUninstall(PRODUCER_ID, producer1.getName());
}
public void testUninstallExplodedDirectoryDeleted() throws Exception
{
manuallyDeploy(producer1, true);
assertPluginDeletedOnUninstall(PRODUCER_ID, producer1.getName());
}
private void assertPluginDeletedOnUninstall(String pluginId, String pluginName) throws Exception
{
startupPluginCore();
Plugin plugin = manager.getPlugin(pluginId);
plugin.uninstall();
restartPluginCore();
assertFalse(new File(paths.getPluginStorageDir(), pluginName).exists());
}
public void testDependentPlugins() throws PluginException
{
startupPluginCore();
Plugin producer = manager.install(producer1.toURI());
List<Plugin> dependentPlugins = producer.getDependentPlugins();
assertEquals(0, dependentPlugins.size());
Plugin consumer = manager.install(consumer1.toURI());
dependentPlugins = producer.getDependentPlugins();
assertEquals(1, dependentPlugins.size());
assertEquals(consumer, dependentPlugins.get(0));
}
public void testPluginDependenciesForInstalledPlugins() throws Exception
{
startupPluginCore();
// this differs from the previous in that we install and then restart the plugin manager. This
// better tests the init processing.
Plugin producer = manager.install(producer1.toURI());
Plugin consumer = manager.install(consumer1.toURI());
List<Plugin> dependentPlugins = producer.getDependentPlugins();
assertEquals(1, dependentPlugins.size());
assertEquals(consumer, dependentPlugins.get(0));
restartPluginCore();
// refresh.
producer = manager.getPlugin(producer.getId());
dependentPlugins = producer.getDependentPlugins();
assertEquals(1, dependentPlugins.size());
assertEquals(consumer, dependentPlugins.get(0));
}
public void testPluginDependenciesForDisabledPlugin() throws Exception
{
startupPluginCore();
// this differs from the previous in that we install and then restart the plugin manager. This
// better tests the init processing.
Plugin producer = manager.install(producer1.toURI());
manager.install(consumer1.toURI());
producer.disable();
assertEquals(1, producer.getDependentPlugins().size());
restartPluginCore();
// refresh.
producer = manager.getPlugin(producer.getId());
assertEquals(0, producer.getDependentPlugins().size());
}
public void testPluginDependenciesForUninstallingPlugin() throws Exception
{
startupPluginCore();
// this differs from the previous in that we install and then restart the plugin manager. This
// better tests the init processing.
Plugin producer = manager.install(producer1.toURI());
manager.install(consumer1.toURI());
producer.uninstall();
assertEquals(1, producer.getDependentPlugins().size());
restartPluginCore();
assertNull(manager.getPlugin(producer.getId()));
}
public void testGetRequiredPlugins() throws PluginException
{
startupPluginCore();
Plugin producer = manager.install(producer1.toURI());
Plugin consumer = manager.install(consumer1.toURI());
List<PluginDependency> pluginDependencies = consumer.getRequiredPlugins();
assertEquals(1, pluginDependencies.size());
assertEquals(PRODUCER_ID, pluginDependencies.get(0).getId());
assertEquals("1.0.0", pluginDependencies.get(0).getVersion().toString());
assertEquals(producer, pluginDependencies.get(0).getSupplier());
}
public void testInternalPluginsAreNotRegistered() throws IOException, PluginException
{
FileSystemUtils.copy(paths.getInternalPluginStorageDir(), producer1);
startupPluginCore();
PluginRegistry registry = manager.getPluginRegistry();
assertEquals(0, registry.getRegistrations().size());
assertFalse(registry.isRegistered(PRODUCER_ID));
}
public void testNonInternalPluginsAreRegistered() throws PluginException, IOException
{
manuallyDeploy(producer1);
startupPluginCore();
PluginRegistry registry = manager.getPluginRegistry();
assertEquals(1, registry.getRegistrations().size());
assertTrue(registry.isRegistered(PRODUCER_ID));
}
public void testUninstalledPluginsRetainRegistryEntries() throws Exception
{
manuallyDeploy(producer1);
startupPluginCore();
Plugin plugin = manager.getPlugin(PRODUCER_ID);
plugin.uninstall();
restartPluginCore();
PluginRegistry registry = manager.getPluginRegistry();
assertNull(manager.getPlugin(PRODUCER_ID));
assertNotNull(registry.getEntry(PRODUCER_ID));
}
public void testRegistrySourceEntriesAreRelative() throws PluginException, IOException
{
manuallyDeploy(producer1);
startupPluginCore();
PluginRegistry registry = manager.getPluginRegistry();
assertEquals(producer1.getName(), registry.getEntry(PRODUCER_ID).getSource());
}
public void testRegistryUpgradeSourceEntriesAreRelative() throws Exception
{
manuallyDeploy(producer1);
startupPluginCore();
Plugin plugin = manager.getPlugin(PRODUCER_ID);
plugin.upgrade(producer11.toURI());
PluginRegistry registry = manager.getPluginRegistry();
assertEquals(producer11.getName(), registry.getEntry(PRODUCER_ID).getUpgradeSource());
}
public void testAbsoluteSourceEntrySupportedForBackwardCompatibility() throws Exception
{
// setup the registry.
PluginRegistry registry = new PluginRegistry(paths.getPluginRegistryDir());
PluginRegistryEntry entry = registry.register(PRODUCER_ID);
entry.setSource(new File(paths.getPluginStorageDir(), producer1.getName()).toURI().toString());
entry.setMode(PluginRegistryEntry.Mode.DISABLE);
registry.flush();
manuallyDeploy(producer1);
startupPluginCore();
// check that things are as expected.
Plugin plugin = manager.getPlugin(PRODUCER_ID);
assertEquals(Plugin.State.DISABLED, plugin.getState());
}
private void manuallyDeploy(File plugin) throws IOException
{
manuallyDeploy(plugin, false);
}
private void manuallyDeploy(File plugin, boolean expanded) throws IOException
{
if (expanded)
{
File base = new File(paths.getPluginStorageDir(), plugin.getName());
assertTrue(base.mkdirs());
ZipUtils.extractZip(new ZipInputStream(new FileInputStream(plugin)), base);
}
else
{
FileSystemUtils.copy(paths.getPluginStorageDir(), plugin);
}
}
public void testDependencyCheckMessagesOnInstall() throws PluginException
{
startupPluginCore();
Plugin consumer = manager.install(consumer1.toURI());
assertEquals("Failed to resolve bundle dependencies.", consumer.getErrorMessages().get(0));
assertEquals(Plugin.State.ERROR, consumer.getState());
}
public void testDependencyCheckMessagesOnStartup() throws PluginException, IOException
{
manuallyDeploy(consumer1);
startupPluginCore();
Plugin consumer = manager.getPlugin("com.zutubi.bundles.consumer");
assertEquals("Failed to resolve bundle.", consumer.getErrorMessages().get(0));
assertEquals(Plugin.State.ERROR, consumer.getState());
}
public void testInstallingZeroLengthJarFile() throws Exception
{
startupPluginCore();
try
{
manager.install(bad.toURI());
fail();
}
catch (PluginException e)
{
// exception expected. Not sure if this is the best response to this type of error.
}
// ensure that it is not left behind.
File storage = paths.getPluginStorageDir();
assertEquals(0, storage.list().length);
}
public void testPluginThatFailsOnStartup() throws PluginException
{
startupPluginCore();
Plugin plugin = manager.install(failonstartup.toURI());
assertEquals(Plugin.State.ERROR, plugin.getState());
assertTrue(plugin.getErrorMessages().size() > 0);
}
public void testPluginThatFailsOnStartup_ManualInstall() throws IOException, PluginException
{
manuallyDeploy(failonstartup);
startupPluginCore();
Plugin plugin = manager.getPlugin("com.zutubi.bundles.error.ErrorOnStartup");
assertEquals(Plugin.State.ERROR, plugin.getState());
assertTrue(plugin.getErrorMessages().size() > 0);
}
public void testPluginThatFailsOnStartupWillRetryStartupOnNextSystemStartup() throws Exception
{
File pluginFile = new File(tmpDir, "com.zutubi.bundles.onstartup_1.0.0.jar");
Files.copy(getInputFile("com.zutubi.bundles.onstartup_1.0.0_fails", EXTENSION_JAR), pluginFile);
manuallyDeploy(pluginFile);
startupPluginCore();
Plugin plugin = manager.getPlugin("com.zutubi.bundles.onstartup");
assertEquals(Plugin.State.ERROR, plugin.getState());
shutdownPluginCore();
delete(pluginFile);
Files.copy(getInputFile("com.zutubi.bundles.onstartup_1.0.0_succeeds", EXTENSION_JAR), pluginFile);
manuallyDeploy(pluginFile);
startupPluginCore();
plugin = manager.getPlugin("com.zutubi.bundles.onstartup");
assertEquals(Plugin.State.ENABLED, plugin.getState());
}
public void testPluginThatFailsOnShutdown() throws Exception
{
startupPluginCore();
Plugin plugin = manager.install(failonshutdown.toURI());
assertEquals(Plugin.State.ENABLED, plugin.getState());
shutdownPluginCore();
}
public void testPluginThatFailsOnDisable() throws Exception
{
startupPluginCore();
Plugin plugin = manager.install(failonshutdown.toURI());
assertEquals(Plugin.State.ENABLED, plugin.getState());
plugin.disable();
restartPluginCore();
plugin = manager.getPlugin("com.zutubi.bundles.error.ErrorOnShutdown");
assertEquals(Plugin.State.DISABLED, plugin.getState());
}
public void testPrepackageExpandedDirectoryPlugin() throws IOException, PluginException
{
// deploy an expanded version of the plugin.
File base = new File(paths.getPrepackagedPluginStorageDir(), producer1.getName());
assertTrue(base.mkdirs());
ZipUtils.extractZip(new ZipInputStream(new FileInputStream(producer1)), base);
startupPluginCore();
Plugin plugin = manager.getPlugin(PRODUCER_ID);
assertPlugin(plugin, PRODUCER_ID, "1.0.0", Plugin.State.ENABLED);
}
// CIB-2377
public void testPrepackagedFileCollisionOnStartup() throws IOException, PluginException
{
FileSystemUtils.copy(paths.getPrepackagedPluginStorageDir(), producer1);
manuallyDeploy(producer1);
startupPluginCore();
Plugin plugin = manager.getPlugin(PRODUCER_ID);
assertPlugin(plugin, PRODUCER_ID, "1.0.0", Plugin.State.ENABLED);
}
private void assertPlugin(Plugin plugin, String expectedId, String expectedVersion, Plugin.State expectedState)
{
assertNotNull(plugin);
assertEquals(expectedId, plugin.getId());
assertEquals(expectedVersion, plugin.getVersion().toString());
assertEquals(expectedState, plugin.getState());
}
private void assertNoInstalledJars()
{
assertEquals(0, paths.getPluginStorageDir().list().length);
}
}
|
3e02863e3bd308b2eedaf88b9c91195316353426 | 1,002 | java | Java | src/main/java/com/israel/upload_csv_spring/FileUploadExceptionAdvice.java | a4s-ufpb/inovaturpb_database_loader | 4943797bbd414b99deaca1922545982f49d0a1c2 | [
"MIT"
]
| null | null | null | src/main/java/com/israel/upload_csv_spring/FileUploadExceptionAdvice.java | a4s-ufpb/inovaturpb_database_loader | 4943797bbd414b99deaca1922545982f49d0a1c2 | [
"MIT"
]
| null | null | null | src/main/java/com/israel/upload_csv_spring/FileUploadExceptionAdvice.java | a4s-ufpb/inovaturpb_database_loader | 4943797bbd414b99deaca1922545982f49d0a1c2 | [
"MIT"
]
| null | null | null | 43.565217 | 118 | 0.850299 | 1,032 | package com.israel.upload_csv_spring;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.multipart.MaxUploadSizeExceededException;
import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;
//Classe responsável por tratar a exceção que surge quando alguém tenta
//fazer upload do arquivo de tamanho maior que o valor configurado
//no arquivo application.properties.
@ControllerAdvice
public class FileUploadExceptionAdvice extends ResponseEntityExceptionHandler {
@SuppressWarnings("rawtypes")
@ExceptionHandler(MaxUploadSizeExceededException.class)
public ResponseEntity handleMaxSizeException(MaxUploadSizeExceededException exc) {
return ResponseEntity.status(HttpStatus.EXPECTATION_FAILED).body(new ResponseMessage("Arquivo muito grande!",""));
}
}
|
3e0286bdb305da4c2b5be33b8c1b246f062f708d | 7,094 | java | Java | src/main/java/io/github/mericgit/cobalt/Note.java | MericGit/Cobalt | 32adf08c908f8383be4afacd6e5d9bb6679e5bc8 | [
"MIT"
]
| null | null | null | src/main/java/io/github/mericgit/cobalt/Note.java | MericGit/Cobalt | 32adf08c908f8383be4afacd6e5d9bb6679e5bc8 | [
"MIT"
]
| 3 | 2021-09-29T14:24:13.000Z | 2022-03-01T05:44:55.000Z | src/main/java/io/github/mericgit/cobalt/Note.java | MericGit/Cobalt | 32adf08c908f8383be4afacd6e5d9bb6679e5bc8 | [
"MIT"
]
| null | null | null | 27.496124 | 172 | 0.491119 | 1,033 | package io.github.mericgit.cobalt;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
public class Note {
private long tick;
private int key;
private int velocity;
private int bank;
private long mcTick;
private String sample;
private float freq;
private int channel;
private static float timeConv;
private static String targetSample;
private float dataF1;
private float duration;
private static final HashMap<String, int[]> rrPool =new HashMap<String, int[]>();
public Note(long tick, int key, int velocity, int bank, long mcTick, String sample, float freq, int channel,float duration, float dataF1) {
this.tick = tick;
this.mcTick = mcTick;
this.key = key;
this.velocity = velocity;
this.bank = bank;
this.sample = sample;
this.freq = freq;
this.channel = channel;
this.dataF1 = dataF1;
}
public static String percMap(Note note) {
String temp = "block.note_block.";
return temp + switch (note.getKey()) {
case 35 -> "acoustic_bass_drum";
case 36 -> "bass_drum_1";
case 37 -> "side_stick";
case 38 -> "acoustic_snare";
case 39 -> "hand_clap";
case 40 -> "electric_snare";
case 41 -> "low_floor_tom";
case 42 -> "closed_hi_hat";
case 43 -> "high_floor_tom";
case 44 -> "pedal_hi_hat";
case 45 -> "low_tom";
case 46 -> "open_hi_hat";
case 47 -> "low_mid_tom";
case 48 -> "hi_mid_tom";
case 49 -> "crash_cymbal_1";
case 50 -> "high_tom";
case 51 -> "ride_cymbal_1";
case 52 -> "chinese_cymbal";
case 53 -> "ride_bell";
case 54 -> "tambourine";
case 55 -> "splash_cymbal";
case 56 -> "cowbell";
case 57 -> "crash_cymbal_2";
case 58 -> "vibraslap";
case 59 -> "ride_cymbal_2";
case 60 -> "high_bongo";
case 61 -> "low_bongo";
case 62 -> "mute_high_conga";
case 63 -> "open_high_conga";
case 64 -> "low_conga";
case 65 -> "high_timbale";
case 66 -> "low_timbale";
case 67 -> "high_agogo";
case 68 -> "low_agogo";
case 69 -> "cabasa";
case 70 -> "maracas";
case 71 -> "short_whistle";
case 72 -> "long_whistle";
case 73 -> "short_guiro";
case 74 -> "long_guiro";
case 75 -> "claves";
case 76 -> "high_wood_block";
case 77 -> "low_wood_block";
case 78 -> "mute_cuica";
case 79 -> "open_cuica";
case 80 -> "mute_triangle";
case 81 -> "open_triangle";
default -> "unexpected";
};
}
public static String advSample2(Note note) {
String temp = "block.note_block." + note.getSample() + "_";
if (note.getKey() <= 24) {
return temp + "01";
}
else if (note.getKey() <= 31) {
return temp + "02";
}
else if (note.getKey() <= 38) {
return temp + "03";
}
else if (note.getKey() <= 45) {
return temp + "04";
}
else if (note.getKey() <= 52) {
return temp + "05";
}
else if (note.getKey() <= 59) {
return temp + "06";
}
else if (note.getKey() <= 66) {
return temp + "07";
}
else if (note.getKey() <= 73) {
return temp + "08";
}
else if (note.getKey() <= 80) {
return temp + "09";
}
else if (note.getKey() <= 87) {
return temp + "10";
}
else if (note.getKey() <= 94) {
return temp + "11";
}
else if (note.getKey() <= 101) {
return temp + "12";
}
else if (note.getKey() <=108) {
return temp + "13";
}
return temp + "01";
}
public static float advFreq(Note note) {
int interval = 0;
for (int i = 0; i < 12; i++) {
if (note.getKey() - (24 + 7*i) <= 0) {
interval = i;
break;
}
}
int root = 24 + interval * 7;
return (float) Math.pow(2,((double) (-1 * (root - note.getKey())) / 12));
}
public static ArrayList<Note> calcArtic(ArrayList<Note> soundProcess) {
for (int i = 0; i < soundProcess.size(); i++) {
float duration = soundProcess.get(i).getDuration();
if (duration < 220 && soundProcess.get(i).getDataF1() == 0 && soundProcess.get(i).getVelocity() != 0) {
soundProcess.get(i).setSample(soundProcess.get(i).getSample().substring(0,soundProcess.get(i).getSample().lastIndexOf("_")).replaceFirst("_sus_","_stac_"));
}
}
return soundProcess;
}
@Override
public String toString() {
return "Note{" +
"tick=" + tick +
", key=" + key +
", velocity=" + velocity +
", bank=" + bank +
", mcTick=" + mcTick +
", sample='" + sample + '\'' +
", freq=" + freq +
", channel=" + channel +
", duration=" + duration +
", dataF1=" + dataF1 +
'}' + "\n";
}
public static String getTargetSample() {
return targetSample;
}
public static void setTargetSample(String t) {
targetSample = t;
}
public int getChannel() {
return channel;
}
public void setChannel(int channel) {
this.channel = channel;
}
public long getTick() {
return tick;
}
public void setTick(int tick) {
this.tick = tick;
}
public int getKey() {
return key;
}
public void setKey(int key) {
this.key = key;
}
public int getVelocity() {
return velocity;
}
public void setVelocity(int velocity) {
this.velocity = velocity;
}
public int getBank() {
return bank;
}
public void setBank(int bank) {
this.bank = bank;
}
public long getMcTick() {
return mcTick;
}
public void setMcTick(long mcTick) {
this.mcTick = mcTick;
}
public String getSample() {
return sample;
}
public void setSample(String sample) {
this.sample = sample;
}
public float getFreq() {
return freq;
}
public float getDataF1() {
return dataF1;
}
public float getDuration() {
return duration;
}
public void setDuration(float duration) {
this.duration = duration;
}
public void setDataF1(int dataF1) {
this.dataF1 = dataF1;
}
public void setFreq(float freq) {
this.freq = freq;
}
}
|
3e02880196115442b440ecf0cd2776f31441ac2c | 78,326 | java | Java | src/main/java/org/teherba/xtrans/proglang/ProgLangTransformer.java | gfis/xtrans | 95dce33e3241ca46ad95df7b86afe2297106f80d | [
"Apache-2.0"
]
| null | null | null | src/main/java/org/teherba/xtrans/proglang/ProgLangTransformer.java | gfis/xtrans | 95dce33e3241ca46ad95df7b86afe2297106f80d | [
"Apache-2.0"
]
| null | null | null | src/main/java/org/teherba/xtrans/proglang/ProgLangTransformer.java | gfis/xtrans | 95dce33e3241ca46ad95df7b86afe2297106f80d | [
"Apache-2.0"
]
| null | null | null | 44.911697 | 131 | 0.518589 | 1,034 | /* Abstract base class for all programming language transformers
@(#) $Id: ProgLangTransformer.java 801 2011-09-12 06:16:01Z gfis $
2017-05-28: javadoc 1.8
2010-06-16: tokenStack (successor of tagStack)
2010-06-09: collapse string and comment tags to one with mode attribute; se and ee
2010-06-05: stra > sta, str > stq, strb > stb, sem > op
2009-12-22: treat ( [ { parentheses as operators because of possible nesting errors
2009-12-16: toUpperCase ids, keywords/verbs if caseIndependant; forceUpperCase; (G+R married 10 years ago)
2008-09-22: 'testWord' had reverse condition
2008-01-23: restructured, processLine isolated
2007-12-04: copied from program/ProgramTransformer -> generalized scanner
2007-10-29, Georg Fischer: extracted from JavaTransformer
*/
/*
* Copyright 2006 Dr. Georg Fischer <punctum at punctum dot kom>
*
* 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.teherba.xtrans.proglang;
import org.teherba.xtrans.CharTransformer;
import org.teherba.xtrans.NestedLineReader;
import org.teherba.xtrans.parse.Token;
import java.io.BufferedReader;
import java.util.HashSet;
import java.util.Stack;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.xml.sax.Attributes;
import org.xml.sax.helpers.AttributesImpl;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
/** Abstract transformer for various programming languages.
* This implementation works mainly unaltered for C and Java languages,
* but it is also prepared for more column oriented languages like Cobol or Fortran.
* <p>
* The following XML elements are generated:
* <ul>
* <li><nl y="0"> -
* For the precise location of all source language elements,
* there is a newline element at the <em>beginning</em> of each line,
* with the line number ("y") starting at 0.
* All other elements have an "sp" attribute for the number of spaces <em>before</em> the element.
* Closing parentheses are prefixed by a dummy <sp/> element which indicates the
* preceeding number of spaces.
* Tabs outside of strings are (not yet) expanded according to the "tab" option setting.
* </li>
* <li><kw/> - language keywords, reserved words</li>
* <li><vb/> - verbs = language keywords which start a statement (e.g. in Cobol)</li>
* <li><id/> - identifiers, type names etc.</li>
* <li><num/> - decimal numbers</li>
* <li><op/> - operators like ">>=", "++"</li>
* <li><cmt> - normal comment starting with slash asterisk</li>
* <li><lec> - line end comment starting with slash slash</li>
* <li><doc> - documentation comment starting with slash asterisk asterisk</li>
* <li><curl> - nesting with curly brackets "{ }"</li>
* <li><sqr> - nesting with square brackets "[ ]"</li>
* <li><rnd> - nesting with round brackets "( )"</li>
* <li><concat> - string concatenation (for continued string values in Cobol)
* <li><chr/> - single character denotation, either
* <ul>
* <li>printable in "p" attribute</li>
* <li>control (backslash escaped) "b" attribute</li>
* <li>code in "h" attribute (up to 2 hex digits)</li>
* <li>code in "u" attribute (up to 4 hex digits)</li>
* </ul>
* <li>
* <li><str> - string of characters which were enclosed in quotes,
* with entities replaced for XML</li>
* <li>... some more elements which are described in the *_TAG constants</li>
* </ul>
* The representations of the comment and parentheses delimiter strings
* are set appropriately for each programming language. Also, the behaviour of
* quoting, lower/uppercase relevance, inner quotes, left and right margins
* is set individually for each language. All heavy-weight analysis is done
* in this class, while the language specific classes should only configure it
* and handle special exceptions.
* @author Dr. Georg Fischer
*/
public abstract class ProgLangTransformer extends CharTransformer {
public final static String CVSID = "@(#) $Id: ProgLangTransformer.java 801 2011-09-12 06:16:01Z gfis $";
/** log4j logger (category) */
private Logger log;
/** Root element tag */
public static final String ROOT_TAG = "program";
/** Begin of program tag (for {@link TokenTransformer} */
public static final String START_ELEMENT = "se";
/** End of program tag (for {@link TokenTransformer}) */
public static final String END_ELEMENT = "ee";
/** Tag for character content (for {@link TokenTransformer}), max length 64, multiple if longer, no tabs or line breaks */
public static final String CHARACTERS = "ca";
/** Backslash Newline element tag */
public static final String BACKSLASH_NL_TAG = "bnl";
/** Character element tag for single character denotation with "b", "h", "p" or "u" attribute */
public static final String CHAR_TAG = "chr";
/** Normal Comment element tag for C comment starting with slash asterisk (with {@link #MODE_ATTR} = cm, dc, le) */
public static final String COMMENT_TAG = "cmt";
/** String concatenation operator (for continued string values in Cobol) */
public static final String CONCAT_TAG = "concat";
/** Identifier element tag for identifiers, type names etc.*/
public static final String IDENTIFIER_TAG = "id";
/** Keyword element tag for language keywords, reserved words (eventually with {@link #MODE_ATTR}={@link #VERB_MODE})*/
public static final String KEYWORD_TAG = "kw";
/** Label element tag */
public static final String LABEL_TAG = "lab";
/* Newline element tag */
// public static final String NEWLINE_TAG = "n";
/** Element indicating that the current line will be continued with the following line */
public static final String NEXT_CONTINUE_TAG = "nc";
/** Element indicating that the current line is a continuation of the previous line */
public static final String PREV_CONTINUE_TAG = "pc";
/** Number element tag for simple decimal numbers (without fractions) */
public static final String NUMBER_TAG = "num";
/** Operator element tag for operators like ">>=", "++" etc. */
public static final String OPERATOR_TAG = "op";
/** Preprocessor or pragma instruction element tag */
public static final String PRAGMA_TAG = "pragma";
/* The following 3 are not used because of possible nesting errors
-** Curly bracket "{" element tag *-
public static final String CURLY_TAG = "curl";
-** Round bracket "(" element tag *-
public static final String ROUND_TAG = "rnd";
-** Square bracket "[" element tag *-
public static final String SQUARE_TAG = "sqr";
*/
/** Statement terminator tag */
public static final String SEMI_TAG = "sem";
/** Generalized string element tag (with {@link #MODE_ATTR} = ap, bt, dq) */
public static final String STRING_TAG = "str";
/** Tag for whitespace (with {@link #MODE_ATTR} = newline/nl, prefix/pr, postfix/po, spaces/sp, tabs/tb) */
public static final String WHITESPACE_TAG = "ws" ;
/** name for mode attribute */
public static final String MODE_ATTR = "m";
/** name for line number attribute */
public static final String LINE_NO_ATTR = "n"; // offset from top
/** name for prefix attribute */
public static final String PRE_ATTR = "l"; // left margin text
/** name for postfix attribute */
public static final String POST_ATTR = "r"; // right margin text
/** name for space attribute */
public static final String SP_ATTR = "s";
/** name for value attribute */
public static final String VAL_ATTR = "v";
/** value for the mode attribute of a single (apostrophe) quoted string */
public static final String ASTRING_MODE = "ap";
/** value for the mode attribute of a backticks quoted string */
public static final String BSTRING_MODE = "bt";
/** value for the mode attribute of a double quoted string */
public static final String DSTRING_MODE = "dq";
/** value of the mode attribute for a normal comment starting with slash asterisk */
public static final String COMMENT_MODE = "cm";
/** value of the mode attribute for a documentation comment starting with slash asterisk asterisk*/
public static final String DOCUMENT_MODE = "dc";
/** value of the mode attribute for a line end comment starting with slash slash */
public static final String LINE_END_MODE = "le";
/** value for the mode attribute of newline whitespace */
public static final String NEWLINE_MODE = "nl";
/** value for the mode attribute of line prefixes */
public static final String PREFIX_MODE = "pr";
/** value for the mode attribute of line postfixes */
public static final String POSTFIX_MODE = "po";
/** value for the mode attribute of spaces */
public static final String SPACE_MODE = "sp";
/** value for the mode attribute of tabs */
public static final String TAB_MODE = "tb";
/** value of the mode attribute of language keywords which start a statement (e.g. in Cobol) */
public static final String VERB_MODE = "vb";
/** string for start of comment */
protected static final String COMMENT_START = "/*";
/** string for start of comment (Pascal) */
protected static final String PAS_COMMENT_START = "{";
/** string for start of comment (Pascal) */
protected static final String PAS_COMMENT2_START= "(*";
/** string for start of preprocessor instruction */
protected static final String PRAGMA_START = "#"; // for C
/** string for end of comment */
protected static final String COMMENT_END = "*/";
/** string for end of comment (Pascal) */
protected static final String PAS_COMMENT_END = "}";
/** string for end of document comment */
protected static final String DOCUMENT_START = "/*";
/** string for end of document comment */
protected static final String DOCUMENT_END = "*/";
/** string for end of comment (Pascal) */
protected static final String PAS_COMMENT2_END = "*)";
/** string for end of line comment */
protected String lineEndComment;
/** string for end of preprocessor instruction */
protected static final String PRAGMA_END = "";
/** matching end of current comment opening mark */
protected String endComment; // "*/" for C, "*)" or "}" for Pascal
/** matching end of current string opening mark */
protected String endQuote; // quote, apostrophe, backtick
/** alternative quote in string */
protected String altQuote; // apostrophe for quote and vice versa
/** code for unlimited line length */
protected static final int HIGH_COLUMN = 0x7fffff;
/** code for current programming language */
protected int language;
// enumerations for 'language' in alphabetical order, codes in implementation order
/** code for C language */
protected static final int LANG_C = 5;
/** code for Cobol language */
protected static final int LANG_COBOL = 11;
/** code for C++ language */
protected static final int LANG_CPP = 6;
/** code for the Cascaded Style Sheet language */
protected static final int LANG_CSS = 8;
/** code for Java language */
protected static final int LANG_JAVA = 1;
/** code for JavaScript language */
protected static final int LANG_JS = 4;
/** code for Pascal language */
protected static final int LANG_PASCAL = 7;
/** code for Perl language */
protected static final int LANG_PERL = 12;
/** code for PL/1 language */
protected static final int LANG_PL1 = 2;
/** code for REXX language */
protected static final int LANG_REXX = 3;
/** code for Ruby language */
protected static final int LANG_RUBY = 13;
/** code for SQL language */
protected static final int LANG_SQL = 9;
/** code for unspecified language */
protected static final int LANG_UNDEF = 0;
/** code for VisualBasic language */
protected static final int LANG_VBA = 10;
/** Gets the language.
* @return language code
*/
protected int getLanguage() {
return language;
} // getLanguage
/** Sets the language.
* @param language language code
*/
protected void setLanguage(int language) {
this.language = language;
} // setLanguage
// features of a language which cannot be static final here, but which are fixed per language
/** Minimum column for source lines, end of prefix */
protected int minColumn;
/** Maximum column for source lines, start of postfix or line number field */
protected int maxColumn;
/** whether letter case is irrelevant for identifiers, keywords and verbs in this language */
protected boolean caseIndependant;
/** whether identifiers, keywords, verbs are forced to uppercase (if <em>caseIndependant</em>) */
protected boolean forceUpperCase;
/** whether strings with apostrophes and with quotes are allowed */
protected boolean bothStringTypes;
/** whether inner string delimiters must be duplicated */
protected boolean doubleInnerApos;
/** whether the language uses Pascal's comment conventions */
protected boolean pascalComments;
/** language code denoting the convention for character escapes */
protected int escapeCode;
/** No-args Constructor.
* This should be as lightweight as possible.
*/
public ProgLangTransformer() {
super();
// the following apply to the generator AND the serializer
minColumn = 0; // first column of source line
maxColumn = HIGH_COLUMN; // quasi infinite
bothStringTypes = false;
caseIndependant = false;
doubleInnerApos = false;
pascalComments = false;
lineEndComment = "//";
escapeCode = LANG_JAVA;
nextContinue = null;
prevContinue = null;
setLanguage(LANG_UNDEF);
} // Constructor
/** Initializes the (quasi-constant) global structures and variables.
* This method is called by the {@link org.teherba.xtrans.XtransFactory} once for the
* selected generator and serializer.
*/
public void initialize() {
super.initialize();
log = LogManager.getLogger(ProgLangTransformer.class.getName());
// log.error("ProgLangTransformer.initialize() was called");
} // initialize
//////////////////////
// SAX event generator
//////////////////////
/** List of keywords in this language. */
protected String[] keywords;
/** List of all reserved or otherwise special words of the language */
protected HashSet<String> words;
/** List of keyverbs in this language. Verbs will typically start a statement (for example in COBOL) */
protected String[] keyverbs;
/** List of all reserved or otherwise special verbs of the language */
protected HashSet<String> verbs;
/** Stores the special words of the language in a hash set.
*/
protected void storeWords() {
words = new HashSet<String>(keywords.length);
for (int ikey = 1; ikey < keywords.length; ikey ++) { // skip over 1st element
if (caseIndependant) {
words.add(keywords[ikey].toUpperCase());
} else {
words.add(keywords[ikey].replaceAll("_", "_"));
}
} // for ikey
} // storeWords
/** Tests whether an identifier is a keyword of the language
* @param id identifier to be tested
* @return whether the identifier is a keyword of the language
*/
protected boolean testWord(String id) {
return words.contains(caseIndependant
? id.toUpperCase()
: id);
} // testWord
/** Stores the special verbs of the language in a hash set.
*/
protected void storeVerbs() {
verbs = new HashSet<String>(keyverbs.length);
for (int ikey = 1; ikey < keyverbs.length; ikey ++) { // skip over 1st element
if (caseIndependant) {
verbs.add(keyverbs[ikey].toUpperCase());
} else {
verbs.add(keyverbs[ikey].replaceAll("_", "_"));
}
} // for ikey
} // storeVerbs
/** Tests whether an identifier is a verb of the language
* @param id identifier to be tested
* @return whether the identifier is a verb of the language
*/
protected boolean testVerb(String id) {
return verbs.contains(caseIndependant
? id.toUpperCase()
: id);
} // testVerb
/** gets the left source margin
* @return minimum column number (0 based) for source program text
*/
protected int getMinColumn() {
return minColumn;
} // getMinColumn
/** Sets the left source margin
* @param minColumn minimum column number (0 based) for source program text
*/
protected void setMinColumn(int minColumn) {
this.minColumn = minColumn;
} // setMinColumn
/** Gets the right source margin
* @return maximum column number (0 based) for source program text
*/
protected int getMaxColumn() {
return maxColumn;
} // getMaxColumn
/** Sets the right source margin
* @param maxColumn maximum column number (0 based) for source program text
*/
protected void setMaxColumn(int maxColumn) {
this.maxColumn = maxColumn;
} // setMaxColumn
/** state after an apostrophe */
protected static final int IN_APOS = 1;
/** state after a backslash */
protected static final int IN_BACKSLASH = 2;
/** state during a multi-line comment */
protected static final int IN_COMMENT = 3;
/** state during a multi-line Pascal comment */
protected static final int IN_PAS_COMMENT = 4;
/** state in an identifier */
protected static final int IN_IDENTIFIER = 5;
/** state in a number (sequence of digits) */
protected static final int IN_NUMBER = 6;
/** state in a string */
protected static final int IN_QUOTE = 7;
/** state in a string */
protected static final int IN_SINGLE_QUOTE = 8;
/** common starting state */
protected static final int IN_TEXT = 9;
/** state after first tab */
protected static final int IN_TABS = 10;
/** state after a "<" */
protected static final int IN_ANGLE = 11;
/** number of spaces before an element */
protected int spaceCount;
/** number of successive tab stops (for SP_TAG, spaces come before tabs) */
protected int tabCount;
/** common number of spaces before a continued comment line */
protected String commentIndent;
/** String which indicates that the following line will continue the current line */
protected String nextContinue;
/** String which indicates that the current line will continue the previous line */
protected String prevContinue;
/** stack of tokens */
protected Stack<Token> tokenStack;
/** Starts a nested element from a {@link Token}
* @param token the token for the element's start
*/
protected void pushToken(Token token) {
tokenStack.push(token);
} // pushToken
/** Ends a nested Token element
* @return closing token
*/
protected Token popToken() {
Token result = null;
if (! tokenStack.isEmpty()) {
result = (Token) tokenStack.pop();
} else {
fireComment("stack underflow error");
}
return result;
} // popToken
/** Determines the token in the stack's top element
* @return top token
*/
protected Token topToken() {
Token result = null;
if (! tokenStack.isEmpty()) {
result = (Token) tokenStack.peek();
}
return result;
} // topToken
/** Starts a nested XML element with attributes,
* and remembers the first attribute value also on the stack
* @param tag the element's tag
* @param attrList array of (name,value) pairs for attributes
*/
protected void pushXML2(String tag, String [] attrList) {
tagStack.push(tag + "," + attrList[1]);
fireStartElement(tag, toAttributes(attrList));
} // pushXML2
/** Ends a nested XML element,
* and cares for stack elements which contain an additional attribute value
*/
protected void popXML2() {
if (! tagStack.isEmpty()) {
String[] top = ((String) tagStack.pop()).split(",");
fireEndElement(top[0]);
} else {
fireComment("stack underflow error");
}
} // popXML2
/** Determines the tag in the stack's top element,
* including an additional attribute value
* @return top token
*/
protected String topXML2() {
String result = "";
if (! tagStack.isEmpty()) {
result = (String) tagStack.peek();
}
return result;
} // topXML2
/** Matches all elements starting with "\'": character denotations, maybe escaped.
* @param line input line containing the character
* @param linePos position where the character denotation starts
* @param trap position behind the end of the line
* @return position behind the element, - 1
*/
protected int matchCharacter(String line, int linePos, int trap) {
int pos2 = linePos + 1; // position behind the element just recognized
char ch = ' ';
Matcher matcher = characterPattern.matcher(line.substring(linePos));
if (matcher.lookingAt()) {
pos2 = linePos + matcher.end(); // because substring was matched
String chars = line.substring(linePos, pos2);
if (false) {
} else if (chars.startsWith("\'\\u")) {
chars = "&#x" + chars.substring(3, 7) + ";";
} else if (chars.startsWith("\'\\x")) {
chars = "&#x" + chars.substring(3, 5) + ";";
} else if (chars.startsWith("\'\\")) {
if (chars.length() == 3) { // single backslash
chars = chars.substring(1, 2);
} else {
ch = chars.charAt(2);
switch (ch) {
case 'b' : chars = "\\b"; break;
case 'f' : chars = "\\f"; break;
case 'n' : chars = "\\n"; break;
case 'r' : chars = "\\r"; break;
case 't' : chars = "\\t"; break;
default : chars = chars.substring(2, 3); break;
} // switch ch
ch = chars.charAt(0);
}
} else { // unescaped
chars = chars.substring(1, 2);
}
fireEmptyElement(CHAR_TAG, spaceAndValAttr(chars));
} else {
log.error("ProgLangTransformer: invalid character denotation in line " + (lineNo + 1)
+ " at column " + (linePos + 1) + ": " + line.substring(linePos));
}
return pos2 - 1; // 1 before the end
} // matchCharacter
/** Matches identifiers and keywords starting with a letter.
* @param line input line containing the letter
* @param linePos position where the letter was found
* @param trap position behind the end of the line
* @return position behind the element, - 1
*/
protected int matchIdentifier(String line, int linePos, int trap) {
int pos2 = linePos + 1; // position behind the element just recognized
Matcher matcher = identifierPattern.matcher(line.substring(linePos));
if (matcher.lookingAt()) {
pos2 = linePos + matcher.end();
String id = line.substring(linePos, pos2);
if (forceUpperCase && caseIndependant) {
id = id.toUpperCase();
}
if (false) {
/*
} else if (testVerb(id)) { // key verb of the language
fireEmptyElement(VERB_TAG , spaceAndValAttr(id));
*/
} else if (testWord(id)) { // other keyword of the language
fireEmptyElement(KEYWORD_TAG , spaceAndValAttr(id));
} else { // normal identifier
fireEmptyElement(IDENTIFIER_TAG, spaceAndValAttr(id));
}
} else {
log.error("unmatched identifier in line " + (lineNo + 1)
+ " at column " + (linePos + 1) + ": " + line.substring(linePos));
}
return pos2 - 1; // 1 before the end
} // matchIdentifier
/** Matches numbers starting with a digit.
* @param line input line containing the digit
* @param linePos position where the digit was found
* @param trap position behind the end of the line
* @return position behind the element, - 1
*/
protected int matchNumber(String line, int linePos, int trap) {
int pos2 = linePos + 1; // position behind the element just recognized
Matcher matcher = numberPattern.matcher(line.substring(linePos));
if (matcher.lookingAt()) {
pos2 = linePos + matcher.end();
String number = line.substring(linePos, pos2);
fireEmptyElement(NUMBER_TAG, spaceAndValAttr(number));
} else {
log.error("unmatched number in line " + (lineNo + 1)
+ " at column " + (linePos + 1) + ": " + line.substring(linePos));
}
return pos2 - 1; // 1 before the end
} // matchNumber
/** Matches all punctuation and operator elements apart from parentheses, ";", "," and ".".
* @param line input line containing the start of the operator at position <em>linePos</em>
* @param linePos position where the operator starts
* @param trap position behind the end of the line
* @return position behind the element, - 1
*/
protected int matchOperator(String line, int linePos, int trap) {
int pos2 = linePos + 1; // position behind the element just recognized
Matcher matcher = operatorPattern.matcher(line.substring(linePos));
if (matcher.lookingAt()) {
pos2 = linePos + matcher.end();
fireEmptyElement(OPERATOR_TAG, spaceAndValAttr(line.substring(linePos, pos2)));
} else {
log.error("unknown operator in line " + (lineNo + 1)
+ " at column " + (linePos + 1) + ": " + line.substring(linePos));
}
return pos2 - 1; // 1 before the end
} // matchOperator
/** Matches all elements starting with "/": comments or "/=".
* @param line input line containing "/" at position <em>linePos</em>
* @param linePos position where "/" was found
* @param trap position behind the end of the line
* @return position behind the matched element, - 1
*/
protected int matchSlash(String line, int linePos, int trap) {
int pos1 = linePos + 1; // the position where this element's content starts
int pos2 = pos1; // position behind the element just recognized
if (false) {
} else if (line.startsWith(DOCUMENT_START, linePos)
&& line.length() > linePos + DOCUMENT_START.length()
&& ! line.startsWith(COMMENT_END, linePos + DOCUMENT_START.length() - 1)
) { // document comment and not /**/
pos1 = linePos + DOCUMENT_START.length();
pos2 = line.indexOf(DOCUMENT_END, pos2);
if (pos2 >= pos1) { // closing comment on same line
fireStartElement(COMMENT_TAG, spaceAndModeAttr(DOCUMENT_MODE));
fireCharacters(replaceInSource(line.substring(pos1, pos2)));
pos2 += DOCUMENT_END.length(); // on "/" of "*/"
fireEndElement(COMMENT_TAG);
} else { // continued on following line(s)
state = IN_COMMENT;
commentIndent = SPACES.substring(0, linePos);
pushXML2(COMMENT_TAG, new String[]
{ MODE_ATTR, DOCUMENT_MODE
, SP_ATTR , String.valueOf(spaceCount)
});
fireCharacters(replaceInSource(line.substring(pos1)));
pos2 = trap;
}
} else if (line.startsWith(COMMENT_START, linePos)) { // normal comment
pos1 = linePos + COMMENT_START.length();
pos2 = line.indexOf(COMMENT_END, pos2);
if (pos2 >= pos1) { // closing comment on same line
fireStartElement(COMMENT_TAG, spaceAttribute());
fireCharacters(replaceInSource(line.substring(pos1, pos2)));
pos2 += COMMENT_END.length(); // on "/" of "*/"
fireEndElement(COMMENT_TAG);
} else { // continued on following line(s)
state = IN_COMMENT;
commentIndent = SPACES.substring(0, linePos);
pushXML2(COMMENT_TAG, new String[]
{ MODE_ATTR, COMMENT_MODE
, SP_ATTR , String.valueOf(spaceCount)
});
fireCharacters(replaceInSource(line.substring(pos1)));
pos2 = trap;
}
} else if (line.startsWith(lineEndComment, linePos)) { // line end comment
pos1 = linePos + lineEndComment.length();
fireStartElement(COMMENT_TAG, spaceAndModeAttr(LINE_END_MODE));
fireCharacters(replaceInSource(line.substring(pos1)));
fireEndElement(COMMENT_TAG);
pos2 = trap; // skip to end of line
} else if (line.startsWith("/=", linePos)) { // divide by
fireEmptyElement(OPERATOR_TAG, spaceAndValAttr("/="));
pos2 = linePos + 2;
} else { // single "/" = ordinary division
fireEmptyElement(OPERATOR_TAG, spaceAndValAttr("/" ));
pos2 = linePos + 1;
}
return pos2 - 1; // 1 before the end
} // matchSlash
/** Matches all elements starting with "(" - eventually a Pascal comment "(*".
* @param line input line containing "(" at position <em>linePos</em>
* @param linePos position where "(" was found
* @param trap position behind the end of the line
* @return position behind the matched element, - 1
*/
protected int matchParenthesis(String line, int linePos, int trap) {
int pos1 = linePos + 1; // the position where this element's content starts
int pos2 = pos1; // position behind the element just recognized
if (false) {
} else if (line.startsWith(PAS_COMMENT2_START, linePos)
&& line.length() > linePos + PAS_COMMENT2_START.length()
) { // document comment and not /**/
pos1 = linePos + PAS_COMMENT2_START.length();
pos2 = line.indexOf(PAS_COMMENT2_END, pos2);
if (pos2 >= pos1) { // closing comment on same line
fireStartElement(COMMENT_TAG, spaceAndModeAttr(DOCUMENT_MODE));
fireCharacters(replaceInSource(line.substring(pos1, pos2)));
pos2 += PAS_COMMENT2_END.length(); // on "/" of "*/"
fireEndElement(COMMENT_TAG);
} else { // continued on following line(s)
state = IN_PAS_COMMENT;
commentIndent = SPACES.substring(0, linePos);
pushXML2(COMMENT_TAG, new String[]
{ MODE_ATTR, DOCUMENT_MODE
, SP_ATTR , String.valueOf(spaceCount)
});
fireCharacters(replaceInSource(line.substring(pos1)));
pos2 = trap;
}
} else if (line.startsWith(PAS_COMMENT_START, linePos)) { // normal comment
pos1 = linePos + PAS_COMMENT_START.length();
pos2 = line.indexOf(PAS_COMMENT_END, pos2);
if (pos2 >= pos1) { // closing comment on same line
fireStartElement(COMMENT_TAG, spaceAttribute());
fireCharacters(replaceInSource(line.substring(pos1, pos2)));
pos2 += PAS_COMMENT_END.length(); // on "/" of "*/"
fireEndElement(COMMENT_TAG);
} else { // continued on following line(s)
state = IN_PAS_COMMENT;
commentIndent = SPACES.substring(0, linePos);
pushXML2(COMMENT_TAG, new String[]
{ MODE_ATTR, COMMENT_MODE
, SP_ATTR , String.valueOf(spaceCount)
});
fireCharacters(replaceInSource(line.substring(pos1)));
pos2 = trap;
}
} else { // single "(" = ordinary open parenthesis
// fireStartElement(ROUND_TAG , spaceAttribute());
fireEmptyElement(OPERATOR_TAG, spaceAndValAttr(line.substring(linePos, linePos + 1)));
pos2 = linePos + 1;
}
return pos2 - 1; // 1 before the end
} // matchParenthesis
/** Inserts a number of spaces before a closing element.
*/
private void optionalSpaces() {
if (spaceCount > 0) {
fireEmptyElement(WHITESPACE_TAG, spaceAttribute());
spaceCount = 0;
}
} // optionalSpaces
/** Constructs an attribute for a number of spaces to be inserted before the element.
* @return new attribute
*/
protected Attributes spaceAttribute() {
AttributesImpl attrs = new AttributesImpl();
if (spaceCount > 0) {
attrs.addAttribute("", SP_ATTR, SP_ATTR, "CDATA", Integer.toString(spaceCount));
spaceCount = 0;
}
return attrs;
} // spaceAttribute
/** Constructs an attribute for a number of spaces to be inserted before the element,
* and a 2nd value attribute before the element.
* @param value value of the "v" attribute
* @return new attribute
*/
protected Attributes spaceAndValAttr(String value) {
AttributesImpl attrs = new AttributesImpl();
attrs.addAttribute("", VAL_ATTR, VAL_ATTR , "CDATA", replaceInSource(value) );
if (spaceCount > 0) {
attrs.addAttribute("", SP_ATTR, SP_ATTR, "CDATA", Integer.toString(spaceCount));
spaceCount = 0;
}
return attrs;
} // spaceAndValAttr
/** Constructs an attribute for a number of spaces to be inserted before the element,
* and a 2nd mode attribute before the element.
* @param value value of the "t" attribute (a short string constant like "bt", "ap", "qu")
* @return new attribute
*/
protected Attributes spaceAndModeAttr(String value) {
AttributesImpl attrs = new AttributesImpl();
attrs.addAttribute("", MODE_ATTR, MODE_ATTR , "CDATA", value);
if (spaceCount > 0) {
attrs.addAttribute("", SP_ATTR, SP_ATTR, "CDATA", Integer.toString(spaceCount));
spaceCount = 0;
}
return attrs;
} // spaceAndModeAttr
/** Pattern for escaped characters */
protected Pattern characterPattern;
/** Pattern for identifiers and keywords */
protected Pattern identifierPattern;
/** Pattern for numbers */
protected Pattern numberPattern;
/** Pattern for all operators, single- or multi-character */
protected Pattern operatorPattern;
/** Prepares the generator.
* Does all heavy-weight initialization,
* especially the call of {@link #storeWords}.
*/
protected void prepareGenerator() {
language = LANG_UNDEF; // unspecified so far
putEntityReplacements();
characterPattern = Pattern.compile
("\\\'([^\\\\]|\\\\(u[a-fA-F0-9]{4}|x[a-fA-F0-9]{2}|n|r|b|t|f|[^A-Za-z0-9]))\\\'");
// unesc. \u1234 \x12 \n ... \. etc.
identifierPattern = Pattern.compile
("[\\w\\_]+");
numberPattern = Pattern.compile
("0x[0-9a-fA-F]+|\\d+"); // maybe 0x09af
operatorPattern = Pattern.compile
("\\,|\\.|[\\+\\-\\*\\>\\<\\&\\|\\^\\%\\$\\=\\:\\?\\!\\~\\#\\@\\\\]+");
// no slash! because it may start a comment
lineNo = 0;
readOff = true;
state = IN_TEXT;
keywords = new String[] { "()" };
keyverbs = new String[] { "()" };
storeWords();
storeVerbs();
forceUpperCase = ! getOption("uc", "false").startsWith("f");
} // prepareGenerator
/** whether to consume the current character in the finite automaton */
private boolean readOff;
/** state of finite automaton */
protected int state;
/** previous state of finite automaton */
protected int prevState;
/** reader for source lines and nested include files */
protected NestedLineReader reader;
/** current source line read from input file */
protected String line;
/** current position in source line */
protected int linePos;
/** position behind the last character in the source line */
protected int trap;
/** buffer for short portions of generated XML */
protected StringBuffer buffer;
/** Processes one source line.
* All characters in the "real" source line are consumed by finite state automaton.
* Column oriented prefixes and postfixes were previously handled by {@link #processColumns}.
* Uses global <em>state</em>.
*/
protected void processLine() {
while (linePos < trap) { // process all characters in the line
readOff = true;
char ch = line.charAt(linePos);
switch (state) {
case IN_TEXT:
switch (ch) {
case ' ':
spaceCount ++;
break;
case ';':
// fireEmptyElement(SEMI_TAG , spaceAttribute());
fireEmptyElement(OPERATOR_TAG, spaceAndValAttr(line.substring(linePos, linePos + 1)));
break;
case '{':
if (pascalComments) {
linePos = matchParenthesis(line, linePos, trap);
} else {
// fireStartElement(CURLY_TAG , spaceAttribute());
fireEmptyElement(OPERATOR_TAG, spaceAndValAttr(line.substring(linePos, linePos + 1)));
}
break;
case '}':
optionalSpaces();
// fireEndElement (CURLY_TAG);
fireEmptyElement(OPERATOR_TAG, spaceAndValAttr(line.substring(linePos, linePos + 1)));
break;
case '(':
if (pascalComments) {
linePos = matchParenthesis(line, linePos, trap);
} else {
// fireStartElement(ROUND_TAG , spaceAttribute());
fireEmptyElement(OPERATOR_TAG, spaceAndValAttr(line.substring(linePos, linePos + 1)));
}
break;
case ')':
optionalSpaces();
// fireEndElement (ROUND_TAG);
fireEmptyElement(OPERATOR_TAG, spaceAndValAttr(line.substring(linePos, linePos + 1)));
break;
case '[':
// fireStartElement(SQUARE_TAG, spaceAttribute());
fireEmptyElement(OPERATOR_TAG, spaceAndValAttr(line.substring(linePos, linePos + 1)));
break;
case ']':
optionalSpaces();
// fireEndElement (SQUARE_TAG);
fireEmptyElement(OPERATOR_TAG, spaceAndValAttr(line.substring(linePos, linePos + 1)));
break;
case '/': // comment or "/="
linePos = matchSlash(line, linePos, trap);
break; // slash
case '#': // maybe line end comment in Perl, Ruby etc.
if (lineEndComment.startsWith("#")) {
linePos = matchSlash (line, linePos, trap);
} else {
linePos = matchOperator(line, linePos, trap);
}
break; // #
case '\\':
switch (escapeCode) {
case LANG_REXX:
linePos = matchOperator (line, linePos, trap);
break;
case LANG_PL1:
case LANG_VBA:
buffer.append(ch);
break;
default:
prevState = state;
state = IN_BACKSLASH;
break;
} // switch escapeCode
break; // \\
/* not yet
case '<': // type or "<=", "<<"
linePos = matchLessThan(line, linePos, trap);
break; // lt
*/
case '\t':
// expand by "-tab" option ???
tabCount = 1;
state = IN_TABS;
break;
case '\'':
switch (escapeCode) {
case LANG_JAVA:
case LANG_VBA:
linePos = matchCharacter(line, linePos, trap );
break;
case LANG_PERL:
case LANG_RUBY:
state = IN_SINGLE_QUOTE;
fireStartElement(STRING_TAG, spaceAndModeAttr(ASTRING_MODE));
buffer.setLength(0);
break;
case LANG_PL1:
case LANG_REXX:
case LANG_COBOL:
default:
state = IN_APOS;
fireStartElement(STRING_TAG, spaceAndModeAttr(ASTRING_MODE));
buffer.setLength(0);
break;
} // switch escapeCode
/*
*/
/*
if (bothStringTypes) {
state = IN_APOS;
fireStartElement(ASTRING_TAG, spaceAttribute());
buffer.setLength(0);
} else {
linePos = matchCharacter(line, linePos, trap );
}
*/
break;
case '\"':
state = IN_QUOTE;
fireStartElement(STRING_TAG, spaceAndModeAttr(DSTRING_MODE));
buffer.setLength(0);
break;
default:
if (false) {
} else if (Character.isLetter(ch)) {
linePos = matchIdentifier(line, linePos, trap);
} else if (Character.isDigit(ch)) {
linePos = matchNumber (line, linePos, trap);
} else { // punctuation, operator
linePos = matchOperator (line, linePos, trap);
}
break; // default
} // switch ch
break; // IN_TEXT
case IN_COMMENT:
{ // block for 'pos2'
if (line.startsWith(commentIndent, linePos)) {
linePos += commentIndent.length();
}
int pos2 = line.indexOf((topXML2().equals(COMMENT_TAG + "," + DOCUMENT_MODE)
? DOCUMENT_END : COMMENT_END)
, linePos);
if (pos2 >= linePos) { // end of comment found
state = IN_TEXT;
fireCharacters(replaceInSource(line.substring(linePos, pos2)));
linePos = pos2 + 2;
popXML2(); // DOCUMENT_TAG or COMMENT_TAG
} else { // comment still continues
fireCharacters(replaceInSource(line.substring(linePos)));
linePos = trap;
}
} // block
break; // IN_COMMENT
case IN_PAS_COMMENT:
{ // block for 'pos2'
if (line.startsWith(commentIndent, linePos)) {
linePos += commentIndent.length();
}
int pos2 = line.indexOf((topXML2().equals(COMMENT_TAG + "," + DOCUMENT_MODE)
? PAS_COMMENT2_END : PAS_COMMENT_END)
, linePos);
if (pos2 >= linePos) { // end of comment found
state = IN_TEXT;
fireCharacters(replaceInSource(line.substring(linePos, pos2)));
linePos = pos2 + 2;
popXML2(); // DOCUMENT_TAG or COMMENT_TAG
} else { // comment still continues
fireCharacters(replaceInSource(line.substring(linePos)));
linePos = trap;
}
} // block
break; // IN_PAS_COMMENT
case IN_APOS:
switch (ch) {
case '\'': // 2nd apostrophe
if (line.startsWith("\'\'", linePos) && doubleInnerApos) {
// doubled inner apostrophe
linePos ++; // skip over 1st
buffer.append(ch); // append 2nd apostrophe
} else {
state = IN_TEXT;
fireCharacters(/* replaceInSource */(buffer.toString()));
fireEndElement(STRING_TAG);
}
break;
/*
case '\\':
prevState = state;
state = IN_BACKSLASH;
break;
*/
default:
buffer.append(ch);
break;
} // switch ch
break; // IN_APOS
case IN_QUOTE:
switch (ch) {
case '\"': // 2nd quote
state = IN_TEXT;
fireCharacters(replaceInSource(buffer.toString()));
fireEndElement(STRING_TAG);
break;
case '\\':
switch (escapeCode) {
case LANG_REXX:
case LANG_PL1:
case LANG_VBA:
buffer.append(ch);
break;
default:
prevState = state;
state = IN_BACKSLASH;
break;
} // switch escapeCode
break;
default:
buffer.append(ch);
break;
} // switch ch
break; // IN_QUOTE
case IN_SINGLE_QUOTE:
switch (ch) {
case '\'': // 2nd apostrophe
state = IN_TEXT;
fireCharacters(replaceInSource(buffer.toString()));
fireEndElement(STRING_TAG);
break;
case '\\':
switch (escapeCode) {
case LANG_REXX:
case LANG_PL1:
case LANG_VBA:
buffer.append(ch);
break;
default:
prevState = state;
state = IN_BACKSLASH;
break;
} // switch escapeCode
break;
default:
buffer.append(ch);
break;
} // switch ch
break; // IN_SINGLE_QUOTE
case IN_TABS:
switch (ch) {
case '\t': // next tab
tabCount ++;
break;
default:
state = IN_TEXT;
readOff = false;
fireEmptyElement(WHITESPACE_TAG, toAttributes(new String[]
{ MODE_ATTR, TAB_MODE
, VAL_ATTR, String.valueOf(tabCount)
, (spaceCount > 0 ? SP_ATTR : ""), String.valueOf(spaceCount)
}));
spaceCount = 0;
tabCount = 0;
break;
} // switch ch
break; // IN_TABS
case IN_BACKSLASH:
state = prevState;
if (buffer.length() > 0) { // flush the buffer before any entity
fireCharacters(replaceInSource(buffer.toString()));
buffer.setLength(0);
} // flush
switch (ch) {
case '\\':
buffer.append("\\\\");
break;
case '\"':
fireEntity("quot");
break;
case '\'':
fireEntity("apos");
break;
case 'b':
fireEntity("#x8");
break;
/*
case 'f':
fireEntity("#xc");
break;
*/
case 'n':
fireEntity("#xa");
break;
case 'r':
fireEntity("#xd");
break;
case 't':
fireEntity("#x9");
break;
case 'u':
fireEntity("#x" + line.substring(linePos + 1, linePos + 5));
linePos += 4;
break;
case 'x': // for C, C++
fireEntity("#x" + line.substring(linePos + 1, linePos + 3));
linePos += 2;
break;
default:
buffer.append("\\");
buffer.append(ch);
break;
} // switch ch
break; // IN_BACKSLASH
default:
log.error("invalid state " + state);
break;
} // switch state */
if (readOff) { // really consume the current character
linePos ++;
} // else look again at current character
} // while processing all characters in the line
if (state == IN_APOS) { // broken string in COBOL - close it
state = IN_TEXT;
fireCharacters(replaceInSource(buffer.toString()));
fireEndElement(STRING_TAG);
}
} // processLine
/** Processes the column oriented features of the source line
*/
protected void processColumns() {
// maybe overriden by column oriented languages
} // processColumns
/** Transforms from the specified format to XML by reading lines from
* the input file and feeding its characters into a finite automaton.
* Protected properties set by the <em>matchXXX</em> methods:
* <ul>
* <li>lineNo</li>
* <li>readOff</li>
* <li>state</li>
* </ul>
* @return whether the transformation was successful
*/
public boolean generate() {
// log.info("ProgLangTransformer.generate: forceUpperCase = " + forceUpperCase + ", caseIndependant = " + caseIndependant);
boolean result = true;
buffer = new StringBuffer(64); // current XML element built during scanning process
try {
prepareGenerator(); // language specific initialization
fireStartDocument();
fireStartRoot(ROOT_TAG);
// fireEmptyElement("parm", toAttribute("lang", getFirstFormatCode()));
fireLineBreak();
state = IN_TEXT; // state of finite automaton
prevState = state;
readOff = true; // whether current character should be consumed
lineNo = 0; // number of current line
linePos = 0; // position of the character to be read
reader = new NestedLineReader();
reader.open(new BufferedReader(charReader));
while ((line = reader.readLine()) != null) { // while reading lines
linePos = 0;
// column = 0;
spaceCount = 0;
tabCount = 0;
// each line starts with a NEWLINE element
// which may have attributes for a prefix and postfix area (e.g. columns 1-6 and 73-80)
// AttributesImpl attrs = new AttributesImpl();
// attrs.addAttribute("", LINE_NO_ATTR, LINE_NO_ATTR , "CDATA", Integer.toString(lineNo));
fireEmptyElement(WHITESPACE_TAG, toAttributes(new String[]
{ MODE_ATTR, NEWLINE_MODE
, VAL_ATTR , String.valueOf(lineNo)
}));
// fireEmptyElement(NEWLINE_TAG, attrs);
if (minColumn > 0 && line.length() > minColumn) {
fireEmptyElement(WHITESPACE_TAG, toAttributes(new String[]
{ MODE_ATTR, PREFIX_MODE
, VAL_ATTR , line.substring(0, minColumn)
}));
// attrs.addAttribute("", PRE_ATTR, PRE_ATTR , "CDATA", line.substring(0, minColumn));
linePos = minColumn; // start scanning behind the prefix
}
if (line.length() > maxColumn) {
fireEmptyElement(WHITESPACE_TAG, toAttributes(new String[]
{ MODE_ATTR, POSTFIX_MODE
, VAL_ATTR , line.substring(maxColumn)
}));
// attrs.addAttribute("", POST_ATTR, POST_ATTR, "CDATA", line.substring(maxColumn));
line = line.substring(0, maxColumn); // remove the postfix
}
trap = line.length(); // position behind the end of the line
processColumns(); // empty for Java, overridden by column oriented languages
processLine(); // real source text
fireLineBreak();
lineNo ++;
} // while not EOF
reader.close();
fireEndElement(ROOT_TAG);
fireLineBreak();
fireEndDocument();
} catch (Exception exc) {
log.error(exc.getMessage(), exc);
result = false;
}
return result;
} // generate
/////////////////////////
// SAX content handler //
/////////////////////////
/** buffer for portions of the output line */
protected StringBuffer saxBuffer;
/** buffer for the output line */
protected StringBuffer saxLine;
/** prefix at the beginning of <em>saxLine</em> */
protected String saxPrefix;
/** postfix at the end of <em>saxLine</em> */
protected String saxPostfix;
/** current position in output line */
protected int saxColumn;
/** spaces before a continued comment line */
protected String saxCommentIndent;
/** Upper bound for character buffer */
protected static final int MAX_BUF = 4096;
/** whether in a string */
protected boolean saxInString;
/** whether in a comment */
protected boolean saxInComment;
/** character which encloses PL/1 string constants */
protected char saxApos;
/** character which encloses C string constants */
protected char saxQuote;
/** value of the mode attribute of some elements - which cannot be nested */
protected String modeAttr;
/** value of the mode attribute of comments - which cannot be nested */
protected String commentModeAttr;
/** Writes the contents of the buffer and purges it.
* @param replace replacement mask,
* bit 2**0: whether to replace entities in result stream,
* bit 2**1: whether to escape quotes and apostrophes
*/
protected void flushBuffer(int replace) {
// System.out.println(saxBuffer.toString());
switch (replace) {
case 0:
case 2:
case 1:
case 3:
saxLine.append(replaceInResult(saxBuffer.toString()));
break;
} // switch replace
saxBuffer.setLength(0);
} // flushBuffer
/** Replaces all non-printable/non-ASCII characters by their
* C-language escape (with backslash, unicode if >= 0x80)
* @param source string in which characters are replaced
* @return traget string with backslash escapes
*/
public String escapeInResult(String source) {
StringBuffer result = new StringBuffer(296);
int pos = 0;
while (pos < source.length()) {
char ch = source.charAt(pos ++);
switch (ch) {
case '\'':
if (saxInString) {
if (doubleInnerApos) {
result.append("\'\'");
} else {
if (bothStringTypes) {
result.append(ch);
} else {
result.append("\\\'");
}
}
} else {
result.append(ch);
}
break;
case '\"':
if (saxInString) {
if (doubleInnerApos) {
result.append("\"\"");
} else {
if (bothStringTypes) {
result.append(ch);
} else {
result.append("\\\"");
}
}
} else {
result.append(ch);
}
break;
default:
if (ch < 0x20) {
switch (ch) { // control character
case '\b':
result.append("\\b");
break;
case '\f':
result.append("\\f");
break;
case '\n':
result.append("\\n");
break;
case '\r':
result.append("\\r");
break;
case '\t':
if (saxInString) {
result.append("\\t");
} else {
result.append(ch);
}
break;
default:
break;
} // switch control character
} else if (ch < 0x80) { // normal ASCII
result.append(ch);
} else if (ch < 0x100) { // LATIN-1
switch (escapeCode) {
case LANG_JAVA:
result.append("\\u" + (Integer.toHexString(ch + 0x10000)).substring(1));
break;
default:
case LANG_REXX:
case LANG_C:
case LANG_PL1:
result.append(ch);
break;
} // switch escapeCode
} else { // >= 256, Unicode in any case
result.append("\\u" + (Integer.toHexString(ch + 0x10000)).substring(1));
}
break;
} // switch ch
} // while pos
return result.toString();
} // escapeInResult
/** Writes the contents of the output line and purges it with the pre- and postfixes.
* Fills with spaces if <em>maxColumn</em> is set.
*/
protected void flushLine() {
int spaceFill = maxColumn;
if (saxPrefix != null) {
saxLine.insert(0, saxPrefix);
}
if (saxPostfix != null) { // implies maxColumn < HIGH_COLUMN
if (saxLine.length() > maxColumn) {
saxLine.setLength(maxColumn);
} else {
saxLine.append(spaces(spaceFill - saxLine.length()));
}
saxLine.append(saxPostfix);
}
charWriter.println(saxLine.toString());
saxPrefix = null;
saxPostfix = null;
saxLine.setLength(0);
} // flushLine
/** Get the current length of the line to be written to the target.
* @return length of line
*/
public int getSaxLength() {
return saxLine.length();
} // getSaxLength
/** Prefix the tag with a number of spaces taken from the "sp" attribute
* @param attrs the attributes attached to the element.
*/
protected void prefixSpaces(Attributes attrs) {
String spValue = attrs.getValue(SP_ATTR);
if (spValue != null) { // with space count
int spc = 0;
try {
spc = Integer.parseInt(spValue);
} catch (Exception exc) {
}
saxBuffer.append(spaces(spc));
} // with space count
} // prefixSpaces
/** Receive notification of the beginning of the document.
*/
public void startDocument() {
try {
super.startDocument();
} catch (Exception exc) {
log.error(exc.getMessage(), exc);
}
putEntityReplacements();
saxApos = '\''; // for PL/1, REXX ...
saxQuote = '\"'; // for Java, C ...
saxBuffer = new StringBuffer(MAX_BUF); // a rather long portion
saxLine = new StringBuffer(MAX_BUF); // a rather long line
saxPrefix = null;
saxPostfix = null;
saxColumn = 0;
saxInString = false;
saxInComment= false;
forceUpperCase = ! getOption("uc", "false").startsWith("f");
} // startDocument
/** Receive notification of the end of the document.
*/
public void endDocument() {
flushBuffer(0);
flushLine();
charWriter.close();
} // endDocument
/** Writes the start of a target comment.
* @param qName the qualified name (with prefix),
* or the empty string if qualified names are not available.
* @param attrs the attributes attached to the element.
* If there are no attributes, it shall be an empty Attributes object.
*/
protected void writeCommentStart(String qName, Attributes attrs) {
commentModeAttr = attrs.getValue(MODE_ATTR);
if (qName.equals(COMMENT_TAG )) {
if (false) {
} else if (commentModeAttr == null
|| commentModeAttr.equals(COMMENT_MODE)) {
saxBuffer.append (COMMENT_START );
} else if (commentModeAttr.equals(DOCUMENT_MODE)) {
saxBuffer.append (DOCUMENT_START);
} else if (commentModeAttr.equals(LINE_END_MODE)) {
saxBuffer.append (lineEndComment);
}
}
} // writeCommentStart
/** Writes the end of a target comment.
* @param qName tag which specifies the subtype of the comment
*/
protected void writeCommentEnd (String qName) {
if (qName.equals(COMMENT_TAG )) {
if (false) {
} else if (commentModeAttr == null
|| commentModeAttr.equals(COMMENT_MODE)) {
saxBuffer.append (COMMENT_END );
} else if (commentModeAttr.equals(DOCUMENT_MODE)) {
saxBuffer.append (DOCUMENT_END );
} else if (commentModeAttr.equals(LINE_END_MODE)) {
// output nothing
}
}
} // writeCommentEnd
/** Writes a label element.
* This implementation appends the label without any column orientation.
* @param qName the qualified name (with prefix),
* or the empty string if qualified names are not available.
* @param attrs the attributes attached to the element.
* If there are no attributes, it shall be an empty Attributes object.
*/
protected void writeLabel(String qName, Attributes attrs) {
saxBuffer.append(attrs.getValue(VAL_ATTR));
} // writeLabel
/** Receive notification of the start of an element.
* Looks for the element which contains raw lines.
* @param uri The Namespace URI, or the empty string if the element has no Namespace URI
* or if Namespace processing is not being performed.
* @param localName the local name (without prefix),
* or the empty string if namespace processing is not being performed.
* @param qName the qualified name (with prefix),
* or the empty string if qualified names are not available.
* @param attrs the attributes attached to the element.
* If there are no attributes, it shall be an empty Attributes object.
*/
public void startElement(String uri, String localName, String qName, Attributes attrs) {
String value = null; // of an attribute
if (namespace.length() > 0 && qName.startsWith(namespace)) {
qName = qName.substring(namespace.length());
}
prefixSpaces(attrs); // print the leading spaces before the element
if (false) {
} else if (qName.equals(BACKSLASH_NL_TAG)) {
saxBuffer.append('\\');
flushBuffer(0);
String lno = attrs.getValue(LINE_NO_ATTR);
if (lno != null && ! lno.equals("0")) {
flushLine();
}
saxPrefix = attrs.getValue(PRE_ATTR);
saxPostfix = attrs.getValue(POST_ATTR);
if (saxInComment) {
saxBuffer.append(saxCommentIndent);
}
} else if (qName.equals(CHAR_TAG)) {
String chars = attrs.getValue(VAL_ATTR);
if (chars != null) {
saxBuffer.append('\'');
chars = replaceInResult(chars);
if (false) {
} else if (chars.equals("\'")) {
chars = "\\\'";
} else if (chars.equals("\"")) {
chars = "\\\"";
} else if (chars.equals("\\")) {
chars = "\\\\";
} else if (chars.equals("")) {
chars = "\\b";
} else if (chars.equals("	")) {
chars = "\\t";
} else if (chars.equals("
")) {
chars = "\\n";
} else if (chars.equals("") || chars.equals("")) {
chars = "\\f";
} else if (chars.equals("
")) {
chars = "\\r";
} else if (chars.startsWith("&#x")) {
if (chars.length() > 6) {
chars = "\\u" + chars.substring(3, chars.length() - 1);
} else {
chars = "\\x" + chars.substring(3, chars.length() - 1);
}
}
saxBuffer.append(chars);
saxBuffer.append('\'');
}
} else if (qName.equals(COMMENT_TAG )) {
flushBuffer(0);
saxInComment = true;
saxCommentIndent = spaces(saxLine.length()); // including the prefixSpaces
writeCommentStart(qName, attrs);
} else if (qName.equals(CONCAT_TAG )) { // for Cobol
flushBuffer(0);
writeCommentStart(qName, attrs);
} else if (qName.equals(IDENTIFIER_TAG)) {
value = attrs.getValue(VAL_ATTR);
if (value != null) {
saxBuffer.append(forceUpperCase && caseIndependant ? value.toUpperCase() : value);
}
} else if (qName.equals(KEYWORD_TAG )) {
// subsumes VERB_MODE also
value = attrs.getValue(VAL_ATTR);
if (value != null) {
saxBuffer.append(forceUpperCase && caseIndependant ? value.toUpperCase() : value);
}
} else if (qName.equals(LABEL_TAG )) {
flushBuffer(0);
writeLabel(qName, attrs);
/*
} else if (qName.equals(NEWLINE_TAG )) {
flushBuffer(0);
String lno = attrs.getValue(LINE_NO_ATTR);
if (lno != null && ! lno.equals("0")) {
flushLine();
}
saxPrefix = attrs.getValue(PRE_ATTR);
saxPostfix = attrs.getValue(POST_ATTR);
if (saxInComment) {
saxBuffer.append(saxCommentIndent);
}
*/
} else if (qName.equals(NEXT_CONTINUE_TAG )) {
flushBuffer(0);
String nc = attrs.getValue(VAL_ATTR);
saxBuffer.append(nc);
} else if (qName.equals(PREV_CONTINUE_TAG )) {
flushBuffer(0);
String pc = attrs.getValue(VAL_ATTR);
saxBuffer.append(pc);
} else if (qName.equals(NUMBER_TAG )) {
String num = attrs.getValue(VAL_ATTR);
if (num != null) {
saxBuffer.append(num);
}
} else if (qName.equals(OPERATOR_TAG)) {
String op = attrs.getValue(VAL_ATTR);
if (op != null) {
saxBuffer.append(op);
}
} else if (qName.equals(PRAGMA_TAG )) {
flushBuffer(0);
saxBuffer.append(PRAGMA_START);
} else if (qName.equals(SEMI_TAG )) {
saxBuffer.append(';');
} else if (qName.equals(STRING_TAG )) {
modeAttr = attrs.getValue(MODE_ATTR);
if (false) {
} else if (modeAttr == null || modeAttr.equals(ASTRING_MODE)) {
saxBuffer.append(saxApos);
} else if (modeAttr.equals(DSTRING_MODE)) {
saxBuffer.append(saxQuote);
}
flushBuffer(0);
saxInString = true;
} else if (qName.equals(WHITESPACE_TAG )) {
// prefixSpaces was already called - do not evaluate that mode
value = attrs.getValue(VAL_ATTR ); // number of tabs, margin text, line number
modeAttr = attrs.getValue(MODE_ATTR);
if (false) {
} else if (modeAttr == null || modeAttr.equals(TAB_MODE)) { // TAB_MODE is default
if (value != null) { // tab count >= 0
int ival = 0;
try {
ival = Integer.parseInt(value);
} catch (Exception exc) {
}
while (ival > 0) { // expand tab count
saxBuffer.append('\t');
ival --;
} // while ival
} // tab count >= 0
} else if (modeAttr.equals(NEWLINE_MODE )) {
flushBuffer(0);
if (value != null && ! value.equals("0")) { // not at the beginning
flushLine();
}
if (saxInComment) {
saxBuffer.append(saxCommentIndent);
}
} else if (modeAttr.equals(PREFIX_MODE )) {
saxPrefix = (value != null ? value : "");
} else if (modeAttr.equals(POSTFIX_MODE)) {
saxPostfix = (value != null ? value : "");
}
// WHITESPACE_TAG
} // else ignore unknown elements
} // startElement
/** Receive notification of the end of an element.
* Looks for the element which contains raw lines.
* Terminates the line.
* @param uri the Namespace URI, or the empty string if the element has no Namespace URI
* or if Namespace processing is not being performed.
* @param localName the local name (without prefix),
* or the empty string if Namespace processing is not being performed.
* @param qName the qualified name (with prefix),
* or the empty string if qualified names are not available.
*/
public void endElement(String uri, String localName, String qName) {
if (namespace.length() > 0 && qName.startsWith(namespace)) {
qName = qName.substring(namespace.length());
}
if (false) {
} else if (qName.equals(BACKSLASH_NL_TAG)) {
} else if (qName.equals(COMMENT_TAG )) {
flushBuffer(1);
writeCommentEnd(qName);
saxInComment = false;
} else if (qName.equals(PRAGMA_TAG )) {
flushBuffer(1);
saxBuffer.append(PRAGMA_END);
} else if (qName.equals(STRING_TAG )) {
flushBuffer(3);
saxInString = false;
if (saxLine.length() < maxColumn) { // no trailing apostrophe in column 73 for Cobol
}
if (false) {
} else if (modeAttr == null || modeAttr.equals(ASTRING_MODE)) {
saxBuffer.append(saxApos);
} else if (modeAttr.equals(DSTRING_MODE)) {
saxBuffer.append(saxQuote);
}
} // else ignore unknown elements
} // endElement
/** Receive notification of character data inside an element.
* @param ch the characters.
* @param start the start position in the character array.
* @param len the number of characters to use from the character array.
*/
public void characters(char[] ch, int start, int len) {
if (! saxInString) {
if (len > 0 && ch[start + len - 1] == '\n') { // ignore newline between tags
len --;
} // last \n
} // ! saxInString
saxBuffer.append(escapeInResult(replaceNoResult(new String(ch, start, len))));
} // characters
} // class ProgLangTransformer
|
3e028833bae6ed7210b047dd9537dc28086567cb | 840 | java | Java | src/main/java/io/magj/iamjdbcdriver/PostgreSqlIamAuthJdbcDriverWrapper.java | realshadow/iam-jdbc-driver | 2cf2a2a063366d59b005dbc3bd86a60905a4ba9e | [
"MIT"
]
| 14 | 2020-05-01T18:25:38.000Z | 2021-12-15T04:53:26.000Z | src/main/java/io/magj/iamjdbcdriver/PostgreSqlIamAuthJdbcDriverWrapper.java | realshadow/iam-jdbc-driver | 2cf2a2a063366d59b005dbc3bd86a60905a4ba9e | [
"MIT"
]
| 2 | 2020-05-05T23:04:43.000Z | 2021-04-10T08:12:29.000Z | src/main/java/io/magj/iamjdbcdriver/PostgreSqlIamAuthJdbcDriverWrapper.java | realshadow/iam-jdbc-driver | 2cf2a2a063366d59b005dbc3bd86a60905a4ba9e | [
"MIT"
]
| 4 | 2020-05-06T18:50:53.000Z | 2021-06-09T14:56:02.000Z | 31.111111 | 84 | 0.69881 | 1,035 | package io.magj.iamjdbcdriver;
public class PostgreSqlIamAuthJdbcDriverWrapper extends IamAuthJdbcDriverWrapper {
public static final String SCHEME_NAME = "iampostgresql";
public static final String DELEGATE_SCHEME_NAME = "postgresql";
public static final int DEFAULT_PORT = 5432;
public static final String DELEGATE_DRIVER_CLASS_NAME = "org.postgresql.Driver";
static {
initialiseDriverRegistration(new PostgreSqlIamAuthJdbcDriverWrapper(false));
}
public PostgreSqlIamAuthJdbcDriverWrapper() {
this(true);
}
public PostgreSqlIamAuthJdbcDriverWrapper(boolean acceptDelegateUrls) {
super(
SCHEME_NAME,
DELEGATE_SCHEME_NAME,
DEFAULT_PORT,
DELEGATE_DRIVER_CLASS_NAME,
acceptDelegateUrls);
}
}
|
3e028893c5cdcd063649e74034e5b671e4aa913d | 1,071 | java | Java | examples/src/main/java/net/jbock/examples/RmArguments.java | h908714124/jbock | 0b2316778e971672e0c97cd6f963eee1f85e985a | [
"MIT"
]
| 45 | 2017-04-24T11:05:53.000Z | 2021-05-09T21:27:00.000Z | examples/src/main/java/net/jbock/examples/RmArguments.java | h908714124/jbock | 0b2316778e971672e0c97cd6f963eee1f85e985a | [
"MIT"
]
| 10 | 2017-05-28T15:35:50.000Z | 2021-05-09T14:40:50.000Z | examples/src/main/java/net/jbock/examples/RmArguments.java | h908714124/jbock | 0b2316778e971672e0c97cd6f963eee1f85e985a | [
"MIT"
]
| 4 | 2019-05-21T09:12:04.000Z | 2020-11-12T14:21:45.000Z | 33.46875 | 120 | 0.626517 | 1,036 | package net.jbock.examples;
import net.jbock.Command;
import net.jbock.Option;
import net.jbock.Parameters;
import java.util.List;
@Command
abstract class RmArguments {
/**
* @return a boolean
*/
@Option(names = {"--recursive", "-r"},
description = {
"ALLES TURISTEN UND NONTEKNISCHEN LOOKENSPEEPERS!",
"DAS KOMPUTERMASCHINE IST NICHT FUR DER GEFINGERPOKEN UND MITTENGRABEN!",
"ODERWISE IST EASY TO SCHNAPPEN DER SPRINGENWERK, BLOWENFUSEN UND POPPENCORKEN MIT SPITZENSPARKEN.",
"IST NICHT FUR GEWERKEN BEI DUMMKOPFEN.",
"DER RUBBERNECKEN SIGHTSEEREN KEEPEN DAS COTTONPICKEN HANDER IN DAS POCKETS MUSS.",
"ZO RELAXEN UND WATSCHEN DER BLINKENLICHTEN."})
abstract boolean recursive();
@Option(names = {"--force", "-f"},
description = "Use the force, Luke.")
abstract boolean force();
@Parameters(description = "This is a list that may be empty.")
abstract List<String> otherTokens();
}
|
3e02889c89c7087562b00d51b8d9dc3356ae4a20 | 5,710 | java | Java | src/main/java/com/insane/illuminatedbows/EntityIlluminatedArrow.java | MikeLydeamore/IlluminatedBows | de9926f83d8959a4fd2a7e1a9d03189290b5f2b6 | [
"MIT"
]
| 2 | 2015-01-31T07:12:40.000Z | 2015-03-16T11:41:09.000Z | src/main/java/com/insane/illuminatedbows/EntityIlluminatedArrow.java | MikeLydeamore/IlluminatedBows | de9926f83d8959a4fd2a7e1a9d03189290b5f2b6 | [
"MIT"
]
| 6 | 2015-01-03T02:03:04.000Z | 2021-07-11T23:13:03.000Z | src/main/java/com/insane/illuminatedbows/EntityIlluminatedArrow.java | MikeLydeamore/IlluminatedBows | de9926f83d8959a4fd2a7e1a9d03189290b5f2b6 | [
"MIT"
]
| 2 | 2016-01-29T05:25:48.000Z | 2017-02-26T19:53:10.000Z | 33.786982 | 174 | 0.6662 | 1,037 | package com.insane.illuminatedbows;
import java.lang.reflect.Field;
import net.minecraft.block.Block;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.init.Blocks;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import com.insane.illuminatedbows.blocks.BlockIlluminatedBlock;
import com.insane.illuminatedbows.blocks.IlluminatedBlocks;
import com.insane.illuminatedbows.tile.TileIllumination;
import cpw.mods.fml.relauncher.ReflectionHelper;
public class EntityIlluminatedArrow extends EntityArrow {
public float strength;
private static Field f;
public boolean blockSpawned;
public boolean deadOnLand=false;
public boolean gravity=true;
public boolean magic;
public EntityIlluminatedArrow(World par1World) {
super(par1World);
blockSpawned=false;
}
public EntityIlluminatedArrow(World par1World, EntityLivingBase par3EntityPlayer, EntityLivingBase par4EntityPlayer, float j, float k) {
super(par1World, par3EntityPlayer, par4EntityPlayer, j, k);
this.strength = j;
blockSpawned=false;
}
public EntityIlluminatedArrow(World par1World, double par2, double par4, double par6) {
super(par1World, par2, par4, par6);
blockSpawned=false;
}
public EntityIlluminatedArrow(World par1World, EntityLivingBase par2, float par3) {
super(par1World, par2, par3);
this.strength=par3;
}
protected void setIllumination(MovingObjectPosition par1MovingObjectPosition) {
for (int count = 0; count < 20; count++) {
this.worldObj.spawnParticle("magicCrit", this.posX, this.posY+2, this.posZ, 255, 213, 0);
}
if (!this.worldObj.isRemote && par1MovingObjectPosition != null) {
if (par1MovingObjectPosition.entityHit != null) {
if (magic)
this.setDead();
}
else {
int x = par1MovingObjectPosition.blockX;
int y = par1MovingObjectPosition.blockY;
int z = par1MovingObjectPosition.blockZ;
int meta = par1MovingObjectPosition.sideHit;
if (magic)
meta += 6;
Block block = worldObj.getBlock(x, y, z);
if ((block.getRenderType() == 0 || block.isOpaqueCube() || block.isNormalCube()) && worldObj.getTileEntity(x, y, z) == null && block != Blocks.crafting_table)
{
int blockMeta = worldObj.getBlockMetadata(x, y, z);
this.worldObj.setBlock(x, y, z, IlluminatedBlocks.illuminatedBlock, blockMeta, 3);
((TileIllumination) worldObj.getTileEntity(x, y, z)).init(block, meta);
this.worldObj.playSoundAtEntity(this, "dig.glass", 1.0F, 1.0F);
this.worldObj.markBlockForUpdate(x, y, z);
this.setDead();
}
else if (block instanceof BlockIlluminatedBlock)
{
TileIllumination te = (TileIllumination) worldObj.getTileEntity(x, y, z);
if (!(te.sides.contains(meta) || te.sides.contains(meta + 6)))
{
te.sides.add(meta);
this.worldObj.playSoundAtEntity(this, "dig.glass", 1.0F, 1.0F);
this.worldObj.markBlockForUpdate(x, y, z);
this.setDead();
}
}
if (magic)
this.setDead();
}
}
}
/*@Override
protected float getGravityVelocity() {
System.out.println(-0.97F*this.strength+1.0F);
return -0.97F*this.strength+1.0F;
}*/
public void setBlockToSet(Block block)
{
}
public void setDeadOnLand(boolean status)
{
deadOnLand=status;
}
public void setGravity(boolean status)
{
gravity=status;
}
public void isMagic(boolean status)
{
magic=status;
}
public boolean canPlaceBlockAt(World world, int x, int y, int z) {
if (world.getBlock(x, y, z) == Blocks.crafting_table)
{
System.out.println("TABLE");
return false;
}
return world.isSideSolid(x,y,z, ForgeDirection.SOUTH) || world.isSideSolid(x,y,z, ForgeDirection.EAST) ||
world.isSideSolid(x,y,z, ForgeDirection.WEST) || world.isSideSolid(x,y,z, ForgeDirection.NORTH) ||
World.doesBlockHaveSolidTopSurface(world, x, y, z) || (world.getBlock(x,y,z) == Blocks.leaves) ||
(world.getBlock(x,y,z) == Blocks.glass);
}
@Override
public void onUpdate() {
super.onUpdate();
//this.rotationYaw=initYaw;
if (magic)
this.worldObj.spawnParticle("reddust", this.posX, this.posY, this.posZ, 135, 84, 255);
else
this.worldObj.spawnParticle("reddust",this.posX, this.posY, this.posZ, 255, 213, 0);
try {
if (f==null) {
f=ReflectionHelper.findField(EntityArrow.class, "inGround", "field_70254_i");
f.setAccessible(true);
}
if (f.getBoolean(this) && !blockSpawned) {
//this.worldObj.setBlock((int) this.posX, (int) this.posY, (int) this.posZ, IlluminatedBows.illuminatedBlock);
//this.setDead();
Vec3 vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
Vec3 vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
MovingObjectPosition movingobjectposition = this.worldObj.func_147447_a(vec31, vec3, false, true, false);
//Block blockHit = this.worldObj.getBlock(movingobjectposition.blockX,movingobjectposition.blockY,movingobjectposition.blockZ);
blockSpawned=true;
this.setIllumination(movingobjectposition);
//this.setDead();
}
} catch(IllegalAccessException e) {
e.printStackTrace();
}
}
}
|
3e0289149e107e50e37c5cd2609ca0b26a5d0c97 | 2,191 | java | Java | dcraft.core/src/main/java/dcraft/cms/thread/proc/FullIndex.java | Gadreel/dcraft | 7748fa0a4c24afce3d22f7ed311d13ed548e8f17 | [
"Apache-2.0"
]
| 3 | 2017-06-23T10:47:41.000Z | 2021-06-03T02:59:00.000Z | dcraft.core/src/main/java/dcraft/cms/thread/proc/FullIndex.java | Gadreel/dcraft | 7748fa0a4c24afce3d22f7ed311d13ed548e8f17 | [
"Apache-2.0"
]
| null | null | null | dcraft.core/src/main/java/dcraft/cms/thread/proc/FullIndex.java | Gadreel/dcraft | 7748fa0a4c24afce3d22f7ed311d13ed548e8f17 | [
"Apache-2.0"
]
| null | null | null | 25.776471 | 97 | 0.649475 | 1,038 | package dcraft.cms.thread.proc;
import java.math.BigDecimal;
import java.util.List;
import java.util.function.Function;
import org.joda.time.DateTime;
import dcraft.db.DatabaseInterface;
import dcraft.db.DatabaseTask;
import dcraft.db.IStoredProc;
import dcraft.db.TablesAdapter;
import dcraft.db.util.ByteUtil;
import dcraft.lang.BigDateTime;
import dcraft.lang.op.OperationResult;
import dcraft.struct.Struct;
public class FullIndex implements IStoredProc {
@Override
public void execute(DatabaseInterface conn, DatabaseTask task, OperationResult log) {
// TODO replicating
// if (task.isReplicating())
TablesAdapter db = new TablesAdapter(conn, task);
String did = task.getTenant();
BigDateTime when = BigDateTime.nowDateTime();
boolean historical = false;
try {
conn.kill("dcmThreadA", did);
Function<Object,Boolean> partyConsumer = new Function<Object,Boolean>() {
@Override
public Boolean apply(Object t) {
try {
String id = t.toString();
DateTime mod = Struct.objectToDateTime(db.getStaticScalar("dcmThread", id, "dcmModified"));
BigDecimal revmod = ByteUtil.dateTimeToReverse(mod);
List<String> parties = db.getStaticListKeys("dcmThread", id, "dcmFolder");
for (String party : parties) {
String folder = (String) db.getStaticList("dcmThread", id, "dcmFolder", party);
Boolean isread = (Boolean) db.getStaticList("dcmThread", id, "dcmRead", party);
conn.set("dcmThreadA", did, party, folder, revmod, id, isread);
}
/*
*
dcmFolder//Usr/00000_000000000000001/-1485186885395.0427/Data
/Archive
dcmRead//Usr/00000_000000000000001/-1485186871456.041/Data
true
*
*
*/
return true;
}
catch (Exception x) {
log.error("Issue with folder listing: " + x);
}
return false;
}
};
// collect data for this party
db.traverseRecords("dcmThread", when, historical, partyConsumer);
}
catch (Exception x) {
log.error("Issue with record listing: " + x);
}
task.complete();
}
}
|
3e02898cec8f5875ae681d2d1ce7b00fae0b07ec | 8,650 | java | Java | app/src/main/java/in/co/rajkumaar/amritarepo/helpers/Utils.java | yogesh5466/amrita-repository | f489b46848b28f85a2ee36044376de852b0b4aca | [
"Apache-2.0"
]
| null | null | null | app/src/main/java/in/co/rajkumaar/amritarepo/helpers/Utils.java | yogesh5466/amrita-repository | f489b46848b28f85a2ee36044376de852b0b4aca | [
"Apache-2.0"
]
| null | null | null | app/src/main/java/in/co/rajkumaar/amritarepo/helpers/Utils.java | yogesh5466/amrita-repository | f489b46848b28f85a2ee36044376de852b0b4aca | [
"Apache-2.0"
]
| null | null | null | 41.990291 | 133 | 0.664393 | 1,039 | /*
* Copyright (c) 2020 RAJKUMAR S
*/
package in.co.rajkumaar.amritarepo.helpers;
import android.app.Activity;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.Toast;
import androidx.core.app.NotificationCompat;
import androidx.core.content.FileProvider;
import com.google.android.material.snackbar.Snackbar;
import java.io.File;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import in.co.rajkumaar.amritarepo.BuildConfig;
import in.co.rajkumaar.amritarepo.R;
public class Utils {
public static String THEME_LIGHT = "light";
public static String THEME_DARK = "dark";
public static String folderCheck = "Folder";
public static String[] web = {"html", "htm", "mhtml"};
public static String[] computer = {"exe", "dmg", "iso", "msi"};
public static String[] document = {"doc", "docx", "rtf", "odt"};
public static String[] pdf = {"pdf"};
public static String[] powerpoint = {"ppt", "pps", "pptx"};
public static String[] excel = {"xls", "xlsx", "ods"};
public static String[] image = {"png", "gif", "jpg", "jpeg", "bmp"};
public static String[] video = {"mp4", "mp3", "avi", "mov", "mpg", "mkv", "wmv"};
public static String[] compressed = {"rar", "zip", "zipx", "tar", "7z", "gz"};
public static boolean isConnected(Context context) {
try {
ConnectivityManager connectivityManager
= (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
return activeNetworkInfo != null && activeNetworkInfo.isConnected();
} catch (NullPointerException e) {
e.printStackTrace();
return false;
}
}
public static void showSnackBar(Context context, String message) {
View parentLayout = ((Activity) context).findViewById(android.R.id.content);
Snackbar snackbar = Snackbar
.make(parentLayout, message, Snackbar.LENGTH_SHORT);
snackbar.show();
}
public static void hideKeyboard(Context context) {
try {
InputMethodManager inputManager = (InputMethodManager)
context.getSystemService(Context.INPUT_METHOD_SERVICE);
if (inputManager.isAcceptingText())
inputManager.hideSoftInputFromWindow(Objects.requireNonNull(((Activity) context).getCurrentFocus()).getWindowToken(),
InputMethodManager.HIDE_NOT_ALWAYS);
} catch (Exception e) {
e.printStackTrace();
}
}
public static void showUnexpectedError(Context context) {
showToast(context, "An unexpected error occurred. Please try again later.");
}
public static void showInternetError(Context context) {
showSnackBar(context, "Connection unavailable. Please connect to internet");
}
public static void showToast(Context context, String msg) {
Toast.makeText(context, msg, Toast.LENGTH_LONG).show();
}
public static String getUrlWithoutParameters(String url) throws URISyntaxException {
URI uri = new URI(url);
return new URI(uri.getScheme(),
uri.getAuthority(),
uri.getPath(),
null, // Ignore the query part of the input url
uri.getFragment()).toString();
}
public static ArrayList<String> getAcademicYears() {
int currentYear = Calendar.getInstance().get(Calendar.YEAR);
ArrayList<String> years = new ArrayList<>();
years.add("[Choose year]");
for (int i = 4; i > -1; --i) {
years.add((currentYear - i) + "_" + String.valueOf(currentYear - (i - 1)).substring(2, 4));
}
return years;
}
public static HashMap<String, Integer> sortByValue(Map<String, Integer> map) {
List<Map.Entry<String, Integer>> list = new LinkedList<>(map.entrySet());
Collections.sort(list, new Comparator<Map.Entry<String, Integer>>() {
public int compare(Map.Entry<String, Integer> o1, Map.Entry<String, Integer> o2) {
return o1.getValue().compareTo(o2.getValue());
}
});
HashMap<String, Integer> sortedMap = new LinkedHashMap<>();
for (Map.Entry<String, Integer> entry : list) {
sortedMap.put(entry.getKey(), entry.getValue());
}
return sortedMap;
}
private static Intent getFileChooserIntent(Context context, File file) {
Intent intent = new Intent(Intent.ACTION_VIEW);
Uri data = FileProvider.getUriForFile(context, BuildConfig.APPLICATION_ID + ".provider", file);
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.setData(data);
return intent;
}
public static void openFileIntent(Context context, File file) {
Intent fileChooserIntent = getFileChooserIntent(context, file);
if (fileChooserIntent.resolveActivity(context.getPackageManager()) != null)
context.startActivity(fileChooserIntent);
else {
Utils.showToast(context, "Sorry, there's no appropriate app in the device to open this file.");
}
}
public static void showDownloadedNotification(Context context, File file) {
String CHANNEL_ID = "DOWNLOAD_ALERT";
String CHANNEL_NAME = "Show download alert";
Toast.makeText(context, "Downloaded Successfully", Toast.LENGTH_SHORT).show();
Intent fileChooserIntent = getFileChooserIntent(context, file);
PendingIntent pendingIntent = PendingIntent.getActivity(context, 1, fileChooserIntent, PendingIntent.FLAG_UPDATE_CURRENT);
NotificationCompat.Builder notification = new NotificationCompat.Builder(context, CHANNEL_ID)
.setPriority(NotificationCompat.PRIORITY_MAX)
.setSmallIcon(R.drawable.notification)
.setContentTitle(file.getName())
.setContentText("Download complete.")
.setAutoCancel(true)
.setContentIntent(pendingIntent);
NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
if (notificationManager != null) {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
int importance = NotificationManager.IMPORTANCE_HIGH;
NotificationChannel notificationChannel = new NotificationChannel(CHANNEL_ID, CHANNEL_NAME, importance);
notificationChannel.enableLights(true);
notificationChannel.setLightColor(Color.RED);
notificationChannel.enableVibration(true);
notificationChannel.setVibrationPattern(new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400});
notificationManager.createNotificationChannel(notificationChannel);
}
notificationManager.notify(2, notification.build());
}
}
public static boolean isExtension(String[] arr, String targetValue) {
for (String s : arr) {
if (s.equals(targetValue))
return true;
}
return false;
}
public static void clearUnsafeCredentials(Context context) {
SharedPreferences userPrefs = context.getSharedPreferences("user", Context.MODE_PRIVATE);
if (!userPrefs.getBoolean("old_credentials_cleared", false)) {
context.getSharedPreferences("aums-lite", Context.MODE_PRIVATE).edit().clear().apply();
SharedPreferences.Editor oldCredsEditor = userPrefs.edit();
String[] oldCredKeys = {"username", "password", "OPAC_username", "OPAC_password", "encrypted_prefs_value"};
for (String item : oldCredKeys) {
oldCredsEditor.remove(item);
}
oldCredsEditor.putBoolean("old_credentials_cleared", true);
oldCredsEditor.apply();
}
}
}
|
3e0289a8891ad7de5edd676d8c9c757c15aaf663 | 349 | java | Java | src/test/java/eu/giof71/webaudiotagger/WebAudioTaggerApplicationTests.java | GioF71/web-audio-tagger | b62a359e0db6e7bb1ba253514cf906a5f0d474f1 | [
"Apache-2.0"
]
| null | null | null | src/test/java/eu/giof71/webaudiotagger/WebAudioTaggerApplicationTests.java | GioF71/web-audio-tagger | b62a359e0db6e7bb1ba253514cf906a5f0d474f1 | [
"Apache-2.0"
]
| null | null | null | src/test/java/eu/giof71/webaudiotagger/WebAudioTaggerApplicationTests.java | GioF71/web-audio-tagger | b62a359e0db6e7bb1ba253514cf906a5f0d474f1 | [
"Apache-2.0"
]
| null | null | null | 20.529412 | 60 | 0.816619 | 1,040 | package eu.giof71.webaudiotagger;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class WebAudioTaggerApplicationTests {
@Test
public void contextLoads() {
}
}
|
3e0289d90e9ddd6d37cc5124bebc8a695377a1f5 | 2,029 | java | Java | modules/base/project-model-impl/src/main/java/com/intellij/openapi/module/impl/LoadedModuleDescriptionImpl.java | MC-JY/consulo | ebd31008fcfd03e144b46a9408d2842d0b06ffc8 | [
"Apache-2.0"
]
| 634 | 2015-01-01T19:14:25.000Z | 2022-03-22T11:42:50.000Z | modules/base/project-model-impl/src/main/java/com/intellij/openapi/module/impl/LoadedModuleDescriptionImpl.java | MC-JY/consulo | ebd31008fcfd03e144b46a9408d2842d0b06ffc8 | [
"Apache-2.0"
]
| 410 | 2015-01-19T09:57:51.000Z | 2022-03-22T16:24:59.000Z | modules/base/project-model-impl/src/main/java/com/intellij/openapi/module/impl/LoadedModuleDescriptionImpl.java | MC-JY/consulo | ebd31008fcfd03e144b46a9408d2842d0b06ffc8 | [
"Apache-2.0"
]
| 50 | 2015-03-10T04:14:49.000Z | 2022-03-22T07:08:45.000Z | 25.683544 | 93 | 0.726959 | 1,041 | /*
* Copyright 2013-2018 consulo.io
*
* 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.intellij.openapi.module.impl;
import com.intellij.openapi.module.LoadedModuleDescription;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.roots.ModuleRootManager;
import javax.annotation.Nonnull;
import java.util.Arrays;
import java.util.List;
/**
* from kotlin
*/
public class LoadedModuleDescriptionImpl implements LoadedModuleDescription {
private final Module myModule;
public LoadedModuleDescriptionImpl(@Nonnull Module module) {
myModule = module;
}
@Nonnull
@Override
public Module getModule() {
return myModule;
}
@Nonnull
@Override
public String getName() {
return myModule.getName();
}
@Nonnull
@Override
public List<String> getDependencyModuleNames() {
return Arrays.asList(ModuleRootManager.getInstance(myModule).getDependencyModuleNames());
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
LoadedModuleDescriptionImpl that = (LoadedModuleDescriptionImpl)o;
if (!myModule.equals(that.myModule)) return false;
return true;
}
@Override
public int hashCode() {
return myModule.hashCode();
}
@Override
public String toString() {
final StringBuilder sb = new StringBuilder("LoadedModuleDescriptionImpl{");
sb.append("myModule=").append(myModule);
sb.append('}');
return sb.toString();
}
}
|
3e028aaf5b7b3a4b4e416d3450d3afd4505423f7 | 321 | java | Java | server/src/main/java/com/example/demo/repository/SubscriptionRepository.java | youn16/StockLetter | 94077076a7f7ff42defa6ccf0c92e4c20cfcdc62 | [
"MIT"
]
| 2 | 2021-02-08T03:17:50.000Z | 2021-02-08T03:18:15.000Z | server/src/main/java/com/example/demo/repository/SubscriptionRepository.java | youn16/StockLetter | 94077076a7f7ff42defa6ccf0c92e4c20cfcdc62 | [
"MIT"
]
| null | null | null | server/src/main/java/com/example/demo/repository/SubscriptionRepository.java | youn16/StockLetter | 94077076a7f7ff42defa6ccf0c92e4c20cfcdc62 | [
"MIT"
]
| null | null | null | 21.4 | 82 | 0.82866 | 1,042 | package com.example.demo.repository;
import java.util.Optional;
import org.springframework.data.jpa.repository.JpaRepository;
import com.example.demo.entity.Subscription;
public interface SubscriptionRepository extends JpaRepository<Subscription,Long> {
public Subscription findByStockCode(String stockCode);
}
|
3e028b643fcc3c8e25638be3f44d723fd9b0d7f4 | 1,087 | java | Java | osets-eclipse-plugin/src/com/iawg/ecoa/jaxbclasses/step4aCompImpl/TriggerInstance.java | ECOA-developer/Open_Source_ECOA_Toolset_AS5 | 677684a932b5355c990f14317158176977c935e9 | [
"MIT"
]
| 7 | 2017-12-18T15:34:06.000Z | 2022-01-27T17:18:35.000Z | osets-eclipse-plugin/src/com/iawg/ecoa/jaxbclasses/step4aCompImpl/TriggerInstance.java | ECOA-developer/Open_Source_ECOA_Toolset_AS5 | 677684a932b5355c990f14317158176977c935e9 | [
"MIT"
]
| 8 | 2018-01-18T14:29:10.000Z | 2021-03-17T05:26:09.000Z | osets-eclipse-plugin/src/com/iawg/ecoa/jaxbclasses/step4aCompImpl/TriggerInstance.java | ECOA-developer/Open_Source_ECOA_Toolset_AS5 | 677684a932b5355c990f14317158176977c935e9 | [
"MIT"
]
| 8 | 2018-02-13T20:28:35.000Z | 2021-04-10T22:02:24.000Z | 28.605263 | 122 | 0.721251 | 1,043 | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2016.07.20 at 08:12:06 AM BST
//
package com.iawg.ecoa.jaxbclasses.step4aCompImpl;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>
* Java class for TriggerInstance complex type.
*
* <p>
* The following schema fragment specifies the expected content contained within
* this class.
*
* <pre>
* <complexType name="TriggerInstance">
* <complexContent>
* <extension base="{http://www.ecoa.technology/implementation-1.0}Instance">
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "TriggerInstance")
public class TriggerInstance extends Instance {
}
|
3e028c0193c04c5eecc0228b002ae95ecce2c226 | 11,514 | java | Java | jresources-core/src/main/java/com/soeima/resources/util/Paths.java | msoeima/java-resources | b4a23e0398023b15652cc82ca04300bb6db3cce7 | [
"Apache-2.0"
]
| 1 | 2020-12-01T11:38:04.000Z | 2020-12-01T11:38:04.000Z | jresources-core/src/main/java/com/soeima/resources/util/Paths.java | msoeima/java-resources | b4a23e0398023b15652cc82ca04300bb6db3cce7 | [
"Apache-2.0"
]
| null | null | null | jresources-core/src/main/java/com/soeima/resources/util/Paths.java | msoeima/java-resources | b4a23e0398023b15652cc82ca04300bb6db3cce7 | [
"Apache-2.0"
]
| null | null | null | 31.820442 | 121 | 0.553694 | 1,044 | /*
* Copyright 2012 Marco Soeima
*
* 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.soeima.resources.util;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* Provides static convenience methods that are to be used when dealing with paths.
*
* @author <a href="mailto:[email protected]">Marco Soeima</a>
* @version 2012/09/25
*/
public class Paths {
/**
* Creates a new {@link Paths} object.
*/
private Paths() {
}
/**
* Places a "." at the beginning of the given <code>name</code>.
*
* @param name The name to prefix with a ".".
*
* @return The name with a "." at the beginning or <code>null</code> if <code>name</code> is <code>null</code>.
*/
public static String prefixDot(String name) {
if (name == null) {
return null;
}
return (name.startsWith(".")) ? name : ("." + name);
}
/**
* *
*
* @param path
*
* @return boolean
*/
public static boolean hasSlash(String path) {
if (path == null) {
return false;
}
return path.startsWith("/") || path.startsWith("\\");
}
/**
* *
*
* @param path
*
* @return boolean
*/
public static boolean hasTrailingSlash(String path) {
if (path == null) {
return false;
}
return path.endsWith("/") || path.endsWith("\\");
}
/**
* *
*
* @param path
*
* @return String
*/
public static String stripLeadingSlash(String path) {
if (path == null) {
return null;
}
return hasSlash(path) ? path.substring(1) : path;
}
/**
* *
*
* @param path
*
* @return String
*/
public static String stripTrailingSlash(String path) {
if (path == null) {
return null;
}
return hasTrailingSlash(path) ? path.substring(0, path.length() - 1) : path;
}
/**
* Prefixes a slash at the beginning of the <code>path</code>. The prefixes slash is in accordance with the system
* {@link File#separator}.
*
* @param path The path to which the slash is to be prefixed.
*
* @return A slash-prefixed <code>path</code> or <code>null</code> if <code>path</code> is <code>null</code>.
*/
public static String leadingSlash(String path) {
return leadingSlash(path, File.separatorChar);
}
/**
* Prefixes the <code>slash</code> at the beginning of the <code>path</code>.
*
* @param path The path to which the slash is to be prefixed.
* @param slash One of '/' or an '\'.
*
* @return A slash-prefixed <code>path</code> or <code>null</code> if <code>path</code> is <code>null</code>.
*/
public static String leadingSlash(String path, char slash) {
if (path == null) {
return null;
}
return hasSlash(path) ? path : join("", slash, path);
}
/**
* Joins the <code>base</code> path to <code>path</code>. The separator used is defined by {@link
* File#separatorChar}.
*
* @param base The base path.
* @param paths The paths to append to the base path, in the order in which the are passed.
*
* @return A new path resulting from joining the <code>base</code> to <code>paths</code> or <code>null</code> if
* either <code>base</code> or <code>paths</code> is <code>null</code>.
*/
public static String join(String base, String... paths) {
return join(base, File.separatorChar, paths);
}
/**
* Joins the <code>base</code> path to <code>path</code>, using <code>slash</code> as the separator.
*
* @param base The base path.
* @param slash One of '/' or '\'.
* @param paths The paths to append to the base path, in the order in which the are passed.
*
* @return A new path resulting from joining the <code>base</code> to <code>paths</code> or <code>null</code> if
* either <code>base</code> or <code>paths</code> is <code>null</code>.
*/
public static String join(String base, char slash, String... paths) {
if ((base == null) || (paths == null)) {
return null;
}
List<String> strings = new ArrayList<String>();
strings.add(stripTrailingSlash(base));
for (String path : paths) {
strings.add(stripLeadingSlash(path));
}
return Strings.join(strings, Character.toString(slash));
}
/**
* Splits the <code>path</code> into its various components.
*
* @param path The path to split.
*
* @return A list of path components or an empty list if <code>path</code> is <code>null</code>.
*/
public static List<String> split(String path) {
if (path == null) {
return Collections.emptyList();
}
return Strings.split(normalize(path, '/'), "/");
}
/**
* Returns <code>true</code> if <code>fileName</code>'s extension matches any of the given <code>extensions</code>.
*
* @param fileName The file name to check.
* @param extensions The extensions to check against the <code>fileName</code>.
*
* @return <code>true</code> if <code>fileName</code>'s extension matches any of the given <code>extensions</code>;
* <code>false</code> otherwise.
*/
public static boolean isExtension(String fileName, String... extensions) {
if ((fileName == null) || (extensions == null)) {
return false;
}
for (String extension : extensions) {
if (fileName.endsWith(prefixDot(extension))) {
return true;
}
}
return false;
}
/**
* Returns the given <code>path</code>'s base name.
*
* @param path The path whose base name is to be returned.
*
* @return The <code>path</code> base name or <code>null</code> if <code>path</code> is <code>null</code>.
*/
public static String getBaseName(String path) {
if (path == null) {
return null;
}
return new File(path).getName();
}
/**
* Returns the given <code>path</code>'s parent path.
*
* @param path The path whose parent path is to be returned.
*
* @return <code>path</code>'s parent path, an empty string if <code>path</code> does not have a parent path or
* <code>null</code> if <code>path</code> is <code>null</code>.
*/
public static String getParentPath(String path) {
if (path == null) {
return null;
}
String parentPath = new File(path).getParent();
return (parentPath != null) ? parentPath : "";
}
/**
* Normalizes the given <code>path</code> by converting its path separator to either '/' or '\'.
*
* @param path The path whose separators are to be converted to either '\' or '/'.
* @param separator Either '\' or '/'.
*
* @return A normalized path or <code>null</code> if <code>path</code> is <code>null</code> or <code>
* separator</code> is not either '/' or '\'.
*/
public static String normalize(String path, char separator) {
if ((path == null) || ((separator != '/') && (separator != '\\'))) {
return null;
}
return path.replace((separator == '/') ? '\\' : '/', separator);
}
/**
* Strips the given <code>root</code> path from the <code>path</code>.
*
* @param path The path whose <code>root</code> path is to be stripped.
* @param root The root path to strip from the <code>path</code>.
*
* @return A stripped <code>path</code> or an empty string if <code>root</code> is not contained in <code>
* path</code> or <code>null</code> if either <code>path</code> or <code>root</code> are <code>null</code>.
*/
public static String stripParentPath(String path, String root) {
if ((path == null) || (root == null)) {
return (path == null) ? root : path;
}
return startsWithNormalized(path, root) ? stripLeadingSlash(path.substring(root.length())) : "";
}
/**
* Normalizes both <code>path1</code> and <code>path2</code> and then tests if the first is equal to the second.
*
* @param path1 The first path to test.
* @param path2 The second path to test.
*
* @return <code>true</code> if <code>path1</code> and <code>path2</code> are equal.
*/
public static boolean equalsNormalized(String path1, String path2) {
if (path1 == path2) {
return true;
}
return normalize(path1, '/').equals(normalize(path2, '/'));
}
/**
* Normalizes both <code>path1</code> and <code>path2</code> and then tests if the first starts with the second.
*
* @param path1 The path to test.
* @param path2 The end part of<code>path1</code>.
*
* @return <code>true</code> if <code>path1</code> ends with <code>path2</code>.
*/
public static boolean startsWithNormalized(String path1, String path2) {
return normalize(path1, '/').startsWith(normalize(path2, '/'));
}
/**
* Normalizes both <code>path1</code> and <code>path2</code> and then tests if the first ends with the second.
*
* @param path1 The path to test.
* @param path2 The end part of <code>path1</code>.
*
* @return <code>true</code> if <code>path1</code> ends with <code>path2</code>.
*/
public static boolean endsWithNormalized(String path1, String path2) {
if ((path1 == null) || (path2 == null)) {
return false;
}
return normalize(leadingSlash(path1), '/').endsWith(normalize(leadingSlash(path2), '/'));
}
/**
* Checks if the paths <code>path1</code> and <code>path2</code> are equals.
*
* @param path1 The first path to check for equality.
* @param path2 The second path to check for equality.
*
* @return <code>true</code> if the paths are equal; <code>false</code> otherwise.
*/
public static boolean equals(String path1, String path2) {
if ((path1 == null) || (path2 == null)) {
return path1 == path2;
}
return normalize(path1, '/').equals(normalize(path2, '/'));
}
} // end class Paths
|
3e028cffd87e36331b58dde07c6d9a02b32fc598 | 5,051 | java | Java | tool/visualtest/java/com/acunia/wonka/test/awt/Graphics/DriveCar.java | kifferltd/open-mika | 079bcf51dce9442deee2cc728ee1d4a303f738ed | [
"ICU"
]
| 41 | 2015-05-14T12:03:18.000Z | 2021-11-28T20:18:59.000Z | tool/visualtest/java/com/acunia/wonka/test/awt/Graphics/DriveCar.java | kifferltd/open-mika | 079bcf51dce9442deee2cc728ee1d4a303f738ed | [
"ICU"
]
| 11 | 2015-04-11T10:45:33.000Z | 2020-12-14T18:08:58.000Z | tool/visualtest/java/com/acunia/wonka/test/awt/Graphics/DriveCar.java | kifferltd/open-mika | 079bcf51dce9442deee2cc728ee1d4a303f738ed | [
"ICU"
]
| 9 | 2016-05-05T15:19:17.000Z | 2021-07-13T11:35:45.000Z | 33.217105 | 104 | 0.485047 | 1,045 | /**************************************************************************
* Copyright (c) 2001 by Acunia N.V. All rights reserved. *
* *
* This software is copyrighted by and is the sole property of Acunia N.V. *
* and its licensors, if any. All rights, title, ownership, or other *
* interests in the software remain the property of Acunia N.V. and its *
* licensors, if any. *
* *
* This software may only be used in accordance with the corresponding *
* license agreement. Any unauthorized use, duplication, transmission, *
* distribution or disclosure of this software is expressly forbidden. *
* *
* This Copyright notice may not be removed or modified without prior *
* written consent of Acunia N.V. *
* *
* Acunia N.V. reserves the right to modify this software without notice. *
* *
* Acunia N.V. *
* Vanden Tymplestraat 35 [email protected] *
* 3000 Leuven http://www.acunia.com *
* Belgium - EUROPE *
**************************************************************************/
// Author: J. Vandeneede
// Created: 2001/05/18
package com.acunia.wonka.test.awt.Graphics;
import java.awt.*;
import com.acunia.wonka.test.awt.*;
public class DriveCar extends VisualTestImpl {
class Place extends Panel implements Runnable {
Image bgBuffer = null;
Image carImage = null;
Graphics g1 = null;
int x=0;
int y=10000;
int xo=0;
int yo=0;
boolean stop = false;
Place(int width, int height, Color background) {
this.setSize(width, height);
this.setBackground(background);
carImage = Toolkit.getDefaultToolkit().createImage(this.getClass().getResource("/car-image.png"));
}
public void update(Graphics g) {
paint(g);
}
public void paint(Graphics g) {
int w = carImage.getWidth(null);
int h = carImage.getHeight(null);
if (bgBuffer == null
|| bgBuffer.getWidth(null) != w
|| bgBuffer.getHeight(null) != h) {
bgBuffer = this.createImage(w,h);
if (bgBuffer != null) {
g1 = bgBuffer.getGraphics();
g1.clearRect(0,0,w, h);
g.clearRect(0,0,this.getBounds().width,this.getBounds().height);
}
}
if (bgBuffer != null) {
g.drawImage(bgBuffer, xo, yo, xo+w-1, yo+h-1, 0, 0, w-1, h-1, null);
g.drawImage(carImage, x, y, null);
}
}
public void run() {
int xb = 0;
int yb = 0;
int xStep = -4;
int yStep = 1;
int xe = 0;
int xtest = 400;
try {
while (xb == 0 || /*yb == 0 ||*/ xe == 0 || xtest != xb) {
if (xb!=0) xtest=xb; // this.getBounds() seems to need time to stabilize
Thread.sleep(100);
xb = this.getBounds().width-1;
yb = 0;//-carImage.getHeight(null)/4;
xe = -carImage.getWidth(null);
}
x = xb;
y = yb;
// System.out.println("x1="+x1+" y1="+y1+" xStep="+xStep);
while (!stop) {
// System.out.println(" x="+x+" y="+y);
this.repaint();
Thread.sleep(40);
xo=x;
yo=y;
x += xStep;
y += yStep;
if (x <= xe) {
x = xb;
y = yb;
}
}
}
catch (/*Interrupted*/Exception e) {
System.out.println("caught unwanted Exception "+e);
e.printStackTrace();
}
}
}
public DriveCar() {}
public String getHelpText(){
return ("To be successful, this test should show a white background, a red moving Corvette with a" +
"white label \"ACUNIA\" on it, the Corvette should move diagonally from the upper right " +
"corner of your screen, to its lower left corner. The car disappears bit by bit at the " +
"left border of the screen, and then re-appears bit by bit at the right border.");
}
public Panel getPanel(VisualTester vte) {
vt = vte;
return new Place(getBounds().width, getBounds().height, Color.white);
}
public void start(java.awt.Panel p, boolean autorun){
try {
(new Thread((Place)p,"DriveCar Thread")).start();
}
catch(ClassCastException cce) {}
}
public void stop(java.awt.Panel p){
try {
((Place)p).stop = true;
}
catch(ClassCastException cce) {}
}
static public void main(String[] args) {
new DriveCar();
}
}
|
3e028d5a591cf388481926603e65cc82bf004f12 | 395 | java | Java | src/main/java/com/tui/proof/dto/request/UpdateOrderRequest.java | FedeSkia/backend-technical-test-v2 | fb82128b1d57b20d4b6868200a0cac022018c418 | [
"Apache-2.0"
]
| null | null | null | src/main/java/com/tui/proof/dto/request/UpdateOrderRequest.java | FedeSkia/backend-technical-test-v2 | fb82128b1d57b20d4b6868200a0cac022018c418 | [
"Apache-2.0"
]
| null | null | null | src/main/java/com/tui/proof/dto/request/UpdateOrderRequest.java | FedeSkia/backend-technical-test-v2 | fb82128b1d57b20d4b6868200a0cac022018c418 | [
"Apache-2.0"
]
| null | null | null | 20.789474 | 62 | 0.782278 | 1,046 | package com.tui.proof.dto.request;
import com.tui.proof.validator.NumberOfPilotesOrderConstraint;
import lombok.Data;
import javax.validation.constraints.NotNull;
@Data
public class UpdateOrderRequest {
@NotNull(message = "orderId must not be null")
private Integer orderId;
@NumberOfPilotesOrderConstraint
private Integer numberOfPilotes;
private Integer addressId;
}
|
3e028d5d1abefcb6ccb0acdef7d1035178c49998 | 407 | java | Java | src/main/java/com/github/zaplatynski/testing/FrameworkMethodComparator.java | zaplatynski/junit-random-runner | d56c9c5444763eeba23d5d9de5e5078c075cbc90 | [
"Apache-2.0"
]
| null | null | null | src/main/java/com/github/zaplatynski/testing/FrameworkMethodComparator.java | zaplatynski/junit-random-runner | d56c9c5444763eeba23d5d9de5e5078c075cbc90 | [
"Apache-2.0"
]
| null | null | null | src/main/java/com/github/zaplatynski/testing/FrameworkMethodComparator.java | zaplatynski/junit-random-runner | d56c9c5444763eeba23d5d9de5e5078c075cbc90 | [
"Apache-2.0"
]
| null | null | null | 22.611111 | 81 | 0.77887 | 1,047 | package com.github.zaplatynski.testing;
import org.junit.runners.model.FrameworkMethod;
import java.util.Comparator;
/**
* The type Framework method comparator.
*/
public class FrameworkMethodComparator implements Comparator<FrameworkMethod> {
@Override
public int compare(final FrameworkMethod first, final FrameworkMethod second) {
return first.getName().compareTo(second.getName());
}
}
|
3e028d9ce737423c8ba301c9dbfee6f6ca0d0b76 | 2,727 | java | Java | aws-java-sdk-customerprofiles/src/main/java/com/amazonaws/services/customerprofiles/model/transform/ListProfileObjectsItemMarshaller.java | ericvincent83/aws-sdk-java | c491416f3ea9411a04d9bafedee6c6874a79e48d | [
"Apache-2.0"
]
| 3,372 | 2015-01-03T00:35:43.000Z | 2022-03-31T15:56:24.000Z | aws-java-sdk-customerprofiles/src/main/java/com/amazonaws/services/customerprofiles/model/transform/ListProfileObjectsItemMarshaller.java | ericvincent83/aws-sdk-java | c491416f3ea9411a04d9bafedee6c6874a79e48d | [
"Apache-2.0"
]
| 2,391 | 2015-01-01T12:55:24.000Z | 2022-03-31T08:01:50.000Z | aws-java-sdk-customerprofiles/src/main/java/com/amazonaws/services/customerprofiles/model/transform/ListProfileObjectsItemMarshaller.java | ericvincent83/aws-sdk-java | c491416f3ea9411a04d9bafedee6c6874a79e48d | [
"Apache-2.0"
]
| 2,876 | 2015-01-01T14:38:37.000Z | 2022-03-29T19:53:10.000Z | 43.983871 | 156 | 0.758343 | 1,048 | /*
* Copyright 2016-2021 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.customerprofiles.model.transform;
import javax.annotation.Generated;
import com.amazonaws.SdkClientException;
import com.amazonaws.services.customerprofiles.model.*;
import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;
/**
* ListProfileObjectsItemMarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class ListProfileObjectsItemMarshaller {
private static final MarshallingInfo<String> OBJECTTYPENAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("ObjectTypeName").build();
private static final MarshallingInfo<String> PROFILEOBJECTUNIQUEKEY_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("ProfileObjectUniqueKey").build();
private static final MarshallingInfo<String> OBJECT_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("Object").build();
private static final ListProfileObjectsItemMarshaller instance = new ListProfileObjectsItemMarshaller();
public static ListProfileObjectsItemMarshaller getInstance() {
return instance;
}
/**
* Marshall the given parameter object.
*/
public void marshall(ListProfileObjectsItem listProfileObjectsItem, ProtocolMarshaller protocolMarshaller) {
if (listProfileObjectsItem == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(listProfileObjectsItem.getObjectTypeName(), OBJECTTYPENAME_BINDING);
protocolMarshaller.marshall(listProfileObjectsItem.getProfileObjectUniqueKey(), PROFILEOBJECTUNIQUEKEY_BINDING);
protocolMarshaller.marshall(listProfileObjectsItem.getObject(), OBJECT_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
}
|
3e028d9d911067c8e418d0c1b450b1b8d422919b | 4,424 | java | Java | dss-appconn/appconns/dss-visualis-appconn/src/main/java/com/webank/wedatasphere/dss/appconn/visualis/operation/VisualisRefQueryOperation.java | gaoyan098712/DataSphereStudio | 5f3e8fc0685d743c72d0acb74dbebc451a4be682 | [
"Apache-2.0"
]
| 2,071 | 2019-11-24T13:59:45.000Z | 2022-03-31T03:53:03.000Z | dss-appconn/appconns/dss-visualis-appconn/src/main/java/com/webank/wedatasphere/dss/appconn/visualis/operation/VisualisRefQueryOperation.java | gaoyan098712/DataSphereStudio | 5f3e8fc0685d743c72d0acb74dbebc451a4be682 | [
"Apache-2.0"
]
| 380 | 2019-11-27T10:31:40.000Z | 2022-03-31T08:12:03.000Z | dss-appconn/appconns/dss-visualis-appconn/src/main/java/com/webank/wedatasphere/dss/appconn/visualis/operation/VisualisRefQueryOperation.java | gaoyan098712/DataSphereStudio | 5f3e8fc0685d743c72d0acb74dbebc451a4be682 | [
"Apache-2.0"
]
| 790 | 2019-11-24T14:01:19.000Z | 2022-03-30T05:13:55.000Z | 56.717949 | 188 | 0.758137 | 1,049 | /*
* Copyright 2019 WeBank
* 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.webank.wedatasphere.dss.appconn.visualis.operation;
import com.webank.wedatasphere.dss.appconn.visualis.ref.VisualisCommonResponseRef;
import com.webank.wedatasphere.dss.appconn.visualis.ref.VisualisOpenRequestRef;
import com.webank.wedatasphere.dss.appconn.visualis.ref.VisualisOpenResponseRef;
import com.webank.wedatasphere.dss.appconn.visualis.utils.URLUtils;
import com.webank.wedatasphere.dss.common.utils.DSSCommonUtils;
import com.webank.wedatasphere.dss.standard.app.development.operation.RefQueryOperation;
import com.webank.wedatasphere.dss.standard.app.development.ref.OpenRequestRef;
import com.webank.wedatasphere.dss.standard.app.development.service.DevelopmentService;
import com.webank.wedatasphere.dss.standard.common.entity.ref.ResponseRef;
import com.webank.wedatasphere.dss.standard.common.exception.operation.ExternalOperationFailedException;
import com.webank.wedatasphere.linkis.server.BDPJettyServerHelper;
import java.util.HashMap;
import java.util.Map;
public class VisualisRefQueryOperation implements RefQueryOperation<OpenRequestRef> {
DevelopmentService developmentService;
@Override
public ResponseRef query(OpenRequestRef ref) throws ExternalOperationFailedException {
VisualisOpenRequestRef visualisOpenRequestRef = (VisualisOpenRequestRef) ref;
try {
String externalContent = BDPJettyServerHelper.jacksonJson().writeValueAsString(visualisOpenRequestRef.getJobContent());
Long projectId = (Long) visualisOpenRequestRef.getParameter("projectId");
String baseUrl = visualisOpenRequestRef.getParameter("redirectUrl").toString();
String jumpUrl = baseUrl;
if("linkis.appconn.visualis.widget".equalsIgnoreCase(visualisOpenRequestRef.getType())){
VisualisCommonResponseRef widgetCreateResponseRef = new VisualisCommonResponseRef(externalContent);
jumpUrl = URLUtils.getUrl(baseUrl, URLUtils.WIDGET_JUMP_URL_FORMAT, projectId.toString(), widgetCreateResponseRef.getWidgetId());
} else if("linkis.appconn.visualis.display".equalsIgnoreCase(visualisOpenRequestRef.getType())){
VisualisCommonResponseRef displayCreateResponseRef = new VisualisCommonResponseRef(externalContent);
jumpUrl = URLUtils.getUrl(baseUrl, URLUtils.DISPLAY_JUMP_URL_FORMAT, projectId.toString(), displayCreateResponseRef.getDisplayId());
}else if("linkis.appconn.visualis.dashboard".equalsIgnoreCase(visualisOpenRequestRef.getType())){
VisualisCommonResponseRef dashboardCreateResponseRef = new VisualisCommonResponseRef(externalContent);
jumpUrl = URLUtils.getUrl(baseUrl, URLUtils.DASHBOARD_JUMP_URL_FORMAT, projectId.toString(), dashboardCreateResponseRef.getDashboardId(), visualisOpenRequestRef.getName());
} else {
throw new ExternalOperationFailedException(90177, "Unknown task type " + visualisOpenRequestRef.getType(), null);
}
String retJumpUrl = getEnvUrl(jumpUrl, visualisOpenRequestRef);
Map<String,String> retMap = new HashMap<>();
retMap.put("jumpUrl",retJumpUrl);
return new VisualisOpenResponseRef(DSSCommonUtils.COMMON_GSON.toJson(retMap), 0);
} catch (Exception e) {
throw new ExternalOperationFailedException(90177, "Failed to parse jobContent ", e);
}
}
public String getEnvUrl(String url, VisualisOpenRequestRef visualisOpenRequestRef ){
String env = ((Map<String, Object>) visualisOpenRequestRef.getParameter("params")).get(DSSCommonUtils.DSS_LABELS_KEY).toString();
return url + "?env=" + env.toLowerCase();
}
@Override
public void setDevelopmentService(DevelopmentService service) {
this.developmentService = service;
}
}
|
3e028e2c027528a65c2d841752c5f3ac1b0e5d1e | 235 | java | Java | src/main/java/yuown/isee/jpa/repository/ApplicationRepository.java | yuown/iseestaffingsolutions | 06b2a186725dcb0bda51127408761d78e085a14b | [
"Apache-2.0"
]
| null | null | null | src/main/java/yuown/isee/jpa/repository/ApplicationRepository.java | yuown/iseestaffingsolutions | 06b2a186725dcb0bda51127408761d78e085a14b | [
"Apache-2.0"
]
| null | null | null | src/main/java/yuown/isee/jpa/repository/ApplicationRepository.java | yuown/iseestaffingsolutions | 06b2a186725dcb0bda51127408761d78e085a14b | [
"Apache-2.0"
]
| null | null | null | 23.5 | 86 | 0.808511 | 1,051 | package yuown.isee.jpa.repository;
import org.springframework.stereotype.Repository;
import yuown.isee.entity.Application;
@Repository
public interface ApplicationRepository extends BaseRepository<Application, Integer> {
} |
3e028edd0ee6002cccc86dee4187f8729808d617 | 3,988 | java | Java | zhglxt-common/src/main/java/com/zhglxt/common/util/html/EscapeUtil.java | liuwy-dlsdys/zhglxt | a0590036c2a6d638dc81019f9ecfde308dae9d8d | [
"MIT"
]
| 3 | 2021-11-06T02:45:32.000Z | 2021-12-03T07:13:26.000Z | zhglxt-common/src/main/java/com/zhglxt/common/util/html/EscapeUtil.java | liuwy-dlsdys/zhglxt | a0590036c2a6d638dc81019f9ecfde308dae9d8d | [
"MIT"
]
| null | null | null | zhglxt-common/src/main/java/com/zhglxt/common/util/html/EscapeUtil.java | liuwy-dlsdys/zhglxt | a0590036c2a6d638dc81019f9ecfde308dae9d8d | [
"MIT"
]
| 1 | 2022-01-08T13:40:13.000Z | 2022-01-08T13:40:13.000Z | 28.084507 | 97 | 0.460381 | 1,052 | package com.zhglxt.common.util.html;
import com.zhglxt.common.util.StringUtils;
/**
* 转义和反转义工具类
*
* @author ruoyi
* @version 2019年9月30日 下午9:31:26
*/
public class EscapeUtil {
public static final String RE_HTML_MARK = "(<[^<]*?>)|(<[\\s]*?/[^<]*?>)|(<[^<]*?/[\\s]*?>)";
private static final char[][] TEXT = new char[64][];
static {
for (int i = 0; i < 64; i++) {
TEXT[i] = new char[]{(char) i};
}
// special HTML characters
TEXT['\''] = "'".toCharArray(); // 单引号
TEXT['"'] = """.toCharArray(); // 双引号
TEXT['&'] = "&".toCharArray(); // &符
TEXT['<'] = "<".toCharArray(); // 小于号
TEXT['>'] = ">".toCharArray(); // 大于号
}
/**
* 转义文本中的HTML字符为安全的字符
*
* @param text 被转义的文本
* @return 转义后的文本
*/
public static String escape(String text) {
return encode(text);
}
/**
* 还原被转义的HTML特殊字符
*
* @param content 包含转义符的HTML内容
* @return 转换后的字符串
*/
public static String unescape(String content) {
return decode(content);
}
/**
* 清除所有HTML标签,但是不删除标签内的内容
*
* @param content 文本
* @return 清除标签后的文本
*/
public static String clean(String content) {
return new HTMLFilter().filter(content);
}
/**
* Escape编码
*
* @param text 被编码的文本
* @return 编码后的字符
*/
private static String encode(String text) {
if (StringUtils.isEmpty(text)){
return StringUtils.EMPTY;
}
final StringBuilder tmp = new StringBuilder(text.length() * 6);
char c;
for (int i = 0; i < text.length(); i++) {
c = text.charAt(i);
if (c < 256) {
tmp.append("%");
if (c < 16)
{
tmp.append("0");
}
tmp.append(Integer.toString(c, 16));
} else {
tmp.append("%u");
if (c <= 0xfff)
{
// issue#I49JU8@Gitee
tmp.append("0");
}
tmp.append(Integer.toString(c, 16));
}
}
return tmp.toString();
}
/**
* Escape解码
*
* @param content 被转义的内容
* @return 解码后的字符串
*/
public static String decode(String content) {
if (StringUtils.isEmpty(content)) {
return content;
}
StringBuilder tmp = new StringBuilder(content.length());
int lastPos = 0, pos = 0;
char ch;
while (lastPos < content.length()) {
pos = content.indexOf("%", lastPos);
if (pos == lastPos) {
if (content.charAt(pos + 1) == 'u') {
ch = (char) Integer.parseInt(content.substring(pos + 2, pos + 6), 16);
tmp.append(ch);
lastPos = pos + 6;
} else {
ch = (char) Integer.parseInt(content.substring(pos + 1, pos + 3), 16);
tmp.append(ch);
lastPos = pos + 3;
}
} else {
if (pos == -1) {
tmp.append(content.substring(lastPos));
lastPos = content.length();
} else {
tmp.append(content.substring(lastPos, pos));
lastPos = pos;
}
}
}
return tmp.toString();
}
public static void main(String[] args) {
String html = "<script>alert(1);</script>";
String escape = EscapeUtil.escape(html);
// String html = "<scr<script>ipt>alert(\"XSS\")</scr<script>ipt>";
// String html = "<123";
// String html = "123>";
System.out.println("clean: " + EscapeUtil.clean(html));
System.out.println("escape: " + escape);
System.out.println("unescape: " + EscapeUtil.unescape(escape));
}
} |
3e028f5e9dbf05fd2783eb1cd60697bcba6ee833 | 681 | java | Java | src/main/java/ExternalLib/JackInTheBotLib/util/HolonomicDriveSignal.java | northwoodrobotics-user/Swerve-Rewrite-2022 | e3184df6e42cc6463619ecd1f027f9b69af7417d | [
"BSD-3-Clause"
]
| null | null | null | src/main/java/ExternalLib/JackInTheBotLib/util/HolonomicDriveSignal.java | northwoodrobotics-user/Swerve-Rewrite-2022 | e3184df6e42cc6463619ecd1f027f9b69af7417d | [
"BSD-3-Clause"
]
| null | null | null | src/main/java/ExternalLib/JackInTheBotLib/util/HolonomicDriveSignal.java | northwoodrobotics-user/Swerve-Rewrite-2022 | e3184df6e42cc6463619ecd1f027f9b69af7417d | [
"BSD-3-Clause"
]
| null | null | null | 24.321429 | 94 | 0.706314 | 1,053 | package ExternalLib.JackInTheBotLib.util;
import ExternalLib.JackInTheBotLib.math.Vector2;
public class HolonomicDriveSignal {
private final Vector2 translation;
private final double rotation;
private final boolean fieldOriented;
public HolonomicDriveSignal(Vector2 translation, double rotation, boolean fieldOriented) {
this.translation = translation;
this.rotation = rotation;
this.fieldOriented = fieldOriented;
}
public Vector2 getTranslation() {
return translation;
}
public double getRotation() {
return rotation;
}
public boolean isFieldOriented() {
return fieldOriented;
}
}
|
3e0290caa6b93b68bacc66ab47f31d45269127fe | 2,716 | java | Java | src/main/java/com/saucedo/molino_json_models/personal/JEmpleado.java | User0608/molino_json_models | eb2d9906edee3766f4ce8b3bd38a95a4342b6b3e | [
"MIT"
]
| null | null | null | src/main/java/com/saucedo/molino_json_models/personal/JEmpleado.java | User0608/molino_json_models | eb2d9906edee3766f4ce8b3bd38a95a4342b6b3e | [
"MIT"
]
| null | null | null | src/main/java/com/saucedo/molino_json_models/personal/JEmpleado.java | User0608/molino_json_models | eb2d9906edee3766f4ce8b3bd38a95a4342b6b3e | [
"MIT"
]
| null | null | null | 23.824561 | 104 | 0.683358 | 1,054 | package com.saucedo.molino_json_models.personal;
import java.time.LocalDate;
import com.saucedo.molino_json_models.security.JUsuario;
public class JEmpleado {
private Long id;
private String nombre;
private String apellidoPaterno;
private String apellidoMaterno;
private String dni;
private String telefon;
private String direccion;
private String email;
private double sueldo;
private LocalDate fechaContrato;
private boolean estado;
private JUsuario usuario;
public JEmpleado() {
this.fechaContrato= LocalDate.now();
this.estado=true;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getNombre() {
return nombre;
}
public void setNombre(String nombre) {
this.nombre = nombre;
}
public String getApellidoPaterno() {
return apellidoPaterno;
}
public void setApellidoPaterno(String apellidoPaterno) {
this.apellidoPaterno = apellidoPaterno;
}
public String getApellidoMaterno() {
return apellidoMaterno;
}
public void setApellidoMaterno(String apellidoMaterno) {
this.apellidoMaterno = apellidoMaterno;
}
public String getDni() {
return dni;
}
public void setDni(String dni) {
this.dni = dni;
}
public String getTelefon() {
return telefon;
}
public void setTelefon(String telefon) {
this.telefon = telefon;
}
public String getDireccion() {
return direccion;
}
public void setDireccion(String direccion) {
this.direccion = direccion;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public double getSueldo() {
return sueldo;
}
public void setSueldo(double sueldo) {
this.sueldo = sueldo;
}
public LocalDate getFechaContrato() {
return fechaContrato;
}
public void setFechaContrato(LocalDate fechaContrato) {
this.fechaContrato = fechaContrato;
}
public boolean isEstado() {
return estado;
}
public void setEstado(boolean estado) {
this.estado = estado;
}
public JUsuario getUsuario() {
return usuario;
}
public void setUsuario(JUsuario usuario) {
this.usuario = usuario;
}
public String completeName() {
return this.nombre+" "+this.apellidoPaterno+" "+this.apellidoMaterno;
}
@Override
public String toString() {
return "JEmpleado [id=" + id + ", nombre=" + nombre + ", apellidoPaterno=" + apellidoPaterno
+ ", apellidoMaterno=" + apellidoMaterno + ", dni=" + dni + ", telefon=" + telefon + ", direccion="
+ direccion + ", email=" + email + ", sueldo=" + sueldo + ", fechaContrato=" + fechaContrato
+ ", estado=" + estado + ", usuario=" + usuario + "]";
}
}
|
3e02915e0ac4045188759fb47c3d3c3d80acafcc | 229,346 | java | Java | tests/generations/qmosa/tests/s1012/80_wheelwebtool/evosuite-tests/wheel/components/Component_ESTest.java | sealuzh/termite-replication | 1636b1973c8692ed6a818e323cd1dd826cabbad3 | [
"MIT"
]
| null | null | null | tests/generations/qmosa/tests/s1012/80_wheelwebtool/evosuite-tests/wheel/components/Component_ESTest.java | sealuzh/termite-replication | 1636b1973c8692ed6a818e323cd1dd826cabbad3 | [
"MIT"
]
| 3 | 2020-11-16T20:40:56.000Z | 2021-03-23T00:18:04.000Z | tests/generations/qmosa/tests/s1012/80_wheelwebtool/evosuite-tests/wheel/components/Component_ESTest.java | sealuzh/termite-replication | 1636b1973c8692ed6a818e323cd1dd826cabbad3 | [
"MIT"
]
| null | null | null | 30.984329 | 243 | 0.626063 | 1,055 | /*
* This file was automatically generated by EvoSuite
* Tue Nov 10 23:39:01 GMT 2020
*/
package wheel.components;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import java.nio.CharBuffer;
import java.time.Instant;
import java.time.LocalDate;
import java.util.Calendar;
import java.util.List;
import java.util.Locale;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.evosuite.runtime.mock.java.time.MockInstant;
import org.evosuite.runtime.mock.java.time.MockLocalDate;
import org.evosuite.runtime.mock.java.util.MockCalendar;
import org.evosuite.runtime.mock.java.util.MockDate;
import org.junit.runner.RunWith;
import wheel.ErrorPage;
import wheel.components.ActionExpression;
import wheel.components.Any;
import wheel.components.Block;
import wheel.components.Checkbox;
import wheel.components.CheckboxGroup;
import wheel.components.Component;
import wheel.components.DateInput;
import wheel.components.ElExpression;
import wheel.components.FileInput;
import wheel.components.Form;
import wheel.components.Hidden;
import wheel.components.ISelectModel;
import wheel.components.Image;
import wheel.components.Label;
import wheel.components.NumberInput;
import wheel.components.Radio;
import wheel.components.RenderableComponent;
import wheel.components.Select;
import wheel.components.StandaloneComponent;
import wheel.components.Submit;
import wheel.components.Table;
import wheel.components.TableBlock;
import wheel.components.TableRow;
import wheel.components.Text;
import wheel.components.TextArea;
import wheel.components.TextInput;
import wheel.components.XmlEntityRef;
import wheel.util.DynamicSelectModel;
import wheel.util.InitialFieldValue;
import wheel.util.StringSelectModel;
@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true, useJEE = true)
public class Component_ESTest extends Component_ESTest_scaffolding {
/**
//Test case number: 0
/*Coverage entropy=2.3067367577985265
*/
@Test(timeout = 4000)
public void test000() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
String[] stringArray0 = new String[2];
stringArray0[0] = "java.lang.String@0000000022";
Component component0 = errorPage0.area(stringArray0);
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertEquals("Any_1", component0.getComponentId());
}
/**
//Test case number: 1
/*Coverage entropy=2.380546675790858
*/
@Test(timeout = 4000)
public void test001() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Table table0 = new Table(errorPage0, ":S");
TableBlock tableBlock0 = table0.tbody();
Component component0 = tableBlock0.wBlock("@");
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertEquals("Block_1", component0.getComponentId());
}
/**
//Test case number: 2
/*Coverage entropy=2.4121343884149504
*/
@Test(timeout = 4000)
public void test002() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
ActionExpression actionExpression0 = new ActionExpression("/p~X1");
Form form0 = new Form(errorPage0, "java.lang.String@0000000010", actionExpression0);
Component component0 = form0.var();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(component0._isGeneratedId());
}
/**
//Test case number: 3
/*Coverage entropy=2.4322167709453413
*/
@Test(timeout = 4000)
public void test003() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Table table0 = new Table(errorPage0, ":S");
Component component0 = table0.ins((Object) table0);
Component component1 = component0.ul();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertEquals("Block_1", component1.getComponentId());
}
/**
//Test case number: 4
/*Coverage entropy=2.203399008114057
*/
@Test(timeout = 4000)
public void test004() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.tt();
assertTrue(component0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 5
/*Coverage entropy=2.388234115937288
*/
@Test(timeout = 4000)
public void test005() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", "l");
TableBlock tableBlock0 = new TableBlock(fileInput0);
Checkbox checkbox0 = new Checkbox(tableBlock0, "l", "l");
Component component0 = tableBlock0.sub((Object) checkbox0);
assertTrue(component0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 6
/*Coverage entropy=2.388234115937288
*/
@Test(timeout = 4000)
public void test006() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Checkbox checkbox0 = new Checkbox(errorPage0, "a^", "[g*`'h(@o4t/H{GlQ;");
TableBlock tableBlock0 = new TableBlock(checkbox0);
Component component0 = tableBlock0.sub();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(component0._isGeneratedId());
}
/**
//Test case number: 7
/*Coverage entropy=2.203399008114057
*/
@Test(timeout = 4000)
public void test007() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.style();
assertTrue(component0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 8
/*Coverage entropy=2.203399008114057
*/
@Test(timeout = 4000)
public void test008() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.strong();
assertTrue(component0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 9
/*Coverage entropy=2.345435952313044
*/
@Test(timeout = 4000)
public void test009() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
ActionExpression actionExpression0 = new ActionExpression("l>)uo=)LH 6W");
Form form0 = new Form(errorPage0, "c[6Rv\"\"g)}", actionExpression0);
Component component0 = form0.span();
assertEquals("Block_1", component0.getComponentId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 10
/*Coverage entropy=2.2151215609245614
*/
@Test(timeout = 4000)
public void test010() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.small((Object) null);
assertTrue(component0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 11
/*Coverage entropy=2.265519645571082
*/
@Test(timeout = 4000)
public void test011() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
TableBlock tableBlock0 = new TableBlock(errorPage0);
Component component0 = tableBlock0.big((Object) "v@ar");
Component component1 = component0.small();
assertTrue(component1._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 12
/*Coverage entropy=2.203399008114057
*/
@Test(timeout = 4000)
public void test012() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.s();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(component0._isGeneratedId());
}
/**
//Test case number: 13
/*Coverage entropy=1.9061547465398496
*/
@Test(timeout = 4000)
public void test013() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
TextInput textInput0 = new TextInput(errorPage0, "6jzQ7`~3D&W7A5~", "(6F^2;X0:U");
textInput0.requestFocus();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 14
/*Coverage entropy=1.858519155892035
*/
@Test(timeout = 4000)
public void test014() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, ":!p.G*iax[1C4", ":!p.G*iax[1C4");
Checkbox checkbox0 = new Checkbox(fileInput0, "java.lang.String@0000000010", "");
StringBuilder stringBuilder0 = new StringBuilder((CharSequence) "java.lang.String@0000000010");
Component component0 = checkbox0.renderHint(stringBuilder0);
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(component0._isGeneratedId());
}
/**
//Test case number: 15
/*Coverage entropy=2.0867328374624825
*/
@Test(timeout = 4000)
public void test015() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
errorPage0.placeholder("Aufqzg");
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 16
/*Coverage entropy=2.2305112122117543
*/
@Test(timeout = 4000)
public void test016() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.p();
assertEquals("Block_1", component0.getComponentId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 17
/*Coverage entropy=2.4100423004955367
*/
@Test(timeout = 4000)
public void test017() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", ":S");
TableBlock tableBlock0 = new TableBlock(fileInput0);
Component component0 = tableBlock0.big((Object) fileInput0);
Component component1 = component0.ol();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertEquals("Block_1", component1.getComponentId());
}
/**
//Test case number: 18
/*Coverage entropy=2.203705432239539
*/
@Test(timeout = 4000)
public void test018() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.noframes();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertEquals("Block_2", component0.getComponentId());
assertTrue(component0._isGeneratedId());
}
/**
//Test case number: 19
/*Coverage entropy=1.8078537340099432
*/
@Test(timeout = 4000)
public void test019() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.nbsp();
assertEquals("wheel_ErrorPage", component0.getComponentId());
}
/**
//Test case number: 20
/*Coverage entropy=2.4618038036582814
*/
@Test(timeout = 4000)
public void test020() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Table table0 = new Table(errorPage0, "a");
TableRow tableRow0 = table0.tr();
Component component0 = tableRow0.meta();
assertEquals("Any_1", component0.getComponentId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 21
/*Coverage entropy=2.203399008114057
*/
@Test(timeout = 4000)
public void test021() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Boolean boolean0 = Boolean.valueOf(true);
Component component0 = errorPage0.li((Object) boolean0);
assertTrue(component0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 22
/*Coverage entropy=2.4121343884149504
*/
@Test(timeout = 4000)
public void test022() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Table table0 = new Table(errorPage0, "E^");
Component component0 = table0.legend((Object) ".s&ac00u");
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(component0._isGeneratedId());
}
/**
//Test case number: 23
/*Coverage entropy=2.203399008114057
*/
@Test(timeout = 4000)
public void test023() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.label();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(component0._isGeneratedId());
}
/**
//Test case number: 24
/*Coverage entropy=2.379042103983462
*/
@Test(timeout = 4000)
public void test024() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", "a^");
TableBlock tableBlock0 = new TableBlock(fileInput0);
Checkbox checkbox0 = new Checkbox(tableBlock0, "a^", "button");
Label label0 = new Label(checkbox0, checkbox0);
TextInput textInput0 = new TextInput(tableBlock0, "a^", (String) null);
Component component0 = label0.kbd((Object) textInput0);
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(component0._isGeneratedId());
}
/**
//Test case number: 25
/*Coverage entropy=2.203399008114057
*/
@Test(timeout = 4000)
public void test025() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.kbd();
assertTrue(component0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 26
/*Coverage entropy=2.4618038036582814
*/
@Test(timeout = 4000)
public void test026() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Table table0 = new Table(errorPage0, ":S");
TableBlock tableBlock0 = table0.thead();
Component component0 = tableBlock0.iframe();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertEquals("Any_1", component0.getComponentId());
}
/**
//Test case number: 27
/*Coverage entropy=2.265519645571082
*/
@Test(timeout = 4000)
public void test027() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.h6();
Component component1 = component0.i();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(component1._isGeneratedId());
}
/**
//Test case number: 28
/*Coverage entropy=2.5117810419821933
*/
@Test(timeout = 4000)
public void test028() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Table table0 = new Table(errorPage0, "e8skkSdVksbgqK");
TableBlock tableBlock0 = table0.thead();
Any any0 = tableBlock0.col();
TableRow tableRow0 = new TableRow(any0);
Component component0 = tableRow0.hr();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertEquals("Any_2", component0.getComponentId());
}
/**
//Test case number: 29
/*Coverage entropy=2.203399008114057
*/
@Test(timeout = 4000)
public void test029() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Float float0 = Float.valueOf((-4728.4824F));
Component component0 = errorPage0.h6((Object) float0);
assertTrue(component0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 30
/*Coverage entropy=2.265519645571082
*/
@Test(timeout = 4000)
public void test030() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.h6();
Component component1 = component0.h4();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(component1._isGeneratedId());
}
/**
//Test case number: 31
/*Coverage entropy=2.387421064274461
*/
@Test(timeout = 4000)
public void test031() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Table table0 = new Table(errorPage0, ":S");
TableBlock tableBlock0 = table0.tbody();
Component component0 = tableBlock0.h3((Object) table0);
assertTrue(component0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 32
/*Coverage entropy=2.380546675790858
*/
@Test(timeout = 4000)
public void test032() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Table table0 = new Table(errorPage0, "l#}`M5k\"q");
TableBlock tableBlock0 = table0.tfoot();
TableRow tableRow0 = tableBlock0.tr();
Component component0 = errorPage0.h2((Object) tableRow0);
assertTrue(component0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 33
/*Coverage entropy=2.203399008114057
*/
@Test(timeout = 4000)
public void test033() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.h1();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(component0._isGeneratedId());
}
/**
//Test case number: 34
/*Coverage entropy=2.5388586489099843
*/
@Test(timeout = 4000)
public void test034() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
errorPage0.form("YiAge@be(VG7p+6GF");
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 35
/*Coverage entropy=2.017746072809222
*/
@Test(timeout = 4000)
public void test035() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", ":S");
TableBlock tableBlock0 = new TableBlock(fileInput0);
Checkbox checkbox0 = new Checkbox(tableBlock0, ":S", "button");
Component component0 = checkbox0.end();
assertTrue(component0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 36
/*Coverage entropy=2.017746072809222
*/
@Test(timeout = 4000)
public void test036() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Checkbox checkbox0 = new Checkbox(errorPage0, "Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .", "N\"lJ");
TableRow tableRow0 = new TableRow(checkbox0);
tableRow0.el("");
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(tableRow0._isGeneratedId());
}
/**
//Test case number: 37
/*Coverage entropy=2.380546675790858
*/
@Test(timeout = 4000)
public void test037() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Table table0 = new Table(errorPage0, "E^");
TableBlock tableBlock0 = table0.thead();
Component component0 = tableBlock0.dl();
assertEquals("Block_1", component0.getComponentId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 38
/*Coverage entropy=2.412134388414951
*/
@Test(timeout = 4000)
public void test038() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
ActionExpression actionExpression0 = new ActionExpression(".");
Form form0 = new Form(errorPage0, ".", actionExpression0);
Component component0 = form0.dd((Object) actionExpression0);
assertTrue(component0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 39
/*Coverage entropy=2.2305112122117543
*/
@Test(timeout = 4000)
public void test039() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.br();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertEquals("Any_1", component0.getComponentId());
}
/**
//Test case number: 40
/*Coverage entropy=2.2296020537651633
*/
@Test(timeout = 4000)
public void test040() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
TableRow tableRow0 = new TableRow(errorPage0);
Component component0 = tableRow0.blockquote();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(component0._isGeneratedId());
}
/**
//Test case number: 41
/*Coverage entropy=2.4121343884149504
*/
@Test(timeout = 4000)
public void test041() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Table table0 = new Table(errorPage0, ":S");
Component component0 = table0.big();
assertTrue(component0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 42
/*Coverage entropy=2.203399008114057
*/
@Test(timeout = 4000)
public void test042() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.b((Object) "a^");
assertTrue(component0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 43
/*Coverage entropy=2.330394698271876
*/
@Test(timeout = 4000)
public void test043() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Table table0 = new Table(errorPage0, "a");
TableRow tableRow0 = table0.tr();
Component component0 = tableRow0.attribute("a", ":S");
assertTrue(component0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 44
/*Coverage entropy=1.0549201679861442
*/
@Test(timeout = 4000)
public void test044() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.attribute("nbsp", "nbsp");
assertEquals("wheel_ErrorPage", component0.getComponentId());
}
/**
//Test case number: 45
/*Coverage entropy=2.2108134714231644
*/
@Test(timeout = 4000)
public void test045() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Table table0 = new Table(errorPage0, ":K/s(s,25=Uc6h'my");
TableBlock tableBlock0 = table0.colgroup();
Component component0 = tableBlock0.addInternalRenderHint("KIE2:srO'Jl&!C\"nK");
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(component0._isGeneratedId());
}
/**
//Test case number: 46
/*Coverage entropy=2.203399008114057
*/
@Test(timeout = 4000)
public void test046() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Locale locale0 = Locale.CANADA_FRENCH;
Component component0 = errorPage0.acronym((Object) locale0);
assertTrue(component0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 47
/*Coverage entropy=2.203399008114057
*/
@Test(timeout = 4000)
public void test047() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.abbr((Object) "N]{z2h");
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(component0._isGeneratedId());
}
/**
//Test case number: 48
/*Coverage entropy=2.4121343884149504
*/
@Test(timeout = 4000)
public void test048() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
ActionExpression actionExpression0 = new ActionExpression("l&b~&");
Form form0 = new Form(errorPage0, "'e3b!eM~-W/) p", actionExpression0);
Component component0 = form0.abbr();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(component0._isGeneratedId());
}
/**
//Test case number: 49
/*Coverage entropy=2.536470598268596
*/
@Test(timeout = 4000)
public void test049() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Table table0 = new Table(errorPage0, ":S");
TableBlock tableBlock0 = table0.thead();
Component component0 = tableBlock0.q((Object) errorPage0);
Any any0 = tableBlock0.col();
component0.a((Object) any0);
assertEquals("Any_1", any0.getComponentId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 50
/*Coverage entropy=1.2130075659799042
*/
@Test(timeout = 4000)
public void test050() throws Throwable {
TextInput textInput0 = new TextInput((Component) null, "Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .", "Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .");
Submit submit0 = new Submit((Component) null, "Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .", "Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .");
String string0 = textInput0._applyFormat(submit0);
assertNotNull(string0);
}
/**
//Test case number: 51
/*Coverage entropy=1.5832584594204766
*/
@Test(timeout = 4000)
public void test051() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
// Undeclared exception!
try {
errorPage0.wrapSelf();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// No top level component found.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 52
/*Coverage entropy=1.1490596969706202
*/
@Test(timeout = 4000)
public void test052() throws Throwable {
TextArea textArea0 = new TextArea((Component) null, "xcyV6Uw]", "xcyV6Uw]");
// Undeclared exception!
try {
textArea0.wBlock("xcyV6Uw]");
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 53
/*Coverage entropy=1.7917594692280554
*/
@Test(timeout = 4000)
public void test053() throws Throwable {
TextInput textInput0 = new TextInput((Component) null, "keCz_tq^)", "Could not parse '");
// Undeclared exception!
try {
textInput0.var((Object) "h4 +n#-Nr-m_fc6{RJF");
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 54
/*Coverage entropy=2.2343358078055116
*/
@Test(timeout = 4000)
public void test054() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "~J^", "~J^");
// Undeclared exception!
try {
fileInput0.var();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 55
/*Coverage entropy=2.098766795072961
*/
@Test(timeout = 4000)
public void test055() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "~J^", "~J^");
Checkbox checkbox0 = new Checkbox(fileInput0, ":S", "wu3ton");
// Undeclared exception!
try {
checkbox0.ul();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 56
/*Coverage entropy=1.7917594692280554
*/
@Test(timeout = 4000)
public void test056() throws Throwable {
Submit submit0 = new Submit((Component) null, "Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .", "Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .");
// Undeclared exception!
try {
submit0.u((Object) "NeT%'nf0^");
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 57
/*Coverage entropy=2.177886941777099
*/
@Test(timeout = 4000)
public void test057() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
String string0 = "RfN)Y/BL&miB\\uR";
Hidden hidden0 = new Hidden(errorPage0, string0, "_");
TextInput textInput0 = new TextInput(hidden0, ";{w~]:_G#", ",");
Radio radio0 = new Radio(textInput0, ";{w~]:_G#", (String) null);
// Undeclared exception!
try {
radio0.u();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 58
/*Coverage entropy=1.791759469228055
*/
@Test(timeout = 4000)
public void test058() throws Throwable {
Hidden hidden0 = new Hidden((Component) null, "keCz_tq^)", "keCz_tq^)");
// Undeclared exception!
try {
hidden0.u();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 59
/*Coverage entropy=2.2343358078055116
*/
@Test(timeout = 4000)
public void test059() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
TextInput textInput0 = new TextInput(errorPage0, "`@ &]2*?Z:;4].", "`@ &]2*?Z:;4].");
Object object0 = new Object();
// Undeclared exception!
try {
textInput0.tt(object0);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 60
/*Coverage entropy=1.7917594692280554
*/
@Test(timeout = 4000)
public void test060() throws Throwable {
TextInput textInput0 = new TextInput((Component) null, "sx)vX`", "sx)vX`");
ElExpression elExpression0 = new ElExpression("$d}6J=Ai`eLbb$");
CheckboxGroup checkboxGroup0 = new CheckboxGroup(textInput0, "sx)vX`", "sx)vX`", (ISelectModel) null, elExpression0);
// Undeclared exception!
try {
textInput0.tt((Object) checkboxGroup0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 61
/*Coverage entropy=1.791759469228055
*/
@Test(timeout = 4000)
public void test061() throws Throwable {
Hidden hidden0 = new Hidden((Component) null, "keCz_tq^)", "keCz_tq^)");
TextInput textInput0 = new TextInput(hidden0, "Could not parse '", "G[2W");
// Undeclared exception!
try {
textInput0.tt();
fail("Expecting exception: ClassCastException");
} catch(ClassCastException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 62
/*Coverage entropy=1.5607104090414063
*/
@Test(timeout = 4000)
public void test062() throws Throwable {
Form form0 = new Form((String) null);
// Undeclared exception!
try {
form0.title((String) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 63
/*Coverage entropy=2.042316124449607
*/
@Test(timeout = 4000)
public void test063() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "v@ar", "v@ar");
// Undeclared exception!
try {
fileInput0.table();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 64
/*Coverage entropy=1.7917594692280554
*/
@Test(timeout = 4000)
public void test064() throws Throwable {
TextInput textInput0 = new TextInput((Component) null, "Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .", "Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .");
Submit submit0 = new Submit((Component) null, "Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .", "Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .");
// Undeclared exception!
try {
textInput0.sup((Object) submit0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 65
/*Coverage entropy=1.933809998920632
*/
@Test(timeout = 4000)
public void test065() throws Throwable {
Form form0 = new Form("blockquote");
DateInput dateInput0 = new DateInput(form0, "blockquote", "blockquote", "h2");
TextInput textInput0 = new TextInput(dateInput0, "pre", "pre");
Submit submit0 = new Submit(textInput0, "x9CWFWxZ(HQy", "l");
// Undeclared exception!
try {
submit0.sup((Object) "h2");
fail("Expecting exception: ClassCastException");
} catch(ClassCastException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 66
/*Coverage entropy=1.5498260458782016
*/
@Test(timeout = 4000)
public void test066() throws Throwable {
Form form0 = new Form("v%8,952a'Bu.1af");
// Undeclared exception!
try {
form0.sup();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 67
/*Coverage entropy=1.8065071652616695
*/
@Test(timeout = 4000)
public void test067() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
ElExpression elExpression0 = new ElExpression("e8skkSdVksbgqK");
TextInput textInput0 = new TextInput(errorPage0, "_", "E^");
// Undeclared exception!
try {
textInput0.strong((Object) elExpression0);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Could not evaluate expression e8skkSdVksbgqK in class wheel.ErrorPage
//
verifyException("wheel.components.ElExpression", e);
}
}
/**
//Test case number: 68
/*Coverage entropy=1.7917594692280554
*/
@Test(timeout = 4000)
public void test068() throws Throwable {
TextInput textInput0 = new TextInput((Component) null, "sx)vX`", "sx)vX`");
Hidden hidden0 = new Hidden((Component) null, "sx)vX`", "sx)vX`");
// Undeclared exception!
try {
textInput0.strong((Object) hidden0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 69
/*Coverage entropy=2.099856142961591
*/
@Test(timeout = 4000)
public void test069() throws Throwable {
ElExpression elExpression0 = new ElExpression("Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .");
ErrorPage errorPage0 = new ErrorPage();
Checkbox checkbox0 = new Checkbox(errorPage0, "Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .", "|$BQGuJpCK");
TextArea textArea0 = new TextArea(checkbox0, "wheel.components.TableBlock", "hr");
// Undeclared exception!
try {
textArea0.strike((Object) elExpression0);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Could not evaluate expression Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long . in class wheel.ErrorPage
//
verifyException("wheel.components.ElExpression", e);
}
}
/**
//Test case number: 70
/*Coverage entropy=1.7917594692280554
*/
@Test(timeout = 4000)
public void test070() throws Throwable {
ElExpression elExpression0 = new ElExpression("Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .");
Checkbox checkbox0 = new Checkbox((Component) null, "Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .", "|$BQGuJpCK");
TextArea textArea0 = new TextArea(checkbox0, "wheel.components.TableBlock", "hr");
// Undeclared exception!
try {
textArea0.strike((Object) elExpression0);
fail("Expecting exception: ClassCastException");
} catch(ClassCastException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 71
/*Coverage entropy=1.5498260458782016
*/
@Test(timeout = 4000)
public void test071() throws Throwable {
Form form0 = new Form(">p8Dg");
// Undeclared exception!
try {
form0.strike();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 72
/*Coverage entropy=1.5498260458782016
*/
@Test(timeout = 4000)
public void test072() throws Throwable {
XmlEntityRef xmlEntityRef0 = new XmlEntityRef("acronym");
// Undeclared exception!
try {
xmlEntityRef0.span((Object) "acronym");
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 73
/*Coverage entropy=2.177886941777099
*/
@Test(timeout = 4000)
public void test073() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", ":S");
TableBlock tableBlock0 = new TableBlock(fileInput0);
Checkbox checkbox0 = new Checkbox(tableBlock0, ":S", "bttn");
// Undeclared exception!
try {
checkbox0.span();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 74
/*Coverage entropy=2.234335807805511
*/
@Test(timeout = 4000)
public void test074() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Hidden hidden0 = new Hidden(errorPage0, "l", "wheelSubmitId");
// Undeclared exception!
try {
hidden0.small((Object) "Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .");
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 75
/*Coverage entropy=2.2343358078055116
*/
@Test(timeout = 4000)
public void test075() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", "IS");
// Undeclared exception!
try {
fileInput0.script();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 76
/*Coverage entropy=2.177886941777099
*/
@Test(timeout = 4000)
public void test076() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "dfn", "");
Checkbox checkbox0 = new Checkbox(fileInput0, (String) null, "_");
Locale locale0 = Locale.KOREAN;
Calendar calendar0 = MockCalendar.getInstance(locale0);
// Undeclared exception!
try {
checkbox0.samp((Object) calendar0);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 77
/*Coverage entropy=1.4270610433807247
*/
@Test(timeout = 4000)
public void test077() throws Throwable {
ElExpression elExpression0 = new ElExpression("Label_1");
CheckboxGroup checkboxGroup0 = new CheckboxGroup((Component) null, "Label_1", "Label_1", (ISelectModel) null, elExpression0);
Double double0 = new Double(31.0);
// Undeclared exception!
try {
checkboxGroup0.samp((Object) double0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 78
/*Coverage entropy=2.48819539284578
*/
@Test(timeout = 4000)
public void test078() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Table table0 = new Table(errorPage0, "E^");
TableBlock tableBlock0 = table0.thead();
Any any0 = tableBlock0.col();
// Undeclared exception!
try {
any0.samp();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 79
/*Coverage entropy=1.7917594692280554
*/
@Test(timeout = 4000)
public void test079() throws Throwable {
Checkbox checkbox0 = new Checkbox((Component) null, " posAmp=", " posAmp=");
// Undeclared exception!
try {
checkbox0.samp();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 80
/*Coverage entropy=2.2151922093961676
*/
@Test(timeout = 4000)
public void test080() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", "l");
TableBlock tableBlock0 = new TableBlock(fileInput0);
Checkbox checkbox0 = new Checkbox(tableBlock0, "l", "l");
Object object0 = new Object();
// Undeclared exception!
try {
checkbox0.s(object0);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 81
/*Coverage entropy=2.2343358078055116
*/
@Test(timeout = 4000)
public void test081() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Hidden hidden0 = new Hidden(errorPage0, "RfN)Y/BL&miB\u0006R", "_");
// Undeclared exception!
try {
hidden0.s();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 82
/*Coverage entropy=1.6417347121875212
*/
@Test(timeout = 4000)
public void test082() throws Throwable {
TextInput textInput0 = new TextInput((Component) null, "keCz-bq^)", "Could not parse '");
// Undeclared exception!
try {
textInput0.requestFocus();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 83
/*Coverage entropy=1.6417347121875212
*/
@Test(timeout = 4000)
public void test083() throws Throwable {
Hidden hidden0 = new Hidden((Component) null, "tb-`eOl0", "tb-`eOl0");
TextInput textInput0 = new TextInput(hidden0, "2So+X{eNd_!S^O)", "2So+X{eNd_!S^O)");
// Undeclared exception!
try {
textInput0.requestFocus();
fail("Expecting exception: ClassCastException");
} catch(ClassCastException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 84
/*Coverage entropy=1.6715952780212542
*/
@Test(timeout = 4000)
public void test084() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Table table0 = new Table(errorPage0, "Uv8D");
// Undeclared exception!
try {
table0.remove("a");
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
}
}
/**
//Test case number: 85
/*Coverage entropy=2.1774844871094987
*/
@Test(timeout = 4000)
public void test085() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Hidden hidden0 = new Hidden(errorPage0, "keCz_tq^)", "frame");
Submit submit0 = new Submit(hidden0, "java/lang/NoClassDefFoundError", "H/F|wH,<8:VqV'IM^z");
NumberInput numberInput0 = new NumberInput(hidden0, "3C~,^Z33t5LE-PEJf", "bTZyqrj");
Label label0 = new Label(errorPage0, numberInput0);
// Undeclared exception!
try {
submit0.rawText(label0);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 86
/*Coverage entropy=1.7917594692280554
*/
@Test(timeout = 4000)
public void test086() throws Throwable {
Hidden hidden0 = new Hidden((Component) null, "keCz_tq^)", "keCz_tq^)");
Submit submit0 = new Submit(hidden0, "s", "java.lang.String@0000000021");
MockDate mockDate0 = new MockDate(0L);
// Undeclared exception!
try {
submit0.rawText(mockDate0);
fail("Expecting exception: ClassCastException");
} catch(ClassCastException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 87
/*Coverage entropy=1.5498260458782016
*/
@Test(timeout = 4000)
public void test087() throws Throwable {
XmlEntityRef xmlEntityRef0 = new XmlEntityRef("XrAk}d# ni+u-");
// Undeclared exception!
try {
xmlEntityRef0.q((Object) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 88
/*Coverage entropy=2.246213836677445
*/
@Test(timeout = 4000)
public void test088() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Hidden hidden0 = new Hidden(errorPage0, "v@ar", "");
// Undeclared exception!
try {
hidden0.q();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 89
/*Coverage entropy=1.5498260458782016
*/
@Test(timeout = 4000)
public void test089() throws Throwable {
Form form0 = new Form("|$BQGuJpCK");
// Undeclared exception!
try {
form0.q();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 90
/*Coverage entropy=1.7917594692280554
*/
@Test(timeout = 4000)
public void test090() throws Throwable {
Submit submit0 = new Submit((Component) null, "!aa~", "!aa~");
DynamicSelectModel dynamicSelectModel0 = new DynamicSelectModel();
// Undeclared exception!
try {
submit0.pre((Object) dynamicSelectModel0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 91
/*Coverage entropy=1.7917594692280554
*/
@Test(timeout = 4000)
public void test091() throws Throwable {
Submit submit0 = new Submit((Component) null, "Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .", "Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .");
Checkbox checkbox0 = new Checkbox(submit0, "org.apache.commons.io.filefilter.FalseFileFilter", "Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .");
// Undeclared exception!
try {
checkbox0.pre((Object) "NeT%'nf0^");
fail("Expecting exception: ClassCastException");
} catch(ClassCastException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 92
/*Coverage entropy=1.7917594692280554
*/
@Test(timeout = 4000)
public void test092() throws Throwable {
Submit submit0 = new Submit((Component) null, "=/^m6f", "=/^m6f");
// Undeclared exception!
try {
submit0.pre();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 93
/*Coverage entropy=2.3620800943872786
*/
@Test(timeout = 4000)
public void test093() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", ":S");
TableBlock tableBlock0 = new TableBlock(fileInput0);
Checkbox checkbox0 = new Checkbox(tableBlock0, ":S", "button");
// Undeclared exception!
try {
checkbox0.placeholder("button");
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 94
/*Coverage entropy=2.2343358078055116
*/
@Test(timeout = 4000)
public void test094() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
NumberInput numberInput0 = new NumberInput(errorPage0, "fQK{F3W", " prefix");
Boolean boolean0 = new Boolean(true);
// Undeclared exception!
try {
numberInput0.p((Object) boolean0);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 95
/*Coverage entropy=2.098766795072961
*/
@Test(timeout = 4000)
public void test095() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Hidden hidden0 = new Hidden(errorPage0, "RfN)Y/BL&miB\u0006R", "_");
TextInput textInput0 = new TextInput(hidden0, ";{w~]:_G#", "ZP=,#U(@o++DCT9r~");
// Undeclared exception!
try {
textInput0.p();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 96
/*Coverage entropy=1.5832584594204766
*/
@Test(timeout = 4000)
public void test096() throws Throwable {
DateInput dateInput0 = new DateInput((Component) null, "_", "Could not parse '", "_");
TextInput textInput0 = new TextInput(dateInput0, "expected equals sign (=) after version and not ", "_");
// Undeclared exception!
try {
textInput0.p();
fail("Expecting exception: ClassCastException");
} catch(ClassCastException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 97
/*Coverage entropy=2.482203083453435
*/
@Test(timeout = 4000)
public void test097() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", ":S");
TableBlock tableBlock0 = new TableBlock(fileInput0);
Any any0 = tableBlock0.col();
// Undeclared exception!
try {
any0.ol();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 98
/*Coverage entropy=2.177886941777099
*/
@Test(timeout = 4000)
public void test098() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, ":!p.G*iax[1C4", ":!p.G*iax[1C4");
Checkbox checkbox0 = new Checkbox(fileInput0, "java.lang.String@0000000010", "");
// Undeclared exception!
try {
checkbox0.object();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 99
/*Coverage entropy=1.7917594692280554
*/
@Test(timeout = 4000)
public void test099() throws Throwable {
Hidden hidden0 = new Hidden((Component) null, "keCz_tq^)", "keCz_tq^)");
// Undeclared exception!
try {
hidden0.object();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 100
/*Coverage entropy=2.010162658639613
*/
@Test(timeout = 4000)
public void test100() throws Throwable {
Form form0 = new Form("blockquote");
DateInput dateInput0 = new DateInput(form0, "blockquote", "blockquote", "h2");
TextInput textInput0 = new TextInput(dateInput0, "pre", "pre");
Submit submit0 = new Submit(textInput0, "x9CWFWxZ(HQy", "l");
// Undeclared exception!
try {
submit0.numberInput("pre");
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 101
/*Coverage entropy=1.5498260458782016
*/
@Test(timeout = 4000)
public void test101() throws Throwable {
Form form0 = new Form("m1MKCz");
// Undeclared exception!
try {
form0.noscript();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 102
/*Coverage entropy=1.6094379124341003
*/
@Test(timeout = 4000)
public void test102() throws Throwable {
Hidden hidden0 = new Hidden((Component) null, "K", "K");
TextArea textArea0 = new TextArea(hidden0, "K", "K");
// Undeclared exception!
try {
textArea0.nbsp();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 103
/*Coverage entropy=1.559581156259877
*/
@Test(timeout = 4000)
public void test103() throws Throwable {
XmlEntityRef xmlEntityRef0 = new XmlEntityRef("Q");
// Undeclared exception!
try {
xmlEntityRef0.meta();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 104
/*Coverage entropy=1.791759469228055
*/
@Test(timeout = 4000)
public void test104() throws Throwable {
TextInput textInput0 = new TextInput((Component) null, "h2", "h8)v&g`wMfm");
Object[] objectArray0 = new Object[4];
// Undeclared exception!
try {
textInput0.message(":FT`eb96 lsn$!z0", objectArray0);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// No top level component found.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 105
/*Coverage entropy=1.7328679513998633
*/
@Test(timeout = 4000)
public void test105() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Object[] objectArray0 = new Object[2];
// Undeclared exception!
try {
errorPage0.message("Q:Q:3", objectArray0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("wheel.components.StandaloneComponent", e);
}
}
/**
//Test case number: 106
/*Coverage entropy=1.5498260458782016
*/
@Test(timeout = 4000)
public void test106() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
// Undeclared exception!
try {
errorPage0.message("+)'cxc+");
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("wheel.components.StandaloneComponent", e);
}
}
/**
//Test case number: 107
/*Coverage entropy=1.709472776584213
*/
@Test(timeout = 4000)
public void test107() throws Throwable {
Hidden hidden0 = new Hidden((Component) null, "h3", "h3");
// Undeclared exception!
try {
hidden0.map("h3");
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// No top level component found.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 108
/*Coverage entropy=2.2343358078055116
*/
@Test(timeout = 4000)
public void test108() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Hidden hidden0 = new Hidden(errorPage0, "J^", "l");
// Undeclared exception!
try {
hidden0.link();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 109
/*Coverage entropy=1.791759469228055
*/
@Test(timeout = 4000)
public void test109() throws Throwable {
Hidden hidden0 = new Hidden((Component) null, "keCz_tq^)", "keCz_tq^)");
// Undeclared exception!
try {
hidden0.link();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 110
/*Coverage entropy=2.2151922093961676
*/
@Test(timeout = 4000)
public void test110() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
TextInput textInput0 = new TextInput(errorPage0, "6jzQ7`~3D&W7A5~", "(6F^2;X0:U");
Submit submit0 = new Submit(textInput0, "bTZyqrj", "hr");
// Undeclared exception!
try {
submit0.legend((Object) "var");
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 111
/*Coverage entropy=1.791759469228055
*/
@Test(timeout = 4000)
public void test111() throws Throwable {
Hidden hidden0 = new Hidden((Component) null, ".+e&t", ".+e&t");
Submit submit0 = new Submit(hidden0, "org.mvel.conversion.DoubleCH$5", "oHI\"]Vh\"9,[W&cCz33");
// Undeclared exception!
try {
submit0.legend((Object) ".+e&t");
fail("Expecting exception: ClassCastException");
} catch(ClassCastException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 112
/*Coverage entropy=1.5607104090414063
*/
@Test(timeout = 4000)
public void test112() throws Throwable {
Form form0 = new Form((String) null);
// Undeclared exception!
try {
form0.legend();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 113
/*Coverage entropy=2.3792935978999608
*/
@Test(timeout = 4000)
public void test113() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "", "");
ActionExpression actionExpression0 = new ActionExpression("");
Form form0 = new Form(fileInput0, "small", actionExpression0);
Checkbox checkbox0 = new Checkbox(form0, "", "");
// Undeclared exception!
try {
checkbox0.label((Object) null);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 114
/*Coverage entropy=1.5498260458782016
*/
@Test(timeout = 4000)
public void test114() throws Throwable {
XmlEntityRef xmlEntityRef0 = new XmlEntityRef("]U3+l*$r`rr<'");
// Undeclared exception!
try {
xmlEntityRef0.kbd();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 115
/*Coverage entropy=2.2343358078055116
*/
@Test(timeout = 4000)
public void test115() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", ":S");
ActionExpression actionExpression0 = new ActionExpression("a^");
// Undeclared exception!
try {
fileInput0.ins((Object) actionExpression0);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 116
/*Coverage entropy=1.5607104090414063
*/
@Test(timeout = 4000)
public void test116() throws Throwable {
Form form0 = new Form((String) null);
// Undeclared exception!
try {
form0.ins();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 117
/*Coverage entropy=1.6417347121875212
*/
@Test(timeout = 4000)
public void test117() throws Throwable {
XmlEntityRef xmlEntityRef0 = new XmlEntityRef("TN~A9UjsY>4]%");
TextArea textArea0 = new TextArea(xmlEntityRef0, "LaRPel_)", "Ls\"jkk");
// Undeclared exception!
try {
textArea0.img("f&v~Ge", "n9vDjM>+1{}");
fail("Expecting exception: ClassCastException");
} catch(ClassCastException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 118
/*Coverage entropy=1.6417347121875212
*/
@Test(timeout = 4000)
public void test118() throws Throwable {
Hidden hidden0 = new Hidden((Component) null, "keCz_tq^)", "keCz_tq^)");
// Undeclared exception!
try {
hidden0.id("oCP@CN~");
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// No top level component found.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 119
/*Coverage entropy=2.2151922093961676
*/
@Test(timeout = 4000)
public void test119() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
TextArea textArea0 = new TextArea(errorPage0, "L~s\"jkk", "Attributes must be given in name, value pairs.");
Radio radio0 = new Radio(textArea0, "bTZyqrj", "Attributes must be given in name, value pairs.");
Hidden hidden0 = new Hidden(radio0, "^^I", "body");
MockDate mockDate0 = new MockDate();
// Undeclared exception!
try {
hidden0.i((Object) mockDate0);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 120
/*Coverage entropy=1.5498260458782016
*/
@Test(timeout = 4000)
public void test120() throws Throwable {
XmlEntityRef xmlEntityRef0 = new XmlEntityRef("w n@1oE}IT3Vy3JdlDp");
MockDate mockDate0 = new MockDate(0L);
// Undeclared exception!
try {
xmlEntityRef0.i((Object) mockDate0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 121
/*Coverage entropy=1.9459101490553132
*/
@Test(timeout = 4000)
public void test121() throws Throwable {
Form form0 = new Form("blockquote");
Submit submit0 = new Submit(form0, "blockquote", "a/U%73\"C(k>yIK=");
Radio radio0 = new Radio(submit0, "vB0,v&Q}3_M)xOZ6yb", "java.lang.String@0000000016");
Hidden hidden0 = new Hidden(form0, "a/U%73\"C(k>yIK=", "blockquote");
// Undeclared exception!
try {
hidden0.i((Object) radio0);
fail("Expecting exception: ClassCastException");
} catch(ClassCastException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 122
/*Coverage entropy=2.2151922093961676
*/
@Test(timeout = 4000)
public void test122() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", "l");
TableBlock tableBlock0 = new TableBlock(fileInput0);
Checkbox checkbox0 = new Checkbox(tableBlock0, "l", "l");
// Undeclared exception!
try {
checkbox0.i();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 123
/*Coverage entropy=1.7917594692280554
*/
@Test(timeout = 4000)
public void test123() throws Throwable {
Checkbox checkbox0 = new Checkbox((Component) null, "Vq';-", "Vq';-");
// Undeclared exception!
try {
checkbox0.i();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 124
/*Coverage entropy=2.427212791555671
*/
@Test(timeout = 4000)
public void test124() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
// Undeclared exception!
try {
errorPage0.head();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("wheel.components.StandaloneComponent", e);
}
}
/**
//Test case number: 125
/*Coverage entropy=2.1524913125743104
*/
@Test(timeout = 4000)
public void test125() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Boolean boolean0 = new Boolean(true);
TextArea textArea0 = new TextArea(errorPage0, "a^", ":)&");
// Undeclared exception!
try {
textArea0.h6((Object) boolean0);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 126
/*Coverage entropy=1.4270610433807247
*/
@Test(timeout = 4000)
public void test126() throws Throwable {
TextArea textArea0 = new TextArea((Component) null, ".", ".");
// Undeclared exception!
try {
textArea0.h6((Object) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 127
/*Coverage entropy=1.9459101490553132
*/
@Test(timeout = 4000)
public void test127() throws Throwable {
Form form0 = new Form("blockquote");
Checkbox checkbox0 = new Checkbox(form0, "blockquote", "blockquote");
// Undeclared exception!
try {
checkbox0.h6();
fail("Expecting exception: ClassCastException");
} catch(ClassCastException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 128
/*Coverage entropy=2.2208348271471956
*/
@Test(timeout = 4000)
public void test128() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", ":S");
TableBlock tableBlock0 = new TableBlock(fileInput0);
Checkbox checkbox0 = new Checkbox(tableBlock0, ":S", "button");
// Undeclared exception!
try {
checkbox0.h5((Object) null);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 129
/*Coverage entropy=1.791759469228055
*/
@Test(timeout = 4000)
public void test129() throws Throwable {
Hidden hidden0 = new Hidden((Component) null, "eCztqp)", "eCztqp)");
// Undeclared exception!
try {
hidden0.h5((Object) "eCztqp)");
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 130
/*Coverage entropy=1.5498260458782016
*/
@Test(timeout = 4000)
public void test130() throws Throwable {
Form form0 = new Form("lckqote");
// Undeclared exception!
try {
form0.h5();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 131
/*Coverage entropy=2.2379795021964175
*/
@Test(timeout = 4000)
public void test131() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Checkbox checkbox0 = new Checkbox(errorPage0, (String) null, "U@{ZcJG$)h");
// Undeclared exception!
try {
checkbox0.h4((Object) null);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 132
/*Coverage entropy=1.7917594692280554
*/
@Test(timeout = 4000)
public void test132() throws Throwable {
Hidden hidden0 = new Hidden((Component) null, "keCz_tq^)", "keCz_tq^)");
Checkbox checkbox0 = new Checkbox(hidden0, "Could not parse '", "h2");
// Undeclared exception!
try {
checkbox0.h4((Object) "keCz_tq^)");
fail("Expecting exception: ClassCastException");
} catch(ClassCastException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 133
/*Coverage entropy=2.2151922093961676
*/
@Test(timeout = 4000)
public void test133() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Hidden hidden0 = new Hidden(errorPage0, "E^", "&");
TextInput textInput0 = new TextInput(hidden0, ";{w~]:_G#", ",");
// Undeclared exception!
try {
textInput0.h4();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 134
/*Coverage entropy=1.7782333057997077
*/
@Test(timeout = 4000)
public void test134() throws Throwable {
TextInput textInput0 = new TextInput((Component) null, "j0C7m&i^72@!", "j0C7m&i^72@!");
Hidden hidden0 = new Hidden(textInput0, (String) null, "java.lang.String@0000000010");
Checkbox checkbox0 = new Checkbox(hidden0, "java.lang.String@0000000010", "ZP=,#h(@o++DCT9I");
TextInput textInput1 = new TextInput(checkbox0, "m", "ZP=,#h(@o++DCT9I");
// Undeclared exception!
try {
textInput1.h4();
fail("Expecting exception: ClassCastException");
} catch(ClassCastException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 135
/*Coverage entropy=1.5607104090414063
*/
@Test(timeout = 4000)
public void test135() throws Throwable {
XmlEntityRef xmlEntityRef0 = new XmlEntityRef((String) null);
// Undeclared exception!
try {
xmlEntityRef0.h3();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 136
/*Coverage entropy=2.2343358078055116
*/
@Test(timeout = 4000)
public void test136() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Hidden hidden0 = new Hidden(errorPage0, "java.lang.String@0000000007", "java.lang.String@0000000007");
Locale locale0 = Locale.forLanguageTag("f'YgMxTmk");
Calendar calendar0 = MockCalendar.getInstance(locale0);
// Undeclared exception!
try {
hidden0.h2((Object) calendar0);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 137
/*Coverage entropy=1.791759469228055
*/
@Test(timeout = 4000)
public void test137() throws Throwable {
Submit submit0 = new Submit((Component) null, "Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .", "Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .");
Hidden hidden0 = new Hidden(submit0, "Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .", "_");
Object object0 = new Object();
// Undeclared exception!
try {
hidden0.h2(object0);
fail("Expecting exception: ClassCastException");
} catch(ClassCastException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 138
/*Coverage entropy=1.5498260458782016
*/
@Test(timeout = 4000)
public void test138() throws Throwable {
Form form0 = new Form("lckqote");
// Undeclared exception!
try {
form0.h2();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 139
/*Coverage entropy=2.43476018591237
*/
@Test(timeout = 4000)
public void test139() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Table table0 = new Table(errorPage0, "E^");
TableBlock tableBlock0 = table0.thead();
Checkbox checkbox0 = new Checkbox(tableBlock0, "button", "Label_1");
Instant instant0 = MockInstant.ofEpochMilli((-700L));
// Undeclared exception!
try {
checkbox0.h1((Object) instant0);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 140
/*Coverage entropy=1.7917594692280554
*/
@Test(timeout = 4000)
public void test140() throws Throwable {
Submit submit0 = new Submit((Component) null, "Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .", "Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .");
// Undeclared exception!
try {
submit0.h1((Object) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 141
/*Coverage entropy=1.5498260458782016
*/
@Test(timeout = 4000)
public void test141() throws Throwable {
XmlEntityRef xmlEntityRef0 = new XmlEntityRef("w5H2gk&{*vh");
// Undeclared exception!
try {
xmlEntityRef0.h1();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 142
/*Coverage entropy=2.3403391011087646
*/
@Test(timeout = 4000)
public void test142() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "~J^", "~J^");
String string0 = "RfN)Y/BL&miB\\uR";
Hidden hidden0 = new Hidden(fileInput0, "java.lang.String@0000000016", "r");
ActionExpression actionExpression0 = new ActionExpression(string0);
// Undeclared exception!
try {
hidden0.form("D5-", actionExpression0);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 143
/*Coverage entropy=1.791759469228055
*/
@Test(timeout = 4000)
public void test143() throws Throwable {
Hidden hidden0 = new Hidden((Component) null, "eCztqp)", "eCztqp)");
ActionExpression actionExpression0 = new ActionExpression("wrong name");
// Undeclared exception!
try {
hidden0.form("dt", actionExpression0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 144
/*Coverage entropy=1.9408430327407737
*/
@Test(timeout = 4000)
public void test144() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
String string0 = "RfN)Y/BL&miB\\uR";
Hidden hidden0 = new Hidden(errorPage0, string0, "_");
ActionExpression actionExpression0 = new ActionExpression("E^");
// Undeclared exception!
try {
hidden0.form((String) null, actionExpression0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// A Form must always have a given componentId.
//
verifyException("wheel.components.Form", e);
}
}
/**
//Test case number: 145
/*Coverage entropy=1.933809998920632
*/
@Test(timeout = 4000)
public void test145() throws Throwable {
Form form0 = new Form("blockquote");
DateInput dateInput0 = new DateInput(form0, "blockquote", "blockquote", "h2");
TextInput textInput0 = new TextInput(dateInput0, "pre", "pre");
ActionExpression actionExpression0 = new ActionExpression("pre");
// Undeclared exception!
try {
textInput0.form("m'o)", actionExpression0);
fail("Expecting exception: ClassCastException");
} catch(ClassCastException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 146
/*Coverage entropy=2.477597976426666
*/
@Test(timeout = 4000)
public void test146() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", "l");
TableBlock tableBlock0 = new TableBlock(fileInput0);
Checkbox checkbox0 = new Checkbox(tableBlock0, "l", "l");
Text text0 = new Text(checkbox0, (Object) null);
// Undeclared exception!
try {
text0.form("3^&ISgn");
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 147
/*Coverage entropy=1.933809998920632
*/
@Test(timeout = 4000)
public void test147() throws Throwable {
Form form0 = new Form("v8__,%Sf:bEvjB_^");
NumberInput numberInput0 = new NumberInput(form0, "v8__,%Sf:bEvjB_^", "v8__,%Sf:bEvjB_^");
Checkbox checkbox0 = new Checkbox(numberInput0, "v8__,%Sf:bEvjB_^", "v8__,%Sf:bEvjB_^");
// Undeclared exception!
try {
checkbox0.form("/tmp");
fail("Expecting exception: ClassCastException");
} catch(ClassCastException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 148
/*Coverage entropy=2.0101626586396124
*/
@Test(timeout = 4000)
public void test148() throws Throwable {
Form form0 = new Form("blockquote");
DateInput dateInput0 = new DateInput(form0, "blockquote", "blockquote", "h2");
TextInput textInput0 = new TextInput(dateInput0, "pre", "pre");
ElExpression elExpression0 = new ElExpression("d(N#Vm[QlJW3N");
// Undeclared exception!
try {
textInput0.fileInput("4,?New'^3C>rBPrr", elExpression0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 149
/*Coverage entropy=2.1112165458116356
*/
@Test(timeout = 4000)
public void test149() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Submit submit0 = new Submit(errorPage0, "", "l");
// Undeclared exception!
try {
submit0.fieldset();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 150
/*Coverage entropy=1.5832584594204766
*/
@Test(timeout = 4000)
public void test150() throws Throwable {
Hidden hidden0 = new Hidden((Component) null, "tb-`eOl0", "tb-`eOl0");
// Undeclared exception!
try {
hidden0.fieldset();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 151
/*Coverage entropy=1.6417347121875212
*/
@Test(timeout = 4000)
public void test151() throws Throwable {
TextArea textArea0 = new TextArea((Component) null, "Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .", "Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .");
Integer integer0 = new Integer(0);
// Undeclared exception!
try {
textArea0.em((Object) integer0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 152
/*Coverage entropy=1.5607104090414063
*/
@Test(timeout = 4000)
public void test152() throws Throwable {
XmlEntityRef xmlEntityRef0 = new XmlEntityRef((String) null);
// Undeclared exception!
try {
xmlEntityRef0.em();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 153
/*Coverage entropy=2.2379795021964175
*/
@Test(timeout = 4000)
public void test153() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Hidden hidden0 = new Hidden(errorPage0, "Could not evaluate finder expression ' ", "java.lang.String@0000000016");
// Undeclared exception!
try {
hidden0.dt((Object) null);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 154
/*Coverage entropy=1.791759469228055
*/
@Test(timeout = 4000)
public void test154() throws Throwable {
Hidden hidden0 = new Hidden((Component) null, "tb-`eOl0", "tb-`eOl0");
Hidden hidden1 = new Hidden(hidden0, "&04?", "&04?");
// Undeclared exception!
try {
hidden1.dt((Object) "tb-`eOl0");
fail("Expecting exception: ClassCastException");
} catch(ClassCastException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 155
/*Coverage entropy=1.5832584594204766
*/
@Test(timeout = 4000)
public void test155() throws Throwable {
TextInput textInput0 = new TextInput((Component) null, "keCz_tq^)", "Could not parse '");
// Undeclared exception!
try {
textInput0.dt();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 156
/*Coverage entropy=2.2882094593364797
*/
@Test(timeout = 4000)
public void test156() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Block block0 = new Block(errorPage0, "Q-Wo$vyr^D8uqVt");
Checkbox checkbox0 = new Checkbox(block0, "button", "java.lang.String@0000000007");
// Undeclared exception!
try {
checkbox0.dl();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 157
/*Coverage entropy=1.5832584594204766
*/
@Test(timeout = 4000)
public void test157() throws Throwable {
Hidden hidden0 = new Hidden((Component) null, "keCz_tq^)", "keCz_tq^)");
// Undeclared exception!
try {
hidden0.dl();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 158
/*Coverage entropy=2.0173636234482513
*/
@Test(timeout = 4000)
public void test158() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, ":S", "sxC^&9ket</Ehfo");
Checkbox checkbox0 = new Checkbox(fileInput0, "CCqOu-=1w#jCX[+S", "sxC^&9ket</Ehfo");
// Undeclared exception!
try {
checkbox0.div();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 159
/*Coverage entropy=1.5832584594204766
*/
@Test(timeout = 4000)
public void test159() throws Throwable {
TextInput textInput0 = new TextInput((Component) null, "keCz_tq^)", "Could not parse '");
// Undeclared exception!
try {
textInput0.div();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 160
/*Coverage entropy=1.7670091910745693
*/
@Test(timeout = 4000)
public void test160() throws Throwable {
Form form0 = new Form("blockquote");
DateInput dateInput0 = new DateInput(form0, "blockquote", "blockquote", "h2");
Checkbox checkbox0 = new Checkbox(dateInput0, "dir", "W%<JTsQF[DQL");
// Undeclared exception!
try {
checkbox0.div();
fail("Expecting exception: ClassCastException");
} catch(ClassCastException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 161
/*Coverage entropy=2.2343358078055116
*/
@Test(timeout = 4000)
public void test161() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "7V", "a^");
Short short0 = new Short((short)25);
// Undeclared exception!
try {
fileInput0.dfn((Object) short0);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 162
/*Coverage entropy=2.2151922093961676
*/
@Test(timeout = 4000)
public void test162() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", ":S");
TableBlock tableBlock0 = new TableBlock(fileInput0);
Checkbox checkbox0 = new Checkbox(tableBlock0, ":S", "button");
// Undeclared exception!
try {
checkbox0.dfn();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 163
/*Coverage entropy=1.791759469228055
*/
@Test(timeout = 4000)
public void test163() throws Throwable {
TextInput textInput0 = new TextInput((Component) null, "keCz_tq^)", "Could not parse '");
// Undeclared exception!
try {
textInput0.dfn();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 164
/*Coverage entropy=1.9459101490553132
*/
@Test(timeout = 4000)
public void test164() throws Throwable {
Form form0 = new Form("blockquote");
Checkbox checkbox0 = new Checkbox(form0, "java.lang.String@0000000021", "src");
// Undeclared exception!
try {
checkbox0.dfn();
fail("Expecting exception: ClassCastException");
} catch(ClassCastException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 165
/*Coverage entropy=2.3641994115047673
*/
@Test(timeout = 4000)
public void test165() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", ":S");
TableBlock tableBlock0 = new TableBlock(fileInput0);
Checkbox checkbox0 = new Checkbox(tableBlock0, ":S", "button");
TableRow tableRow0 = tableBlock0.tr();
// Undeclared exception!
try {
checkbox0.del((Object) tableRow0);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 166
/*Coverage entropy=1.791759469228055
*/
@Test(timeout = 4000)
public void test166() throws Throwable {
TextInput textInput0 = new TextInput((Component) null, "Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .", "Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .");
// Undeclared exception!
try {
textInput0.del();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 167
/*Coverage entropy=2.1112165458116356
*/
@Test(timeout = 4000)
public void test167() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Hidden hidden0 = new Hidden(errorPage0, (String) null, "Y[~vJ(W[");
// Undeclared exception!
try {
hidden0.dd();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 168
/*Coverage entropy=1.5498260458782016
*/
@Test(timeout = 4000)
public void test168() throws Throwable {
Form form0 = new Form("blockquote");
Double double0 = new Double((-774.33484));
// Undeclared exception!
try {
form0.code((Object) double0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 169
/*Coverage entropy=2.234335807805511
*/
@Test(timeout = 4000)
public void test169() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Checkbox checkbox0 = new Checkbox(errorPage0, "Attributes must be given in name, value pairs.", "-&KO(+|@n1yAl+bDJ");
// Undeclared exception!
try {
checkbox0.code();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 170
/*Coverage entropy=1.7917594692280554
*/
@Test(timeout = 4000)
public void test170() throws Throwable {
Hidden hidden0 = new Hidden((Component) null, "eCztqp)", "eCztqp)");
// Undeclared exception!
try {
hidden0.code();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 171
/*Coverage entropy=1.7917594692280554
*/
@Test(timeout = 4000)
public void test171() throws Throwable {
Hidden hidden0 = new Hidden((Component) null, "keCz_tq^)", "keCz_tq^)");
Checkbox checkbox0 = new Checkbox(hidden0, "moLyNVr^C)", "<J*f+Qb/h9G&pNM");
// Undeclared exception!
try {
checkbox0.code();
fail("Expecting exception: ClassCastException");
} catch(ClassCastException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 172
/*Coverage entropy=2.2151922093961676
*/
@Test(timeout = 4000)
public void test172() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", "l");
TableBlock tableBlock0 = new TableBlock(fileInput0);
Checkbox checkbox0 = new Checkbox(tableBlock0, "l", "l");
Object object0 = new Object();
// Undeclared exception!
try {
checkbox0.cite(object0);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 173
/*Coverage entropy=1.7917594692280554
*/
@Test(timeout = 4000)
public void test173() throws Throwable {
DateInput dateInput0 = new DateInput((Component) null, "Could not parse '", "keCz_tq^)", "keCz_tq^)");
// Undeclared exception!
try {
dateInput0.cite((Object) "Could not parse '");
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 174
/*Coverage entropy=1.7917594692280554
*/
@Test(timeout = 4000)
public void test174() throws Throwable {
Hidden hidden0 = new Hidden((Component) null, "t-`6el0", "t-`6el0");
// Undeclared exception!
try {
hidden0.cite();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 175
/*Coverage entropy=2.0101626586396124
*/
@Test(timeout = 4000)
public void test175() throws Throwable {
Form form0 = new Form("Q>,#~H//-,C_");
Checkbox checkbox0 = new Checkbox(form0, "Q>,#~H//-,C_", "java.lang.String@0000000021");
TextInput textInput0 = new TextInput(checkbox0, "java.lang.String@0000000021", "java.lang.String@0000000021");
// Undeclared exception!
try {
textInput0.buttonInput("");
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 176
/*Coverage entropy=2.2151922093961676
*/
@Test(timeout = 4000)
public void test176() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", ":S");
TableBlock tableBlock0 = new TableBlock(fileInput0);
Checkbox checkbox0 = new Checkbox(tableBlock0, ":S", "button");
// Undeclared exception!
try {
checkbox0.button();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 177
/*Coverage entropy=1.5607104090414063
*/
@Test(timeout = 4000)
public void test177() throws Throwable {
XmlEntityRef xmlEntityRef0 = new XmlEntityRef((String) null);
// Undeclared exception!
try {
xmlEntityRef0.button();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 178
/*Coverage entropy=2.5569395929056564
*/
@Test(timeout = 4000)
public void test178() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", ":S");
TableBlock tableBlock0 = new TableBlock(fileInput0);
Checkbox checkbox0 = new Checkbox(tableBlock0, ":S", "button");
// Undeclared exception!
try {
checkbox0.body();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("wheel.components.StandaloneComponent", e);
}
}
/**
//Test case number: 179
/*Coverage entropy=2.2151922093961676
*/
@Test(timeout = 4000)
public void test179() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", ":S");
TableBlock tableBlock0 = new TableBlock(fileInput0);
NumberInput numberInput0 = new NumberInput(tableBlock0, "button", "button");
// Undeclared exception!
try {
numberInput0.blockquote();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 180
/*Coverage entropy=2.2151922093961676
*/
@Test(timeout = 4000)
public void test180() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
TableRow tableRow0 = new TableRow(errorPage0);
Checkbox checkbox0 = new Checkbox(tableRow0, "ul", "ul");
// Undeclared exception!
try {
checkbox0.big((Object) checkbox0);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 181
/*Coverage entropy=1.9459101490553132
*/
@Test(timeout = 4000)
public void test181() throws Throwable {
ElExpression elExpression0 = new ElExpression("Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .");
Form form0 = new Form("!vgRjsbLi(i-D$}[R");
NumberInput numberInput0 = new NumberInput(form0, "", "toString()");
CheckboxGroup checkboxGroup0 = new CheckboxGroup(numberInput0, "okwLqF3<P0E']w7:u5", "okwLqF3<P0E']w7:u5", (ISelectModel) null, elExpression0);
// Undeclared exception!
try {
numberInput0.big((Object) checkboxGroup0);
fail("Expecting exception: ClassCastException");
} catch(ClassCastException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 182
/*Coverage entropy=2.2343358078055116
*/
@Test(timeout = 4000)
public void test182() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Hidden hidden0 = new Hidden(errorPage0, "J^", "w:N7F9N/*z|M%Jzn+Cm");
// Undeclared exception!
try {
hidden0.bdo("w:N7F9N/*z|M%Jzn+Cm");
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 183
/*Coverage entropy=1.7917594692280554
*/
@Test(timeout = 4000)
public void test183() throws Throwable {
Hidden hidden0 = new Hidden((Component) null, ".", ".");
// Undeclared exception!
try {
hidden0.bdo(".");
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 184
/*Coverage entropy=2.31428283498313
*/
@Test(timeout = 4000)
public void test184() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", "l");
TableBlock tableBlock0 = new TableBlock(fileInput0);
Checkbox checkbox0 = new Checkbox(tableBlock0, "l", "l");
// Undeclared exception!
try {
checkbox0.base("^s*");
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 185
/*Coverage entropy=1.559581156259877
*/
@Test(timeout = 4000)
public void test185() throws Throwable {
XmlEntityRef xmlEntityRef0 = new XmlEntityRef("-&KO(+|@n1yAl+bDJ");
// Undeclared exception!
try {
xmlEntityRef0.base("-&KO(+|@n1yAl+bDJ");
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 186
/*Coverage entropy=1.8184831630123652
*/
@Test(timeout = 4000)
public void test186() throws Throwable {
Hidden hidden0 = new Hidden((Component) null, "keCz_tq^)", "keCz_tq^)");
Checkbox checkbox0 = new Checkbox(hidden0, "?qeS?!&Wqia%/W%Os", "keCz_tq^)");
// Undeclared exception!
try {
checkbox0.base("keCz_tq^)");
fail("Expecting exception: ClassCastException");
} catch(ClassCastException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 187
/*Coverage entropy=2.246213836677445
*/
@Test(timeout = 4000)
public void test187() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Submit submit0 = new Submit(errorPage0, "", "");
// Undeclared exception!
try {
submit0.b();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 188
/*Coverage entropy=1.7917594692280554
*/
@Test(timeout = 4000)
public void test188() throws Throwable {
Submit submit0 = new Submit((Component) null, "var", "hr");
// Undeclared exception!
try {
submit0.b();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 189
/*Coverage entropy=1.9459101490553132
*/
@Test(timeout = 4000)
public void test189() throws Throwable {
XmlEntityRef xmlEntityRef0 = new XmlEntityRef("Q");
Submit submit0 = new Submit(xmlEntityRef0, "h4 +n#-Nr-m_fc6{RJF", "Cp27qP`Z0|P%(-");
// Undeclared exception!
try {
submit0.b();
fail("Expecting exception: ClassCastException");
} catch(ClassCastException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 190
/*Coverage entropy=2.37731584164162
*/
@Test(timeout = 4000)
public void test190() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Submit submit0 = new Submit(errorPage0, "", "l");
Table table0 = new Table(submit0, "l");
String[] stringArray0 = new String[7];
// Undeclared exception!
try {
table0.area(stringArray0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Attributes must be given in name, value pairs.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 191
/*Coverage entropy=2.2343358078055116
*/
@Test(timeout = 4000)
public void test191() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Hidden hidden0 = new Hidden(errorPage0, ";&DEk$s`CF|fb", "wbS8^ZLz#<.`n#+nX");
// Undeclared exception!
try {
hidden0.address((Object) "strike");
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 192
/*Coverage entropy=1.791759469228055
*/
@Test(timeout = 4000)
public void test192() throws Throwable {
Hidden hidden0 = new Hidden((Component) null, "keCz_tq^)", "keCz_tq^)");
DateInput dateInput0 = new DateInput((Component) null, "h2", "keCz_tq^)", "keCz_tq^)");
// Undeclared exception!
try {
hidden0.address((Object) dateInput0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 193
/*Coverage entropy=1.5498260458782016
*/
@Test(timeout = 4000)
public void test193() throws Throwable {
Form form0 = new Form("h3");
// Undeclared exception!
try {
form0.address();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 194
/*Coverage entropy=2.1524913125743104
*/
@Test(timeout = 4000)
public void test194() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
TextArea textArea0 = new TextArea(errorPage0, "L~s\"jkk", "java.lang.String@0000000021");
// Undeclared exception!
try {
textArea0.acronym((Object) "8]]RduY$Uv");
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 195
/*Coverage entropy=2.3889622139650086
*/
@Test(timeout = 4000)
public void test195() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Submit submit0 = new Submit(errorPage0, "", "l");
Table table0 = new Table(submit0, "l");
TextInput textInput0 = new TextInput(table0, "table", "double");
// Undeclared exception!
try {
textInput0.acronym();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 196
/*Coverage entropy=2.2343358078055116
*/
@Test(timeout = 4000)
public void test196() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", ":S");
Object object0 = new Object();
// Undeclared exception!
try {
fileInput0.abbr(object0);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 197
/*Coverage entropy=2.2343358078055116
*/
@Test(timeout = 4000)
public void test197() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Checkbox checkbox0 = new Checkbox(errorPage0, "a^", "a^");
// Undeclared exception!
try {
checkbox0.abbr();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 198
/*Coverage entropy=1.7351264569629226
*/
@Test(timeout = 4000)
public void test198() throws Throwable {
Form form0 = new Form("3 $S8,ij{k");
// Undeclared exception!
try {
form0.a((Object) "3 $S8,ij{k");
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 199
/*Coverage entropy=2.214810368050709
*/
@Test(timeout = 4000)
public void test199() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
String string0 = "RfN)Y/BL&miB\\uR";
Hidden hidden0 = new Hidden(errorPage0, string0, "_");
// Undeclared exception!
try {
hidden0.a();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 200
/*Coverage entropy=1.791759469228055
*/
@Test(timeout = 4000)
public void test200() throws Throwable {
Hidden hidden0 = new Hidden((Component) null, ".", ".");
// Undeclared exception!
try {
hidden0.a();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 201
/*Coverage entropy=1.3296613488547582
*/
@Test(timeout = 4000)
public void test201() throws Throwable {
Form form0 = new Form("tt");
// Undeclared exception!
try {
form0._wrapComponentId("");
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// No top level component found.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 202
/*Coverage entropy=0.6931471805599453
*/
@Test(timeout = 4000)
public void test202() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
errorPage0.eval("keCz_tq^)");
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 203
/*Coverage entropy=2.3028553222842683
*/
@Test(timeout = 4000)
public void test203() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.h3();
component0._wrapComponentId("Label_1");
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(component0._isGeneratedId());
}
/**
//Test case number: 204
/*Coverage entropy=2.601222413040274
*/
@Test(timeout = 4000)
public void test204() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "Aa^", ":S");
TableBlock tableBlock0 = new TableBlock(fileInput0);
tableBlock0.big((Object) fileInput0);
// Undeclared exception!
try {
tableBlock0.find("_");
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Could not find component with id _ on the page.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 205
/*Coverage entropy=1.9561874676604514
*/
@Test(timeout = 4000)
public void test205() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
TextArea textArea0 = new TextArea(errorPage0, "L~s\"jkk", "Attributes must be given in name, value pairs.");
// Undeclared exception!
try {
textArea0.find("i");
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Could not find component with id i on the page.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 206
/*Coverage entropy=2.235138530870877
*/
@Test(timeout = 4000)
public void test206() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
TableRow tableRow0 = new TableRow(errorPage0);
Float float0 = new Float(0.0);
tableRow0.u((Object) float0);
Component component0 = tableRow0.q();
assertTrue(component0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 207
/*Coverage entropy=0.6931471805599453
*/
@Test(timeout = 4000)
public void test207() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
errorPage0.getComponents();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 208
/*Coverage entropy=2.182897499410536
*/
@Test(timeout = 4000)
public void test208() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Select select0 = new Select(errorPage0, "java.lang.String@0000000007", "java.lang.String@0000000010", (ISelectModel) null, "java.lang.String@0000000010");
Table table0 = new Table(select0, "java.lang.String@0000000010");
TableBlock tableBlock0 = table0.colgroup();
Hidden hidden0 = new Hidden(tableBlock0, "java.lang.String@0000000007", "-|?7?Jk");
StandaloneComponent standaloneComponent0 = hidden0.getPage();
assertEquals("wheel_ErrorPage", standaloneComponent0.getComponentId());
assertTrue(tableBlock0._isGeneratedId());
}
/**
//Test case number: 209
/*Coverage entropy=1.0549201679861442
*/
@Test(timeout = 4000)
public void test209() throws Throwable {
XmlEntityRef xmlEntityRef0 = new XmlEntityRef("9o1B$tz|$R/&\"MQIG%");
// Undeclared exception!
try {
xmlEntityRef0.getPage();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 210
/*Coverage entropy=1.0549201679861442
*/
@Test(timeout = 4000)
public void test210() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
StandaloneComponent standaloneComponent0 = errorPage0.getPage();
assertEquals("wheel_ErrorPage", standaloneComponent0.getComponentId());
}
/**
//Test case number: 211
/*Coverage entropy=1.2730283365896256
*/
@Test(timeout = 4000)
public void test211() throws Throwable {
XmlEntityRef xmlEntityRef0 = new XmlEntityRef("TN~kA9UjsY>4g%M");
TextArea textArea0 = new TextArea(xmlEntityRef0, "Label_1", "Ws\"jHk");
// Undeclared exception!
try {
textArea0.getPage();
fail("Expecting exception: ClassCastException");
} catch(ClassCastException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 212
/*Coverage entropy=1.6715952780212542
*/
@Test(timeout = 4000)
public void test212() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Checkbox checkbox0 = new Checkbox(errorPage0, "Unsuported type give for dateFormat. Supprted types are: Date, Calendar, Long/long .", "Unsuported type give for dateFormat. Supprted types are: Date, Calendar, Long/long .");
StandaloneComponent standaloneComponent0 = checkbox0._getTopLevelComponent(true);
assertEquals("wheel_ErrorPage", standaloneComponent0.getComponentId());
}
/**
//Test case number: 213
/*Coverage entropy=1.6488470716724795
*/
@Test(timeout = 4000)
public void test213() throws Throwable {
XmlEntityRef xmlEntityRef0 = new XmlEntityRef("java.lang.String@0000000021");
Checkbox checkbox0 = new Checkbox(xmlEntityRef0, "java.lang.String@0000000021", "NM&~l^4.:Vk7>&");
// Undeclared exception!
try {
checkbox0._getTopLevelComponent(false);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// No top level component found.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 214
/*Coverage entropy=0.6931471805599453
*/
@Test(timeout = 4000)
public void test214() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
StandaloneComponent standaloneComponent0 = errorPage0._getTopLevelComponent(true);
assertEquals("wheel_ErrorPage", standaloneComponent0.getComponentId());
}
/**
//Test case number: 215
/*Coverage entropy=1.700164942414579
*/
@Test(timeout = 4000)
public void test215() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
TableBlock tableBlock0 = new TableBlock(errorPage0, "Unsuported type give for dateFormat. Supprted types are: Date, Calendar, Long/long .");
tableBlock0._getForm(false);
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 216
/*Coverage entropy=2.0011827628010703
*/
@Test(timeout = 4000)
public void test216() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", ":S");
TableBlock tableBlock0 = new TableBlock(fileInput0);
tableBlock0._getForm(true);
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(tableBlock0._isGeneratedId());
}
/**
//Test case number: 217
/*Coverage entropy=2.515729839517715
*/
@Test(timeout = 4000)
public void test217() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", ":S");
TableBlock tableBlock0 = new TableBlock(fileInput0);
Checkbox checkbox0 = new Checkbox(tableBlock0, ":S", "button");
errorPage0.table();
Label label0 = new Label(checkbox0, checkbox0);
label0.id("(~=-~j8");
assertTrue(tableBlock0._isGeneratedId());
assertFalse(label0._isGeneratedId());
}
/**
//Test case number: 218
/*Coverage entropy=0.6365141682948128
*/
@Test(timeout = 4000)
public void test218() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
List<CharSequence> list0 = errorPage0._getRenderHints();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertNotNull(list0);
}
/**
//Test case number: 219
/*Coverage entropy=0.6365141682948128
*/
@Test(timeout = 4000)
public void test219() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
errorPage0.create();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 220
/*Coverage entropy=0.6365141682948128
*/
@Test(timeout = 4000)
public void test220() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
errorPage0._getChildren();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 221
/*Coverage entropy=0.6365141682948128
*/
@Test(timeout = 4000)
public void test221() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
errorPage0._getAction();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 222
/*Coverage entropy=1.3862943611198906
*/
@Test(timeout = 4000)
public void test222() throws Throwable {
ElExpression elExpression0 = new ElExpression("Unsuported type give for dateFormat. Supprted types are: Date, Calendar, Long/long .");
ErrorPage errorPage0 = new ErrorPage();
// Undeclared exception!
try {
errorPage0.attribute((String) null, elExpression0);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Could not evaluate expression Unsuported type give for dateFormat. Supprted types are: Date, Calendar, Long/long . in class wheel.ErrorPage
//
verifyException("wheel.components.ElExpression", e);
}
}
/**
//Test case number: 223
/*Coverage entropy=2.3967963157322765
*/
@Test(timeout = 4000)
public void test223() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Table table0 = new Table(errorPage0, "org.mvel.util.ThisLiteral");
TableBlock tableBlock0 = table0.tbody();
TextInput textInput0 = new TextInput(tableBlock0, "java.lang.String@0000000021", "Unsupported type given for dateFormat. Yupported types are: Date, nalendar, Long/lrng.");
Component component0 = textInput0.renderHint("Unsupported type given for dateFormat. Yupported types are: Date, nalendar, Long/lrng.");
component0.renderHint("Label_1");
assertTrue(tableBlock0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 224
/*Coverage entropy=1.7328679513998633
*/
@Test(timeout = 4000)
public void test224() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
TableRow tableRow0 = new TableRow(errorPage0);
tableRow0.getEngine();
assertTrue(tableRow0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 225
/*Coverage entropy=0.6365141682948128
*/
@Test(timeout = 4000)
public void test225() throws Throwable {
XmlEntityRef xmlEntityRef0 = new XmlEntityRef("9o1B$tz|eR/6M&\"MQIG%");
xmlEntityRef0.afterAdd();
assertEquals("9o1B$tz|eR/6M&\"MQIG%", xmlEntityRef0.getComponentId());
}
/**
//Test case number: 226
/*Coverage entropy=1.9061547465398496
*/
@Test(timeout = 4000)
public void test226() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", "l");
TableBlock tableBlock0 = new TableBlock(fileInput0);
Checkbox checkbox0 = new Checkbox(tableBlock0, "l", "l");
checkbox0._setGeneratedId(false);
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertFalse(checkbox0._isGeneratedId());
}
/**
//Test case number: 227
/*Coverage entropy=1.3296613488547582
*/
@Test(timeout = 4000)
public void test227() throws Throwable {
Form form0 = new Form("blockquote");
// Undeclared exception!
try {
form0.head();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 228
/*Coverage entropy=2.017746072809222
*/
@Test(timeout = 4000)
public void test228() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", "l");
TableBlock tableBlock0 = new TableBlock(fileInput0);
Checkbox checkbox0 = new Checkbox(tableBlock0, "l", "l");
checkbox0._isGeneratedId();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(tableBlock0._isGeneratedId());
}
/**
//Test case number: 229
/*Coverage entropy=0.6365141682948128
*/
@Test(timeout = 4000)
public void test229() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
errorPage0._setComponentId("-->");
assertEquals("div", errorPage0.defaultTagName());
}
/**
//Test case number: 230
/*Coverage entropy=2.3142828349831306
*/
@Test(timeout = 4000)
public void test230() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a", ":S");
TableBlock tableBlock0 = new TableBlock(fileInput0);
Checkbox checkbox0 = new Checkbox(tableBlock0, ":S", "br!on");
// Undeclared exception!
try {
checkbox0.meta();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 231
/*Coverage entropy=2.3041587116405955
*/
@Test(timeout = 4000)
public void test231() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
ActionExpression actionExpression0 = new ActionExpression("l>)uo=)LH 6W");
Form form0 = new Form(errorPage0, "c[6Rv\"\"g)}", actionExpression0);
Checkbox checkbox0 = new Checkbox(form0, "Q0;!/>_\"7%alT$", "Q0;!/>_\"7%alT$");
// Undeclared exception!
try {
checkbox0.wBlock(actionExpression0);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 232
/*Coverage entropy=2.203399008114057
*/
@Test(timeout = 4000)
public void test232() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.sup((Object) " = ");
component0.getComponentId();
assertTrue(component0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 233
/*Coverage entropy=1.3208883431493221
*/
@Test(timeout = 4000)
public void test233() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
ActionExpression actionExpression0 = new ActionExpression("area");
Component component0 = errorPage0.actionBinding(actionExpression0);
assertEquals("wheel_ErrorPage", component0.getComponentId());
}
/**
//Test case number: 234
/*Coverage entropy=1.4270610433807247
*/
@Test(timeout = 4000)
public void test234() throws Throwable {
Submit submit0 = new Submit((Component) null, "Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .", "Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .");
// Undeclared exception!
try {
submit0.add((Component) null);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 235
/*Coverage entropy=0.6365141682948128
*/
@Test(timeout = 4000)
public void test235() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
errorPage0.date();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 236
/*Coverage entropy=1.9812075507356175
*/
@Test(timeout = 4000)
public void test236() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", ":S");
TableBlock tableBlock0 = new TableBlock(fileInput0);
Checkbox checkbox0 = new Checkbox(tableBlock0, ":S", "button");
Image image0 = new Image(tableBlock0, ":S", "button");
// Undeclared exception!
try {
checkbox0.remove((Component) image0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 237
/*Coverage entropy=1.0397207708399179
*/
@Test(timeout = 4000)
public void test237() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
// Undeclared exception!
try {
errorPage0.end();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Could not end compoennt, already at root.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 238
/*Coverage entropy=2.4121343884149504
*/
@Test(timeout = 4000)
public void test238() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Table table0 = new Table(errorPage0, "org.mvel.util.ThisLiteral");
TableBlock tableBlock0 = table0.tbody();
tableBlock0.end();
assertTrue(tableBlock0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 239
/*Coverage entropy=1.0397207708399179
*/
@Test(timeout = 4000)
public void test239() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
// Undeclared exception!
try {
errorPage0.end("java.lang.String@0000000016");
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// No corresponding component found for end expression 'java.lang.String@0000000016'.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 240
/*Coverage entropy=1.8875892793369464
*/
@Test(timeout = 4000)
public void test240() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
ElExpression elExpression0 = new ElExpression(":S");
Table table0 = new Table(errorPage0, ":S");
table0.renderHint(elExpression0);
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 241
/*Coverage entropy=1.6417347121875212
*/
@Test(timeout = 4000)
public void test241() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
String string0 = "RfN)Y/BL&miB\\uR";
Hidden hidden0 = new Hidden(errorPage0, string0, "_");
ElExpression elExpression0 = new ElExpression("3C~,^Z33t5LE-PEJf");
TextArea textArea0 = new TextArea(hidden0, "_", "Label_3");
List<Component> list0 = textArea0.findAll(elExpression0);
assertNotNull(list0);
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 242
/*Coverage entropy=2.640548203337539
*/
@Test(timeout = 4000)
public void test242() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
ActionExpression actionExpression0 = new ActionExpression("E^");
ActionExpression actionExpression1 = actionExpression0.updateComponent("3C~,^Z33t5LE-PEJf");
errorPage0.form("3C~,^Z33t5LE-PEJf", actionExpression1);
String string0 = actionExpression0.getUpdateComponentFunctionCall();
assertNotNull(string0);
}
/**
//Test case number: 243
/*Coverage entropy=2.2450352741261774
*/
@Test(timeout = 4000)
public void test243() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", ":S");
TableBlock tableBlock0 = new TableBlock(fileInput0);
// Undeclared exception!
try {
tableBlock0.get("acronym");
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Could not find component with id 'acronym'.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 244
/*Coverage entropy=1.6762349391347304
*/
@Test(timeout = 4000)
public void test244() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", "l");
// Undeclared exception!
try {
fileInput0.up(835);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 245
/*Coverage entropy=2.0413452698399546
*/
@Test(timeout = 4000)
public void test245() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", "a^");
TableBlock tableBlock0 = new TableBlock(fileInput0);
boolean boolean0 = tableBlock0.equals("java.lang.String@0000000016");
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertFalse(boolean0);
assertTrue(tableBlock0._isGeneratedId());
}
/**
//Test case number: 246
/*Coverage entropy=2.236421438217656
*/
@Test(timeout = 4000)
public void test246() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Table table0 = new Table(errorPage0, "java.lang.String@0000000010");
TableBlock tableBlock0 = table0.colgroup();
boolean boolean0 = tableBlock0.equals((Object) null);
assertFalse(boolean0);
assertTrue(tableBlock0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 247
/*Coverage entropy=2.4275791213691265
*/
@Test(timeout = 4000)
public void test247() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Table table0 = new Table(errorPage0, "E^");
TableBlock tableBlock0 = table0.tfoot();
assertTrue(tableBlock0._isGeneratedId());
errorPage0._clear();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 248
/*Coverage entropy=2.457486534261374
*/
@Test(timeout = 4000)
public void test248() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", ":S");
TableBlock tableBlock0 = new TableBlock(fileInput0);
Table table0 = new Table(tableBlock0, "a^");
table0.tbody();
table0._clear();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(tableBlock0._isGeneratedId());
}
/**
//Test case number: 249
/*Coverage entropy=1.2130075659799042
*/
@Test(timeout = 4000)
public void test249() throws Throwable {
Checkbox checkbox0 = new Checkbox((Component) null, " posAmp=", " posAmp=");
Checkbox checkbox1 = (Checkbox)checkbox0.addInternalRenderHint(" posAmp=");
assertEquals("input", checkbox1.defaultTagName());
}
/**
//Test case number: 250
/*Coverage entropy=2.3140920479838796
*/
@Test(timeout = 4000)
public void test250() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.h6();
component0.getComponents();
assertTrue(component0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 251
/*Coverage entropy=1.0114042647073518
*/
@Test(timeout = 4000)
public void test251() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
// Undeclared exception!
try {
errorPage0._getTopLevelComponent(false);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// No top level component found.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 252
/*Coverage entropy=2.04319187054512
*/
@Test(timeout = 4000)
public void test252() throws Throwable {
Form form0 = new Form("blockquote");
Submit submit0 = new Submit(form0, "Nj4/leX3.@0[", "blockquote");
// Undeclared exception!
try {
submit0.textarea((String) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 253
/*Coverage entropy=2.47504463418605
*/
@Test(timeout = 4000)
public void test253() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Block block0 = (Block)errorPage0.h6();
assertTrue(block0._isGeneratedId());
block0.id("RV");
assertFalse(block0._isGeneratedId());
}
/**
//Test case number: 254
/*Coverage entropy=2.47504463418605
*/
@Test(timeout = 4000)
public void test254() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
TableRow tableRow0 = new TableRow(errorPage0);
Float float0 = new Float(0.0);
tableRow0.u((Object) float0);
ErrorPage errorPage1 = (ErrorPage)errorPage0.id(" encoding=");
assertFalse(errorPage1._isBuilt());
}
/**
//Test case number: 255
/*Coverage entropy=1.985053187904615
*/
@Test(timeout = 4000)
public void test255() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
ActionExpression actionExpression0 = new ActionExpression("l>)uo=)LH 6W");
Form form0 = new Form(errorPage0, "c[6Rv\"\"g)}", actionExpression0);
// Undeclared exception!
try {
form0.id("Q0;!/>_\"7%alT$");
fail("Expecting exception: UnsupportedOperationException");
} catch(UnsupportedOperationException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("java.util.AbstractMap", e);
}
}
/**
//Test case number: 256
/*Coverage entropy=1.7481554572476758
*/
@Test(timeout = 4000)
public void test256() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
// Undeclared exception!
try {
errorPage0.id("org.mvel.conversion.BigDecimalCH$11");
fail("Expecting exception: UnsupportedOperationException");
} catch(UnsupportedOperationException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("java.util.AbstractMap", e);
}
}
/**
//Test case number: 257
/*Coverage entropy=2.3064366949688155
*/
@Test(timeout = 4000)
public void test257() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", ":S");
// Undeclared exception!
try {
fileInput0.id(":S");
fail("Expecting exception: UnsupportedOperationException");
} catch(UnsupportedOperationException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("java.util.AbstractMap", e);
}
}
/**
//Test case number: 258
/*Coverage entropy=2.1612871195761536
*/
@Test(timeout = 4000)
public void test258() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
TableRow tableRow0 = new TableRow(errorPage0);
Any any0 = new Any(tableRow0, "On");
any0.toString();
assertEquals("Any_1", any0.getComponentId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 259
/*Coverage entropy=2.270825355111219
*/
@Test(timeout = 4000)
public void test259() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Table table0 = new Table(errorPage0, "java.lang.String@0000000010");
TableBlock tableBlock0 = table0.colgroup();
Checkbox checkbox0 = new Checkbox(tableBlock0, "java.lang.String@0000000010", "hZi)q.yrp");
List<RenderableComponent> list0 = checkbox0._getRenderableChildren();
assertTrue(tableBlock0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertNotNull(list0);
}
/**
//Test case number: 260
/*Coverage entropy=2.0413452698399546
*/
@Test(timeout = 4000)
public void test260() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a", "u:&a");
TableBlock tableBlock0 = new TableBlock(fileInput0);
Checkbox checkbox0 = new Checkbox(tableBlock0, "u:&a", "br!on");
String[] stringArray0 = new String[1];
// Undeclared exception!
try {
checkbox0.attributes(stringArray0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Attributes must be given in name, value pairs.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 261
/*Coverage entropy=1.515707952085713
*/
@Test(timeout = 4000)
public void test261() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Checkbox checkbox0 = new Checkbox(errorPage0, "4IgJD74", "h*%,LBaXdP;YT");
String[] stringArray0 = new String[0];
checkbox0.attributes(stringArray0);
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 262
/*Coverage entropy=1.9172155185650601
*/
@Test(timeout = 4000)
public void test262() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "^", "l");
TableBlock tableBlock0 = new TableBlock(fileInput0);
Checkbox checkbox0 = new Checkbox(tableBlock0, "l", "l");
Select select0 = new Select(errorPage0, "\\", "", "l", (ISelectModel) null, false);
Label label0 = new Label(checkbox0, select0);
label0.attributes((String[]) null);
assertTrue(select0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 263
/*Coverage entropy=2.203399008114057
*/
@Test(timeout = 4000)
public void test263() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.code();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(component0._isGeneratedId());
}
/**
//Test case number: 264
/*Coverage entropy=2.399028713590892
*/
@Test(timeout = 4000)
public void test264() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", "l");
TableBlock tableBlock0 = new TableBlock(fileInput0);
Component component0 = tableBlock0.em((Object) null);
assertTrue(component0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 265
/*Coverage entropy=2.246163027094038
*/
@Test(timeout = 4000)
public void test265() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
TextInput textInput0 = new TextInput(errorPage0, (String) null, (String) null);
// Undeclared exception!
try {
textInput0.h1();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 266
/*Coverage entropy=2.265519645571082
*/
@Test(timeout = 4000)
public void test266() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.address();
LocalDate localDate0 = MockLocalDate.now();
Component component1 = component0.cite((Object) localDate0);
assertTrue(component1._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 267
/*Coverage entropy=2.594457153572979
*/
@Test(timeout = 4000)
public void test267() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "Aa^", ":S");
TableBlock tableBlock0 = new TableBlock(fileInput0);
Component component0 = tableBlock0.big((Object) fileInput0);
component0.del((Object) component0);
// Undeclared exception!
try {
tableBlock0.find("_");
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Could not find component with id _ on the page.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 268
/*Coverage entropy=2.3876507816031727
*/
@Test(timeout = 4000)
public void test268() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", ":S");
TableBlock tableBlock0 = new TableBlock(fileInput0);
TableRow tableRow0 = tableBlock0.tr();
Table table0 = new Table(errorPage0, "");
Component component0 = table0.h5((Object) tableRow0);
component0.addFirst(tableBlock0);
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertEquals("Table_1", table0.getComponentId());
}
/**
//Test case number: 269
/*Coverage entropy=2.203399008114057
*/
@Test(timeout = 4000)
public void test269() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.dfn();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(component0._isGeneratedId());
}
/**
//Test case number: 270
/*Coverage entropy=2.388234115937288
*/
@Test(timeout = 4000)
public void test270() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Checkbox checkbox0 = new Checkbox(errorPage0, "a^", "[g*`'h(@o4t/H{GlQ;");
TableBlock tableBlock0 = new TableBlock(checkbox0);
Component component0 = tableBlock0.sup();
assertTrue(component0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 271
/*Coverage entropy=2.203399008114057
*/
@Test(timeout = 4000)
public void test271() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.noscript();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(component0._isGeneratedId());
}
/**
//Test case number: 272
/*Coverage entropy=2.2351385308708775
*/
@Test(timeout = 4000)
public void test272() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
TableRow tableRow0 = new TableRow(errorPage0);
tableRow0.q();
Component component0 = tableRow0.u();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(component0._isGeneratedId());
}
/**
//Test case number: 273
/*Coverage entropy=1.5498260458782016
*/
@Test(timeout = 4000)
public void test273() throws Throwable {
Form form0 = new Form((String) null);
// Undeclared exception!
try {
form0.span();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 274
/*Coverage entropy=2.2343358078055116
*/
@Test(timeout = 4000)
public void test274() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Submit submit0 = new Submit(errorPage0, "vvi.z&s:", "Attributes must be given in name, value pairs.");
// Undeclared exception!
try {
submit0.pre((Object) "^^I");
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 275
/*Coverage entropy=1.4708084763221112
*/
@Test(timeout = 4000)
public void test275() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Hidden hidden0 = new Hidden(errorPage0, "kvpRrfw.[Qssn(R\"p", ":S");
// Undeclared exception!
try {
hidden0.td();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Td component can be added only to a TableRow.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 276
/*Coverage entropy=1.4270610433807247
*/
@Test(timeout = 4000)
public void test276() throws Throwable {
Hidden hidden0 = new Hidden((Component) null, "keCz_tq^)", "keCz_tq^)");
Submit submit0 = new Submit((Component) null, "var", "var");
// Undeclared exception!
try {
submit0.addFirst(hidden0);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 277
/*Coverage entropy=1.3296613488547582
*/
@Test(timeout = 4000)
public void test277() throws Throwable {
XmlEntityRef xmlEntityRef0 = new XmlEntityRef("TN~kA9UjsY>4g%M");
// Undeclared exception!
try {
xmlEntityRef0.body();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 278
/*Coverage entropy=2.203399008114057
*/
@Test(timeout = 4000)
public void test278() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
TableRow tableRow0 = new TableRow(errorPage0);
Component component0 = errorPage0.p((Object) tableRow0);
assertTrue(component0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 279
/*Coverage entropy=2.1774844871094987
*/
@Test(timeout = 4000)
public void test279() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a", ":S");
TableBlock tableBlock0 = new TableBlock(fileInput0);
Checkbox checkbox0 = new Checkbox(tableBlock0, ":S", "br!on");
// Undeclared exception!
try {
checkbox0.a((Object) "br!on");
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 280
/*Coverage entropy=2.203399008114057
*/
@Test(timeout = 4000)
public void test280() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
StringBuilder stringBuilder0 = new StringBuilder();
Component component0 = errorPage0.label((Object) stringBuilder0);
assertTrue(component0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 281
/*Coverage entropy=0.6365141682948128
*/
@Test(timeout = 4000)
public void test281() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
// Undeclared exception!
try {
errorPage0.caption();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Thead component can be added only to a Table.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 282
/*Coverage entropy=2.3218909324139965
*/
@Test(timeout = 4000)
public void test282() throws Throwable {
ElExpression elExpression0 = new ElExpression((String) null);
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.param(elExpression0, "keCz_tq^)");
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertEquals("Any_1", component0.getComponentId());
}
/**
//Test case number: 283
/*Coverage entropy=1.4941751382893085
*/
@Test(timeout = 4000)
public void test283() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
// Undeclared exception!
try {
errorPage0.reset("");
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Form elements can be created only by compoents that are attached to a form component.
//
verifyException("wheel.components.ComponentCreator", e);
}
}
/**
//Test case number: 284
/*Coverage entropy=1.5832584594204766
*/
@Test(timeout = 4000)
public void test284() throws Throwable {
Hidden hidden0 = new Hidden((Component) null, "keCz_tq^)", "keCz_tq^)");
// Undeclared exception!
try {
hidden0.ol();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 285
/*Coverage entropy=2.3686977464340297
*/
@Test(timeout = 4000)
public void test285() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "button", "button");
Component component0 = errorPage0.strong((Object) fileInput0);
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(component0._isGeneratedId());
}
/**
//Test case number: 286
/*Coverage entropy=1.9812075507356175
*/
@Test(timeout = 4000)
public void test286() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Checkbox checkbox0 = new Checkbox(errorPage0, "@j^Dfy_T", "B 7}:<>`X^E%.T&cWl");
DynamicSelectModel dynamicSelectModel0 = checkbox0.selectModel();
// Undeclared exception!
try {
checkbox0.select("B 7}:<>`X^E%.T&cWl", dynamicSelectModel0, "@j^Dfy_T");
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Form elements can be created only by compoents that are attached to a form component.
//
verifyException("wheel.components.ComponentCreator", e);
}
}
/**
//Test case number: 287
/*Coverage entropy=1.2130075659799042
*/
@Test(timeout = 4000)
public void test287() throws Throwable {
DateInput dateInput0 = new DateInput((Component) null, "Could not parse '", "keCz_tq^)", "keCz_tq^)");
TextInput textInput0 = new TextInput((Component) null, "keCz_tq^)", "Could not parse '");
textInput0._setParent(dateInput0);
assertEquals("Could not parse '", dateInput0.getFormElementName());
}
/**
//Test case number: 288
/*Coverage entropy=2.203399008114057
*/
@Test(timeout = 4000)
public void test288() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
CharBuffer charBuffer0 = CharBuffer.allocate(1019);
Component component0 = errorPage0.address((Object) charBuffer0);
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(component0._isGeneratedId());
}
/**
//Test case number: 289
/*Coverage entropy=1.4270610433807247
*/
@Test(timeout = 4000)
public void test289() throws Throwable {
TextInput textInput0 = new TextInput((Component) null, "keCz_tq^)", "Could not parse '");
textInput0._clear();
assertFalse(textInput0._isGeneratedId());
}
/**
//Test case number: 290
/*Coverage entropy=1.5607104090414063
*/
@Test(timeout = 4000)
public void test290() throws Throwable {
XmlEntityRef xmlEntityRef0 = new XmlEntityRef((String) null);
// Undeclared exception!
try {
xmlEntityRef0.style();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 291
/*Coverage entropy=2.1285490048751514
*/
@Test(timeout = 4000)
public void test291() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Submit submit0 = new Submit(errorPage0, "k$GT$v)[Zyiy", "");
// Undeclared exception!
try {
submit0.textarea("");
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Form elements can be created only by compoents that are attached to a form component.
//
verifyException("wheel.components.ComponentCreator", e);
}
}
/**
//Test case number: 292
/*Coverage entropy=2.2343358078055116
*/
@Test(timeout = 4000)
public void test292() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Hidden hidden0 = new Hidden(errorPage0, "f,Zc/DVWi", "f,Zc/DVWi");
// Undeclared exception!
try {
hidden0.u((Object) errorPage0);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 293
/*Coverage entropy=1.559581156259877
*/
@Test(timeout = 4000)
public void test293() throws Throwable {
Form form0 = new Form("vaDlue");
// Undeclared exception!
try {
form0.br();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 294
/*Coverage entropy=1.559581156259877
*/
@Test(timeout = 4000)
public void test294() throws Throwable {
XmlEntityRef xmlEntityRef0 = new XmlEntityRef(".");
// Undeclared exception!
try {
xmlEntityRef0.table();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 295
/*Coverage entropy=1.7782333057997075
*/
@Test(timeout = 4000)
public void test295() throws Throwable {
Submit submit0 = new Submit((Component) null, "6]yXT0;Zr", "OUS'5GQG\"");
// Undeclared exception!
try {
submit0.textInput("s");
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Form elements can be created only by compoents that are attached to a form component.
//
verifyException("wheel.components.ComponentCreator", e);
}
}
/**
//Test case number: 296
/*Coverage entropy=1.9041911973400683
*/
@Test(timeout = 4000)
public void test296() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Hidden hidden0 = new Hidden(errorPage0, "E^", "_");
TableBlock tableBlock0 = new TableBlock(hidden0, "^X_S&~5b2.$QGta");
// Undeclared exception!
try {
tableBlock0.th();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Th component can be added only to a TableRow.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 297
/*Coverage entropy=0.6365141682948128
*/
@Test(timeout = 4000)
public void test297() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
errorPage0.action("aZ4yz@o");
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 298
/*Coverage entropy=1.7917594692280554
*/
@Test(timeout = 4000)
public void test298() throws Throwable {
TextInput textInput0 = new TextInput((Component) null, "keCz_tq^)", "Could not parse '");
Submit submit0 = new Submit((Component) null, "var", "hr");
// Undeclared exception!
try {
submit0.rawText(textInput0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 299
/*Coverage entropy=1.7917594692280554
*/
@Test(timeout = 4000)
public void test299() throws Throwable {
Submit submit0 = new Submit((Component) null, "var", "hr");
// Undeclared exception!
try {
submit0.sub();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 300
/*Coverage entropy=2.5437079022278075
*/
@Test(timeout = 4000)
public void test300() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Table table0 = new Table(errorPage0, "E^");
TableBlock tableBlock0 = table0.thead();
// Undeclared exception!
try {
tableBlock0.submit("Could not evaluate expression ");
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Form elements can be created only by compoents that are attached to a form component.
//
verifyException("wheel.components.ComponentCreator", e);
}
}
/**
//Test case number: 301
/*Coverage entropy=2.388234115937288
*/
@Test(timeout = 4000)
public void test301() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", "a^");
TableBlock tableBlock0 = new TableBlock(fileInput0);
Component component0 = tableBlock0.link();
assertTrue(component0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 302
/*Coverage entropy=2.203399008114057
*/
@Test(timeout = 4000)
public void test302() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.cite();
assertTrue(component0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 303
/*Coverage entropy=2.4284049859711825
*/
@Test(timeout = 4000)
public void test303() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
TableBlock tableBlock0 = new TableBlock(errorPage0, "/X<]w~Ck");
TableRow tableRow0 = tableBlock0.tr();
Checkbox checkbox0 = new Checkbox(tableRow0, "/X<]w~Ck", "");
// Undeclared exception!
try {
checkbox0.big();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 304
/*Coverage entropy=1.3296613488547582
*/
@Test(timeout = 4000)
public void test304() throws Throwable {
XmlEntityRef xmlEntityRef0 = new XmlEntityRef("Q");
// Undeclared exception!
try {
xmlEntityRef0.message("D@<N");
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// No top level component found.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 305
/*Coverage entropy=2.203399008114057
*/
@Test(timeout = 4000)
public void test305() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.strike();
assertTrue(component0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 306
/*Coverage entropy=1.7917594692280554
*/
@Test(timeout = 4000)
public void test306() throws Throwable {
DateInput dateInput0 = new DateInput((Component) null, "h2", "keCz-bq^)", "keCz-bq^)");
Submit submit0 = new Submit(dateInput0, "8wUY", "org.mvel.conversion.BigIntegerCH$7");
// Undeclared exception!
try {
submit0.h1((Object) "keCz-bq^)");
fail("Expecting exception: ClassCastException");
} catch(ClassCastException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 307
/*Coverage entropy=1.7917594692280554
*/
@Test(timeout = 4000)
public void test307() throws Throwable {
Submit submit0 = new Submit((Component) null, "Could not parse '", "samp");
// Undeclared exception!
try {
submit0.noframes();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 308
/*Coverage entropy=1.7917594692280554
*/
@Test(timeout = 4000)
public void test308() throws Throwable {
TextInput textInput0 = new TextInput((Component) null, "keCz_tq^)", "Could not parse '");
Checkbox checkbox0 = new Checkbox(textInput0, "java.lang.String@0000000010", "Cannot add a form element. No surrounding form found.");
// Undeclared exception!
try {
checkbox0.i();
fail("Expecting exception: ClassCastException");
} catch(ClassCastException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 309
/*Coverage entropy=1.5498260458782016
*/
@Test(timeout = 4000)
public void test309() throws Throwable {
XmlEntityRef xmlEntityRef0 = new XmlEntityRef(".");
// Undeclared exception!
try {
xmlEntityRef0.dd((Object) xmlEntityRef0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 310
/*Coverage entropy=0.6365141682948128
*/
@Test(timeout = 4000)
public void test310() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
// Undeclared exception!
try {
errorPage0._applyFormat((Object) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.evosuite.runtime.System", e);
}
}
/**
//Test case number: 311
/*Coverage entropy=2.2343358078055116
*/
@Test(timeout = 4000)
public void test311() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
TextInput textInput0 = new TextInput(errorPage0, "Label_1", "n?^=5V");
// Undeclared exception!
try {
textInput0.tt();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 312
/*Coverage entropy=2.2581044308027467
*/
@Test(timeout = 4000)
public void test312() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", ":S");
// Undeclared exception!
try {
fileInput0.hr();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 313
/*Coverage entropy=1.9096604215404314
*/
@Test(timeout = 4000)
public void test313() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
TableBlock tableBlock0 = new TableBlock(errorPage0, "Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .");
// Undeclared exception!
try {
tableBlock0.hidden("@j^Dfy_T");
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Form elements can be created only by compoents that are attached to a form component.
//
verifyException("wheel.components.ComponentCreator", e);
}
}
/**
//Test case number: 314
/*Coverage entropy=1.5498260458782016
*/
@Test(timeout = 4000)
public void test314() throws Throwable {
Form form0 = new Form("e&t{oYM");
// Undeclared exception!
try {
form0.small((Object) "jVTIflc]D");
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 315
/*Coverage entropy=2.416289601776918
*/
@Test(timeout = 4000)
public void test315() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.map("xX?~5XT");
Component component1 = component0.h2();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(component1._isGeneratedId());
}
/**
//Test case number: 316
/*Coverage entropy=1.7917594692280554
*/
@Test(timeout = 4000)
public void test316() throws Throwable {
Hidden hidden0 = new Hidden((Component) null, "keCz_tq^)", "keCz_tq^)");
Checkbox checkbox0 = new Checkbox(hidden0, "?qeS?!&Wqia%/W%Os", "keCz_tq^)");
// Undeclared exception!
try {
checkbox0.sub((Object) hidden0);
fail("Expecting exception: ClassCastException");
} catch(ClassCastException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 317
/*Coverage entropy=2.2151922093961676
*/
@Test(timeout = 4000)
public void test317() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", ":S");
TableBlock tableBlock0 = new TableBlock(fileInput0);
Checkbox checkbox0 = new Checkbox(tableBlock0, ":S", "button");
Submit submit0 = new Submit(fileInput0, "a^", "a^");
Hidden hidden0 = new Hidden(checkbox0, "a^", "A1La2U.d`bKEsO5bI+");
// Undeclared exception!
try {
submit0.li((Object) hidden0);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 318
/*Coverage entropy=2.388234115937288
*/
@Test(timeout = 4000)
public void test318() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
String string0 = "RfN)Y/BL&miB\\uR";
Hidden hidden0 = new Hidden(errorPage0, string0, "_");
TableBlock tableBlock0 = new TableBlock(hidden0);
Label label0 = new Label(hidden0, tableBlock0);
Component component0 = label0.h5();
assertTrue(component0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 319
/*Coverage entropy=2.271284575774104
*/
@Test(timeout = 4000)
public void test319() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.bdo("small");
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(component0._isGeneratedId());
}
/**
//Test case number: 320
/*Coverage entropy=1.7917594692280554
*/
@Test(timeout = 4000)
public void test320() throws Throwable {
TextInput textInput0 = new TextInput((Component) null, "y7Iv_3", "y7Iv_3");
// Undeclared exception!
try {
textInput0.h3((Object) textInput0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 321
/*Coverage entropy=2.462042093641796
*/
@Test(timeout = 4000)
public void test321() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
TableBlock tableBlock0 = new TableBlock(errorPage0, "Unsuported type give for dateFormat. Supprted types are: Date, Calendar, Long/long .");
Checkbox checkbox0 = new Checkbox(errorPage0, "Unsuported type give for dateFormat. Supprted types are: Date, Calendar, Long/long .", "Unsuported type give for dateFormat. Supprted types are: Date, Calendar, Long/long .");
Component component0 = tableBlock0.code((Object) checkbox0);
assertTrue(component0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 322
/*Coverage entropy=2.2305112122117543
*/
@Test(timeout = 4000)
public void test322() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.dt();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertEquals("Block_1", component0.getComponentId());
}
/**
//Test case number: 323
/*Coverage entropy=1.5498260458782016
*/
@Test(timeout = 4000)
public void test323() throws Throwable {
XmlEntityRef xmlEntityRef0 = new XmlEntityRef("]U3+l*$r`rr<'");
// Undeclared exception!
try {
xmlEntityRef0.text("]U3+l*$r`rr<'");
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 324
/*Coverage entropy=1.7917594692280554
*/
@Test(timeout = 4000)
public void test324() throws Throwable {
Hidden hidden0 = new Hidden((Component) null, "keCz_tq^)", "keCz_tq^)");
Submit submit0 = new Submit((Component) null, "var", "hr");
// Undeclared exception!
try {
submit0.h4((Object) hidden0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 325
/*Coverage entropy=1.5498260458782016
*/
@Test(timeout = 4000)
public void test325() throws Throwable {
Form form0 = new Form("value");
// Undeclared exception!
try {
form0.abbr();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 326
/*Coverage entropy=1.7917594692280554
*/
@Test(timeout = 4000)
public void test326() throws Throwable {
TextInput textInput0 = new TextInput((Component) null, "keCz_tq^)", "Could not parse '");
// Undeclared exception!
try {
textInput0.h4();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 327
/*Coverage entropy=2.113539627290935
*/
@Test(timeout = 4000)
public void test327() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.span((Object) "org.mvel.ast.PropertyASTNode");
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(component0._isGeneratedId());
}
/**
//Test case number: 328
/*Coverage entropy=2.203399008114057
*/
@Test(timeout = 4000)
public void test328() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.b();
assertTrue(component0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 329
/*Coverage entropy=2.351828691524692
*/
@Test(timeout = 4000)
public void test329() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
TextInput textInput0 = new TextInput(errorPage0, "", "%.");
Submit submit0 = new Submit(textInput0, "=XO\"!:&5$G=uq", "");
Table table0 = new Table(submit0, "%.");
// Undeclared exception!
try {
submit0.b((Object) table0);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 330
/*Coverage entropy=1.4941751382893085
*/
@Test(timeout = 4000)
public void test330() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
// Undeclared exception!
try {
errorPage0.buttonInput("P#+4KeeP7rmf+CY");
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Form elements can be created only by compoents that are attached to a form component.
//
verifyException("wheel.components.ComponentCreator", e);
}
}
/**
//Test case number: 331
/*Coverage entropy=1.8261674308051876
*/
@Test(timeout = 4000)
public void test331() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
errorPage0.entity((String) null);
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 332
/*Coverage entropy=1.4941751382893083
*/
@Test(timeout = 4000)
public void test332() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
// Undeclared exception!
try {
errorPage0.passwordInput("write property cache: ");
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Form elements can be created only by compoents that are attached to a form component.
//
verifyException("wheel.components.ComponentCreator", e);
}
}
/**
//Test case number: 333
/*Coverage entropy=1.0397207708399179
*/
@Test(timeout = 4000)
public void test333() throws Throwable {
XmlEntityRef xmlEntityRef0 = new XmlEntityRef("Q");
// Undeclared exception!
try {
xmlEntityRef0.encode((String) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 334
/*Coverage entropy=2.203399008114057
*/
@Test(timeout = 4000)
public void test334() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
InitialFieldValue initialFieldValue0 = new InitialFieldValue(errorPage0, "K^Yl<[H?BPf-");
Component component0 = errorPage0.var((Object) initialFieldValue0);
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(component0._isGeneratedId());
}
/**
//Test case number: 335
/*Coverage entropy=2.203399008114057
*/
@Test(timeout = 4000)
public void test335() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.pre();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(component0._isGeneratedId());
}
/**
//Test case number: 336
/*Coverage entropy=2.388234115937288
*/
@Test(timeout = 4000)
public void test336() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", ":S");
TableBlock tableBlock0 = new TableBlock(fileInput0);
Component component0 = tableBlock0.ins();
assertTrue(component0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 337
/*Coverage entropy=2.203399008114057
*/
@Test(timeout = 4000)
public void test337() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.object();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(component0._isGeneratedId());
}
/**
//Test case number: 338
/*Coverage entropy=0.6931471805599453
*/
@Test(timeout = 4000)
public void test338() throws Throwable {
XmlEntityRef xmlEntityRef0 = new XmlEntityRef((String) null);
// Undeclared exception!
try {
xmlEntityRef0.colgroup();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Colgroup component can be added only to a Table.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 339
/*Coverage entropy=1.7917594692280554
*/
@Test(timeout = 4000)
public void test339() throws Throwable {
Submit submit0 = new Submit((Component) null, "Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .", "Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .");
// Undeclared exception!
try {
submit0.acronym();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 340
/*Coverage entropy=2.3686977464340297
*/
@Test(timeout = 4000)
public void test340() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
NumberInput numberInput0 = new NumberInput(errorPage0, ", right=", ", right=");
Component component0 = errorPage0.tt((Object) numberInput0);
assertTrue(component0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 341
/*Coverage entropy=1.4941751382893083
*/
@Test(timeout = 4000)
public void test341() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
// Undeclared exception!
try {
errorPage0.radio("java.lang.String@0000000015");
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Form elements can be created only by compoents that are attached to a form component.
//
verifyException("wheel.components.ComponentCreator", e);
}
}
/**
//Test case number: 342
/*Coverage entropy=2.108169769053504
*/
@Test(timeout = 4000)
public void test342() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
DateInput dateInput0 = new DateInput(errorPage0, "Could not parse '", "#/cL2f:%m-atVQv", "blockquote");
TextInput textInput0 = new TextInput(dateInput0, ",O1EBd[x5'", "3");
// Undeclared exception!
try {
textInput0.wrapSelf();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 343
/*Coverage entropy=1.559581156259877
*/
@Test(timeout = 4000)
public void test343() throws Throwable {
Form form0 = new Form("blockquote");
// Undeclared exception!
try {
form0.ul();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 344
/*Coverage entropy=1.933809998920632
*/
@Test(timeout = 4000)
public void test344() throws Throwable {
Form form0 = new Form("Q>,#~H//-,C_");
Checkbox checkbox0 = new Checkbox(form0, "Q>,#~H//-,C_", "java.lang.String@0000000021");
TextInput textInput0 = new TextInput(checkbox0, "java.lang.String@0000000021", "java.lang.String@0000000021");
// Undeclared exception!
try {
textInput0.abbr((Object) "Q>,#~H//-,C_");
fail("Expecting exception: ClassCastException");
} catch(ClassCastException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 345
/*Coverage entropy=2.0303263285883424
*/
@Test(timeout = 4000)
public void test345() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.div();
assertEquals("Block_1", component0.getComponentId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 346
/*Coverage entropy=2.511781041982193
*/
@Test(timeout = 4000)
public void test346() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Table table0 = new Table(errorPage0, "Uv8D");
TableBlock tableBlock0 = table0.thead();
Any any0 = tableBlock0.col();
// Undeclared exception!
try {
any0.col();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Col component can be added only to a TableBlock.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 347
/*Coverage entropy=1.4270610433807247
*/
@Test(timeout = 4000)
public void test347() throws Throwable {
DateInput dateInput0 = new DateInput((Component) null, "h2", "keCz_tq^)", "keCz_tq^)");
// Undeclared exception!
try {
dateInput0.dateFormat("hr", "hr");
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Failed to initialize SimpleDateFormat with pattern 'hr'.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 348
/*Coverage entropy=2.2296020537651637
*/
@Test(timeout = 4000)
public void test348() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
TableRow tableRow0 = new TableRow(errorPage0);
Component component0 = tableRow0.em();
assertTrue(component0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 349
/*Coverage entropy=1.6052071074554588
*/
@Test(timeout = 4000)
public void test349() throws Throwable {
ElExpression elExpression0 = new ElExpression(":S");
CheckboxGroup checkboxGroup0 = new CheckboxGroup((Component) null, ":S", ":S", (ISelectModel) null, elExpression0);
// Undeclared exception!
try {
checkboxGroup0.nbsp();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 350
/*Coverage entropy=1.7328679513998633
*/
@Test(timeout = 4000)
public void test350() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
TableRow tableRow0 = new TableRow(errorPage0);
String string0 = tableRow0.getComponentName();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(tableRow0._isGeneratedId());
assertEquals("TableRow", string0);
}
/**
//Test case number: 351
/*Coverage entropy=2.3184466278844393
*/
@Test(timeout = 4000)
public void test351() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
TableRow tableRow0 = new TableRow(errorPage0);
Component component0 = tableRow0.fieldset();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertEquals("Block_1", component0.getComponentId());
}
/**
//Test case number: 352
/*Coverage entropy=2.2965230151537037
*/
@Test(timeout = 4000)
public void test352() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.base("l");
assertEquals("Any_1", component0.getComponentId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 353
/*Coverage entropy=1.7917594692280554
*/
@Test(timeout = 4000)
public void test353() throws Throwable {
TextInput textInput0 = new TextInput((Component) null, "keCz-bq^)", "Could not parse '");
// Undeclared exception!
try {
textInput0.strike((Object) "h2");
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 354
/*Coverage entropy=2.5683003780144253
*/
@Test(timeout = 4000)
public void test354() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Table table0 = new Table(errorPage0, ":S");
TableBlock tableBlock0 = table0.thead();
Component component0 = tableBlock0.q((Object) errorPage0);
// Undeclared exception!
try {
component0.numberInput("e8skkSdVksbgqK", (CharSequence) ":S");
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Form elements can be created only by compoents that are attached to a form component.
//
verifyException("wheel.components.ComponentCreator", e);
}
}
/**
//Test case number: 355
/*Coverage entropy=1.9974465815025308
*/
@Test(timeout = 4000)
public void test355() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.a();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(component0._isGeneratedId());
}
/**
//Test case number: 356
/*Coverage entropy=2.203399008114057
*/
@Test(timeout = 4000)
public void test356() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.del();
assertTrue(component0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 357
/*Coverage entropy=2.3184466278844393
*/
@Test(timeout = 4000)
public void test357() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
TableRow tableRow0 = new TableRow(errorPage0);
Component component0 = tableRow0.li();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertEquals("Block_1", component0.getComponentId());
}
/**
//Test case number: 358
/*Coverage entropy=2.3961363967184695
*/
@Test(timeout = 4000)
public void test358() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Submit submit0 = new Submit(errorPage0, "", "");
Label label0 = new Label(submit0, (Object) null);
CharBuffer charBuffer0 = CharBuffer.wrap((CharSequence) "7lockquote");
label0.s((Object) charBuffer0);
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(submit0._isGeneratedId());
}
/**
//Test case number: 359
/*Coverage entropy=2.2343358078055116
*/
@Test(timeout = 4000)
public void test359() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", ":S");
// Undeclared exception!
try {
fileInput0.address();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 360
/*Coverage entropy=2.5872853461822345
*/
@Test(timeout = 4000)
public void test360() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Table table0 = new Table(errorPage0, "Uv8D");
TableBlock tableBlock0 = table0.thead();
Any any0 = tableBlock0.col();
// Undeclared exception!
try {
any0.imageSubmit("Uv8D", "C({{[bxU|1mcw_J2#");
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Form elements can be created only by compoents that are attached to a form component.
//
verifyException("wheel.components.ComponentCreator", e);
}
}
/**
//Test case number: 361
/*Coverage entropy=0.6365141682948128
*/
@Test(timeout = 4000)
public void test361() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
// Undeclared exception!
try {
errorPage0.tr();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Tr component can be added only to a TableBlock.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 362
/*Coverage entropy=1.9408430327407737
*/
@Test(timeout = 4000)
public void test362() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Submit submit0 = new Submit(errorPage0, "6]yXT0;Zr", "s");
// Undeclared exception!
try {
submit0.form("");
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// A Form must always have a given componentId.
//
verifyException("wheel.components.Form", e);
}
}
/**
//Test case number: 363
/*Coverage entropy=1.791759469228055
*/
@Test(timeout = 4000)
public void test363() throws Throwable {
Submit submit0 = new Submit((Component) null, "jeywYUUI/xm~s[8", "=N-OTBnq");
// Undeclared exception!
try {
submit0.legend((Object) "=N-OTBnq");
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 364
/*Coverage entropy=1.5832584594204766
*/
@Test(timeout = 4000)
public void test364() throws Throwable {
Hidden hidden0 = new Hidden((Component) null, "keCz_tq^)", "keCz_tq^)");
Checkbox checkbox0 = new Checkbox(hidden0, "?qeS?!&Wqia%/W%Os", "keCz_tq^)");
// Undeclared exception!
try {
checkbox0.dl();
fail("Expecting exception: ClassCastException");
} catch(ClassCastException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 365
/*Coverage entropy=2.388234115937288
*/
@Test(timeout = 4000)
public void test365() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
FileInput fileInput0 = new FileInput(errorPage0, "a^", ":S");
TableBlock tableBlock0 = new TableBlock(fileInput0);
Checkbox checkbox0 = new Checkbox(tableBlock0, ":S", "button");
Submit submit0 = new Submit(fileInput0, "a^", "a^");
Label label0 = new Label(checkbox0, checkbox0);
Component component0 = label0.samp((Object) submit0);
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(component0._isGeneratedId());
}
/**
//Test case number: 366
/*Coverage entropy=2.2459008634989464
*/
@Test(timeout = 4000)
public void test366() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Select select0 = new Select(errorPage0, "\\", "2So+X{eNd_!S^O)", "l", (ISelectModel) null, false);
Component component0 = select0.img("l", "l");
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(component0._isGeneratedId());
}
/**
//Test case number: 367
/*Coverage entropy=1.8705688894156371
*/
@Test(timeout = 4000)
public void test367() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Submit submit0 = new Submit(errorPage0, "", "l");
// Undeclared exception!
try {
submit0.numberInput("l");
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Form elements can be created only by compoents that are attached to a form component.
//
verifyException("wheel.components.ComponentCreator", e);
}
}
/**
//Test case number: 368
/*Coverage entropy=1.7782333057997075
*/
@Test(timeout = 4000)
public void test368() throws Throwable {
TextInput textInput0 = new TextInput((Component) null, "Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .", "Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .");
DynamicSelectModel dynamicSelectModel0 = new DynamicSelectModel();
// Undeclared exception!
try {
textInput0.checkboxGroup("NeT%'nf0^", dynamicSelectModel0, (ElExpression) null);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Form elements can be created only by compoents that are attached to a form component.
//
verifyException("wheel.components.ComponentCreator", e);
}
}
/**
//Test case number: 369
/*Coverage entropy=2.5875893787414466
*/
@Test(timeout = 4000)
public void test369() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Table table0 = new Table(errorPage0, "org.mvel.util.ThisLiteral");
TableBlock tableBlock0 = table0.tbody();
TextInput textInput0 = new TextInput(tableBlock0, "org.mvel.util.ThisLiteral", "Unsupported type given for dateFormat. Yupported types are: Date, nalendar, Long/lrng.");
ElExpression elExpression0 = new ElExpression("wheelSubmitId");
// Undeclared exception!
try {
textInput0.fileInput("org.mvel.util.ThisLiteral", elExpression0);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Form elements can be created only by compoents that are attached to a form component.
//
verifyException("wheel.components.ComponentCreator", e);
}
}
/**
//Test case number: 370
/*Coverage entropy=2.203399008114057
*/
@Test(timeout = 4000)
public void test370() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.i((Object) "k$GT$v)[Zyiy");
assertTrue(component0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 371
/*Coverage entropy=1.5691529462031188
*/
@Test(timeout = 4000)
public void test371() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
TextArea textArea0 = new TextArea(errorPage0, "L~s\"jkk", "Attributes must be given in name, value pairs.");
// Undeclared exception!
try {
textArea0.fileInput((String) null);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Form elements can be created only by compoents that are attached to a form component.
//
verifyException("wheel.components.ComponentCreator", e);
}
}
/**
//Test case number: 372
/*Coverage entropy=2.648278898848265
*/
@Test(timeout = 4000)
public void test372() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Hidden hidden0 = new Hidden(errorPage0, "*z6)_^\"kC,$/", "Th wildcard list must not be null");
Checkbox checkbox0 = new Checkbox(hidden0, "parametr classNames to newInstance() thatDcontained '", "?!eS?&Wqa%/W%Os");
// Undeclared exception!
try {
checkbox0.title("7ou");
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("wheel.components.StandaloneComponent", e);
}
}
/**
//Test case number: 373
/*Coverage entropy=2.203399008114057
*/
@Test(timeout = 4000)
public void test373() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.button();
assertTrue(component0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 374
/*Coverage entropy=1.8705688894156371
*/
@Test(timeout = 4000)
public void test374() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Hidden hidden0 = new Hidden(errorPage0, "*z6)_^\"kC,$/", "Th wildcard list must not be null");
Checkbox checkbox0 = new Checkbox(hidden0, "parametr classNames to newInstance() thatDcontained '", "?!eS?&Wqa%/W%Os");
// Undeclared exception!
try {
checkbox0.checkbox("uxvT2HK,1KyF2>7$");
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Form elements can be created only by compoents that are attached to a form component.
//
verifyException("wheel.components.ComponentCreator", e);
}
}
/**
//Test case number: 375
/*Coverage entropy=0.6365141682948128
*/
@Test(timeout = 4000)
public void test375() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
// Undeclared exception!
try {
errorPage0.tbody();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Tbody component can be added only to a Table.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 376
/*Coverage entropy=1.791759469228055
*/
@Test(timeout = 4000)
public void test376() throws Throwable {
Hidden hidden0 = new Hidden((Component) null, "tb-`eOl0", "tb-`eOl0");
// Undeclared exception!
try {
hidden0.blockquote();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 377
/*Coverage entropy=2.234335807805511
*/
@Test(timeout = 4000)
public void test377() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Checkbox checkbox0 = new Checkbox(errorPage0, "java.lang.String@0000000010", "java.lang.String@0000000010");
// Undeclared exception!
try {
checkbox0.strong();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 378
/*Coverage entropy=1.5498260458782016
*/
@Test(timeout = 4000)
public void test378() throws Throwable {
Form form0 = new Form("_");
// Undeclared exception!
try {
form0.ins((Object) "_");
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 379
/*Coverage entropy=2.042815830813734
*/
@Test(timeout = 4000)
public void test379() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Block block0 = errorPage0.placeholder("");
assertEquals("Block_1", block0.getComponentId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 380
/*Coverage entropy=1.2130075659799042
*/
@Test(timeout = 4000)
public void test380() throws Throwable {
TextInput textInput0 = new TextInput((Component) null, "Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .", "Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .");
ElExpression elExpression0 = textInput0.el("1RVo");
assertEquals("1RVo", elExpression0.getExpression());
}
/**
//Test case number: 381
/*Coverage entropy=1.559581156259877
*/
@Test(timeout = 4000)
public void test381() throws Throwable {
Form form0 = new Form("blockquote");
// Undeclared exception!
try {
form0.p();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 382
/*Coverage entropy=1.5498260458782016
*/
@Test(timeout = 4000)
public void test382() throws Throwable {
Form form0 = new Form("_");
// Undeclared exception!
try {
form0.acronym((Object) "_");
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 383
/*Coverage entropy=2.2935933761881686
*/
@Test(timeout = 4000)
public void test383() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.h3();
Text text0 = new Text(component0, (Object) null);
text0.getAttributes();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(text0._isGeneratedId());
}
/**
//Test case number: 384
/*Coverage entropy=1.5498260458782016
*/
@Test(timeout = 4000)
public void test384() throws Throwable {
Form form0 = new Form("blockquote");
// Undeclared exception!
try {
form0.h6();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 385
/*Coverage entropy=1.791759469228055
*/
@Test(timeout = 4000)
public void test385() throws Throwable {
Hidden hidden0 = new Hidden((Component) null, ".", ".");
// Undeclared exception!
try {
hidden0.s();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 386
/*Coverage entropy=2.0467385326945515
*/
@Test(timeout = 4000)
public void test386() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Submit submit0 = new Submit(errorPage0, "", "");
Component component0 = submit0.requestFocus();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(component0._isGeneratedId());
}
/**
//Test case number: 387
/*Coverage entropy=1.8820393286253112
*/
@Test(timeout = 4000)
public void test387() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Select select0 = new Select(errorPage0, "java.lang.String@0000000007", "java.lang.String@0000000010", (ISelectModel) null, "java.lang.String@0000000010");
Table table0 = new Table(select0, "java.lang.String@0000000010");
// Undeclared exception!
try {
table0.dateInput("-|?7?Jk", "}zi$~");
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Form elements can be created only by compoents that are attached to a form component.
//
verifyException("wheel.components.ComponentCreator", e);
}
}
/**
//Test case number: 388
/*Coverage entropy=1.5498260458782016
*/
@Test(timeout = 4000)
public void test388() throws Throwable {
Form form0 = new Form("K63oa");
// Undeclared exception!
try {
form0.var();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 389
/*Coverage entropy=2.2343358078055116
*/
@Test(timeout = 4000)
public void test389() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Submit submit0 = new Submit(errorPage0, "write property cache: ", "Finder expression didn't evaluate to a boolean value.");
Short short0 = new Short((short)2035);
// Undeclared exception!
try {
submit0.sup((Object) short0);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 390
/*Coverage entropy=1.7917594692280554
*/
@Test(timeout = 4000)
public void test390() throws Throwable {
Submit submit0 = new Submit((Component) null, "Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .", "Unsupported type given for dateFormat. Supported types are: Date, Calendar, Long/long .");
// Undeclared exception!
try {
submit0.small();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 391
/*Coverage entropy=2.4272127915556716
*/
@Test(timeout = 4000)
public void test391() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
CharBuffer charBuffer0 = CharBuffer.allocate(1019);
// Undeclared exception!
try {
errorPage0.frame(charBuffer0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("wheel.components.StandaloneComponent", e);
}
}
/**
//Test case number: 392
/*Coverage entropy=1.5498260458782016
*/
@Test(timeout = 4000)
public void test392() throws Throwable {
XmlEntityRef xmlEntityRef0 = new XmlEntityRef("java.lang.String@0000000010");
Byte byte0 = new Byte((byte)1);
// Undeclared exception!
try {
xmlEntityRef0.kbd((Object) byte0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 393
/*Coverage entropy=2.203399008114057
*/
@Test(timeout = 4000)
public void test393() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.samp();
assertTrue(component0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 394
/*Coverage entropy=2.3938716562661844
*/
@Test(timeout = 4000)
public void test394() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Table table0 = new Table(errorPage0, "E^");
Submit submit0 = new Submit(table0, "e8skkSdVksbgqK", "e8skkSdVksbgqK");
// Undeclared exception!
try {
submit0.label();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 395
/*Coverage entropy=1.5832584594204766
*/
@Test(timeout = 4000)
public void test395() throws Throwable {
Hidden hidden0 = new Hidden((Component) null, "keCz_tq^)", "keCz_tq^)");
// Undeclared exception!
try {
hidden0.map((String) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 396
/*Coverage entropy=2.203399008114057
*/
@Test(timeout = 4000)
public void test396() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.dfn((Object) "button");
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertTrue(component0._isGeneratedId());
}
/**
//Test case number: 397
/*Coverage entropy=1.3208883431493221
*/
@Test(timeout = 4000)
public void test397() throws Throwable {
Form form0 = new Form("blockquote");
Component component0 = form0.actionBinding("wheelSubmitId");
assertEquals("blockquote", component0.getComponentId());
}
/**
//Test case number: 398
/*Coverage entropy=0.6365141682948128
*/
@Test(timeout = 4000)
public void test398() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
// Undeclared exception!
try {
errorPage0.tfoot();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Tfoot component can be added only to a Table.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 399
/*Coverage entropy=1.6417347121875212
*/
@Test(timeout = 4000)
public void test399() throws Throwable {
XmlEntityRef xmlEntityRef0 = new XmlEntityRef("TN~kA9UjsY>4g%M");
TextArea textArea0 = new TextArea(xmlEntityRef0, "Label_1", "Ws\"jHk");
// Undeclared exception!
try {
textArea0.h6((Object) "Label_1");
fail("Expecting exception: ClassCastException");
} catch(ClassCastException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 400
/*Coverage entropy=1.791759469228055
*/
@Test(timeout = 4000)
public void test400() throws Throwable {
Hidden hidden0 = new Hidden((Component) null, "keCz_tq^)", "keCz_tq^)");
ActionExpression actionExpression0 = new ActionExpression("keCz_tq^)");
// Undeclared exception!
try {
hidden0.h2((Object) actionExpression0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 401
/*Coverage entropy=2.1378615259530647
*/
@Test(timeout = 4000)
public void test401() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
TextInput textInput0 = new TextInput(errorPage0, "", "%.");
Submit submit0 = new Submit(textInput0, "=XO\"!:&5$G=uq", "");
Table table0 = new Table(submit0, "%.");
table0.clasS("");
Table table1 = table0.renderHint("");
assertTrue(submit0._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
assertEquals("%.", table1.getComponentId());
}
/**
//Test case number: 402
/*Coverage entropy=2.5437079022278075
*/
@Test(timeout = 4000)
public void test402() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Table table0 = new Table(errorPage0, "E^");
TableBlock tableBlock0 = table0.thead();
StringSelectModel stringSelectModel0 = new StringSelectModel();
// Undeclared exception!
try {
tableBlock0.multiSelect("L\"ql;", stringSelectModel0, "@");
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Form elements can be created only by compoents that are attached to a form component.
//
verifyException("wheel.components.ComponentCreator", e);
}
}
/**
//Test case number: 403
/*Coverage entropy=2.2655196455710818
*/
@Test(timeout = 4000)
public void test403() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Component component0 = errorPage0.legend();
Component component1 = component0.script();
assertTrue(component1._isGeneratedId());
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 404
/*Coverage entropy=2.2343358078055116
*/
@Test(timeout = 4000)
public void test404() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
Submit submit0 = new Submit(errorPage0, "NEW java/lang/Long", "NEW java/lang/Long");
// Undeclared exception!
try {
submit0.kbd();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Can't add components to a component that is not an instance of IContainer.
//
verifyException("wheel.components.Component", e);
}
}
/**
//Test case number: 405
/*Coverage entropy=0.6365141682948128
*/
@Test(timeout = 4000)
public void test405() throws Throwable {
ErrorPage errorPage0 = new ErrorPage();
errorPage0._getXhtmlAttributes();
assertEquals("wheel_ErrorPage", errorPage0.getComponentId());
}
/**
//Test case number: 406
/*Coverage entropy=1.791759469228055
*/
@Test(timeout = 4000)
public void test406() throws Throwable {
Hidden hidden0 = new Hidden((Component) null, "tb-`eOl0", "tb-`eOl0");
// Undeclared exception!
try {
hidden0.dt((Object) "tb-`eOl0");
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
/**
//Test case number: 407
/*Coverage entropy=1.5832584594204766
*/
@Test(timeout = 4000)
public void test407() throws Throwable {
Hidden hidden0 = new Hidden((Component) null, "tb-`eOl0", "tb-`eOl0");
// Undeclared exception!
try {
hidden0.dd();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
}
|
3e0291f9627d0343dd9972f24309bef39a918dcf | 1,700 | java | Java | service.api/src/main/java/com/hack23/cia/service/api/action/application/RegisterUserResponse.java | TrisA/cia | c67d638ec50b47afb9a033eae6e350fa514a0469 | [
"Apache-2.0"
]
| 75 | 2015-08-01T15:31:54.000Z | 2022-03-19T12:07:06.000Z | service.api/src/main/java/com/hack23/cia/service/api/action/application/RegisterUserResponse.java | TrisA/cia | c67d638ec50b47afb9a033eae6e350fa514a0469 | [
"Apache-2.0"
]
| 2,662 | 2016-12-16T17:27:08.000Z | 2022-03-28T09:32:36.000Z | service.api/src/main/java/com/hack23/cia/service/api/action/application/RegisterUserResponse.java | TrisA/cia | c67d638ec50b47afb9a033eae6e350fa514a0469 | [
"Apache-2.0"
]
| 38 | 2017-03-03T23:15:18.000Z | 2021-12-31T19:07:13.000Z | 23.611111 | 75 | 0.711765 | 1,056 | /*
* Copyright 2010-2021 James Pether Sörling
*
* 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.
*
* $Id$
* $HeadURL$
*/
package com.hack23.cia.service.api.action.application;
import com.hack23.cia.model.internal.application.user.impl.UserAccount;
import com.hack23.cia.service.api.action.common.AbstractResponse;
/**
* The Class RegisterUserResponse.
*/
public final class RegisterUserResponse extends AbstractResponse {
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 1L;
/** The user account. */
private UserAccount userAccount;
/**
* The Enum ErrorMessage.
*/
public enum ErrorMessage {
USER_ALREADY_EXIST;
}
/**
* Instantiates a new register user response.
*
* @param result
* the result
*/
public RegisterUserResponse(final ServiceResult result) {
super(result);
}
/**
* Gets the user account.
*
* @return the user account
*/
public UserAccount getUserAccount() {
return userAccount;
}
/**
* Sets the user account.
*
* @param userAccount
* the new user account
*/
public void setUserAccount(final UserAccount userAccount) {
this.userAccount = userAccount;
}
}
|
3e0292cd1defabbb19b3c21794333f7bb8c7998f | 694 | java | Java | src/test/java/se/sunet/eduid/TC_17.java | SUNET/eduid-automated-tests | 4accf67635179a59eae83c68ca60855604c2f02c | [
"BSD-2-Clause"
]
| null | null | null | src/test/java/se/sunet/eduid/TC_17.java | SUNET/eduid-automated-tests | 4accf67635179a59eae83c68ca60855604c2f02c | [
"BSD-2-Clause"
]
| 3 | 2021-03-18T07:58:23.000Z | 2022-01-04T16:41:28.000Z | src/test/java/se/sunet/eduid/TC_17.java | SUNET/eduid-automated-tests | 4accf67635179a59eae83c68ca60855604c2f02c | [
"BSD-2-Clause"
]
| null | null | null | 21.030303 | 48 | 0.622478 | 1,057 | package se.sunet.eduid;
import org.testng.annotations.Test;
import se.sunet.eduid.utils.BeforeAndAfter;
public class TC_17 extends BeforeAndAfter {
@Test
void startPage(){
startPage.runStartPage();
}
@Test( dependsOnMethods = {"startPage"} )
void login(){
login.runLogin();
}
@Test( dependsOnMethods = {"login"} )
void dashboard() {
dashBoard.runDashBoard();
}
@Test( dependsOnMethods = {"dashboard"} )
void initPwChange() {
testData.setButtonValuePopup(false);
initPwChange.runInitPwChange();
}
@Test( dependsOnMethods = {"initPwChange"} )
void logout() {
logout.runLogout();
}
}
|
3e02935fc3e96075b873b55f21e5e35f0be18c51 | 1,097 | java | Java | src/main/java/com/hujiang/project/zhgd/hjAttendanceDevice/api/AttendanceDeviceApi.java | ffyy-cc/zhgd-gateway | 006e4d245fec374dcb37cc2043041783185dbc51 | [
"MIT"
]
| null | null | null | src/main/java/com/hujiang/project/zhgd/hjAttendanceDevice/api/AttendanceDeviceApi.java | ffyy-cc/zhgd-gateway | 006e4d245fec374dcb37cc2043041783185dbc51 | [
"MIT"
]
| null | null | null | src/main/java/com/hujiang/project/zhgd/hjAttendanceDevice/api/AttendanceDeviceApi.java | ffyy-cc/zhgd-gateway | 006e4d245fec374dcb37cc2043041783185dbc51 | [
"MIT"
]
| 1 | 2021-12-06T09:51:49.000Z | 2021-12-06T09:51:49.000Z | 37.827586 | 86 | 0.793984 | 1,058 | package com.hujiang.project.zhgd.hjAttendanceDevice.api;
import com.hujiang.framework.web.domain.AjaxResult;
import com.hujiang.project.zhgd.client.SystemClient;
import com.hujiang.project.zhgd.hjAttendanceDevice.domain.HjAttendanceDevice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping(value = "/api/attendanceDeviceApi")
public class AttendanceDeviceApi {
@Autowired
private SystemClient client;
@PostMapping(value = "/insertAttendanceDevice")
public AjaxResult insertAttendanceDevice( HjAttendanceDevice hjAttendanceDevice){
return client.insertAttendanceDevice(hjAttendanceDevice);
}
@PostMapping(value = "/updateAttendanceDevice")
public AjaxResult updateAttendanceDevice( HjAttendanceDevice hjAttendanceDevice){
return client.updateAttendanceDevice(hjAttendanceDevice);
}
}
|
3e0293ba0b9993cd05379df6de583005ccce074b | 953 | java | Java | app/src/main/java/android/marshon/likequanmintv/di/scope/PerApp.java | jjzhang166/likequanmintv | ba146ad330c2c1548e37e025465100ea00d26448 | [
"Apache-2.0"
]
| 1,207 | 2016-12-01T02:10:35.000Z | 2019-08-31T15:36:31.000Z | app/src/main/java/android/marshon/likequanmintv/di/scope/PerApp.java | jjzhang166/likequanmintv | ba146ad330c2c1548e37e025465100ea00d26448 | [
"Apache-2.0"
]
| 19 | 2016-12-02T01:37:58.000Z | 2018-03-28T07:22:33.000Z | app/src/main/java/android/marshon/likequanmintv/di/scope/PerApp.java | jjzhang166/likequanmintv | ba146ad330c2c1548e37e025465100ea00d26448 | [
"Apache-2.0"
]
| 426 | 2016-11-23T13:34:22.000Z | 2019-09-16T03:35:04.000Z | 28.818182 | 75 | 0.748686 | 1,059 | /*
* Copyright (c) 2016 咖枯 <[email protected] | [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 android.marshon.likequanmintv.di.scope;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import javax.inject.Scope;
/**
* @version 1.0 2016/6/23
*/
@Scope
@Documented
@Retention(RetentionPolicy.RUNTIME)
public @interface PerApp {
}
|
3e0294849f39058011e43b56ed59fb7fc043a797 | 398 | java | Java | mdms/mdms-cli/src/main/java/de/hpi/isg/mdms/cli/reader/LinewiseReader.java | Bensk1/metadata-ms | d994c98c611248c02ef77f0dad23c15d4940f53d | [
"Apache-2.0"
]
| 21 | 2016-01-24T16:00:46.000Z | 2021-11-02T09:21:21.000Z | mdms/mdms-cli/src/main/java/de/hpi/isg/mdms/cli/reader/LinewiseReader.java | Bensk1/metadata-ms | d994c98c611248c02ef77f0dad23c15d4940f53d | [
"Apache-2.0"
]
| 35 | 2016-02-22T17:50:46.000Z | 2018-08-07T15:08:54.000Z | mdms/mdms-cli/src/main/java/de/hpi/isg/mdms/cli/reader/LinewiseReader.java | Bensk1/metadata-ms | d994c98c611248c02ef77f0dad23c15d4940f53d | [
"Apache-2.0"
]
| 13 | 2015-06-25T20:19:37.000Z | 2021-11-02T09:21:22.000Z | 17.304348 | 63 | 0.61809 | 1,060 | package de.hpi.isg.mdms.cli.reader;
/**
* A supplier of lines.
*/
public interface LinewiseReader {
class ReadException extends Exception {
public ReadException(String message, Throwable cause) {
super(message, cause);
}
public ReadException(Throwable cause) {
super(cause);
}
}
String readLine() throws ReadException;
}
|
3e029529a4c3d3815d3fa5687116e816a855947b | 5,478 | java | Java | src/test/gov/nasa/pds/tools/dict/type/DoubleCheckerTest.java | NASA-PDS-Incubator/pds3-product-tools | a7deb96494210d7e356a2260714ee358bca13621 | [
"Apache-2.0"
]
| null | null | null | src/test/gov/nasa/pds/tools/dict/type/DoubleCheckerTest.java | NASA-PDS-Incubator/pds3-product-tools | a7deb96494210d7e356a2260714ee358bca13621 | [
"Apache-2.0"
]
| 6 | 2019-06-24T22:23:00.000Z | 2019-12-13T00:30:18.000Z | src/test/gov/nasa/pds/tools/dict/type/DoubleCheckerTest.java | NASA-PDS-Incubator/pds3-product-tools | a7deb96494210d7e356a2260714ee358bca13621 | [
"Apache-2.0"
]
| null | null | null | 40.880597 | 80 | 0.678897 | 1,061 | // Copyright 2019, California Institute of Technology ("Caltech").
// U.S. Government sponsorship acknowledged.
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions must reproduce the above copyright notice, this list of
// conditions and the following disclaimer in the documentation and/or other
// materials provided with the distribution.
// * Neither the name of Caltech nor its operating division, the Jet Propulsion
// Laboratory, nor the names of its contributors may be used to endorse or
// promote products derived from this software without specific prior written
// permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
package gov.nasa.pds.tools.dict.type;
import gov.nasa.pds.tools.BaseTestCase;
import gov.nasa.pds.tools.LabelParserException;
import gov.nasa.pds.tools.constants.Constants.ProblemType;
import gov.nasa.pds.tools.label.Label;
import java.io.File;
import java.io.IOException;
/**
* @author pramirez
* @author jagander
* @version $Revision$
*
*/
@SuppressWarnings("nls")
public class DoubleCheckerTest extends BaseTestCase {
public void testTypeMismatch() throws LabelParserException, IOException {
final File testFile = new File(LABEL_DIR, "double.lbl");
final Label label = PARSER.parseLabel(testFile);
validate(label);
LabelParserException lpe = assertHasProblem(label,
ProblemType.TYPE_MISMATCH);
assertProblemEquals(lpe, 3, null, "parser.error.typeMismatch",
ProblemType.TYPE_MISMATCH, "DUB", "DOUBLE", "TextString",
"should be double");
}
public void testShort() throws LabelParserException, IOException {
final File testFile = new File(LABEL_DIR, "double.lbl");
final Label label = PARSER.parseLabel(testFile);
validate(label);
LabelParserException lpe = assertHasProblem(label,
ProblemType.SHORT_VALUE);
assertProblemEquals(lpe, 4, null, "parser.error.tooShort",
ProblemType.SHORT_VALUE, "5", "1", "2", "DUB", "DOUBLE");
}
public void testLong() throws LabelParserException, IOException {
final File testFile = new File(LABEL_DIR, "double.lbl");
final Label label = PARSER.parseLabel(testFile);
validate(label);
LabelParserException lpe = assertHasProblem(label,
ProblemType.EXCESSIVE_VALUE_LENGTH);
assertProblemEquals(lpe, 5, null, "parser.error.tooLong",
ProblemType.EXCESSIVE_VALUE_LENGTH, "5.000000009", "11", "9",
"DUB", "DOUBLE");
}
public void testLessThanMin() throws LabelParserException, IOException {
final File testFile = new File(LABEL_DIR, "double.lbl");
final Label label = PARSER.parseLabel(testFile);
validate(label);
LabelParserException lpe = label.getProblems().get(3);
assertProblemEquals(lpe, 6, null, "parser.error.lessThanMin",
ProblemType.OOR, "0.01", "5.0", "DUB", "DOUBLE");
}
public void testExceedsMax() throws LabelParserException, IOException {
final File testFile = new File(LABEL_DIR, "double.lbl");
final Label label = PARSER.parseLabel(testFile);
validate(label);
LabelParserException lpe = label.getProblems().get(4);
assertProblemEquals(lpe, 7, null, "parser.error.exceedsMax",
ProblemType.OOR, "100.1", "100.0", "DUB", "DOUBLE");
}
public void testInvalidValue() throws LabelParserException, IOException {
final File testFile = new File(LABEL_DIR, "double.lbl");
final Label label = PARSER.parseLabel(testFile);
validate(label);
LabelParserException lpe = assertHasProblem(label,
ProblemType.INVALID_TYPE);
assertProblemEquals(lpe, 8, null, "parser.error.badReal",
ProblemType.INVALID_TYPE, "2#10001#");
}
// For convenience, all test parts in one file but tested in different
// methods. This test just confirms we covered all tests
public void testNumErrors() throws LabelParserException, IOException {
final File testFile = new File(LABEL_DIR, "double.lbl");
final Label label = PARSER.parseLabel(testFile);
validate(label);
assertEquals(6, label.getProblems().size());
}
}
|
3e02955bcc7faf02d4b87737490c1ba5a89d0176 | 277 | java | Java | src/main/java/com/black/fixedlength/format/DefaultZeroPaddingFormatter.java | brackk/black-fixedlenfth | 57fce60cfc4ea8d4a454ff692b2e3de2a7efd41c | [
"Apache-2.0"
]
| 2 | 2021-03-27T07:56:41.000Z | 2021-05-02T11:20:00.000Z | src/main/java/com/black/fixedlength/format/DefaultZeroPaddingFormatter.java | brackk/black-fixedlength | 57fce60cfc4ea8d4a454ff692b2e3de2a7efd41c | [
"Apache-2.0"
]
| null | null | null | src/main/java/com/black/fixedlength/format/DefaultZeroPaddingFormatter.java | brackk/black-fixedlength | 57fce60cfc4ea8d4a454ff692b2e3de2a7efd41c | [
"Apache-2.0"
]
| null | null | null | 25.181818 | 91 | 0.685921 | 1,062 | package com.black.fixedlength.format;
public class DefaultZeroPaddingFormatter implements PaddingFormat {
@Override
public String padding(String param, int length) {
return length == 0 ? param : String.format("%" + length + "s", param).replace(" ", "0");
}
}
|
3e0296b13f37e4828f96cb0170898defe79a3b2b | 908 | java | Java | hackerrank/algorithms/warmup/plus-minus.java | pasangsherpa/playground | 066e1b038fc8edb8d5c201bf0f07a41cc39085c5 | [
"MIT"
]
| 1 | 2016-05-25T18:35:07.000Z | 2016-05-25T18:35:07.000Z | hackerrank/algorithms/warmup/plus-minus.java | pasangsherpa/playground | 066e1b038fc8edb8d5c201bf0f07a41cc39085c5 | [
"MIT"
]
| null | null | null | hackerrank/algorithms/warmup/plus-minus.java | pasangsherpa/playground | 066e1b038fc8edb8d5c201bf0f07a41cc39085c5 | [
"MIT"
]
| null | null | null | 26.705882 | 82 | 0.625551 | 1,063 | // https://www.hackerrank.com/challenges/plus-minus
import java.util.*;
public class Solution {
private static void fractionCount(int[] nums) {
int totalCount = nums.length;
int positiveCount, negativeCount, zeroCount;
positiveCount = negativeCount = zeroCount = 0;
for (int num : nums) {
if (num == 0) zeroCount++;
else if (num > 0) positiveCount++;
else negativeCount++;
}
System.out.println(String.format("%.6f", (float) positiveCount / totalCount));
System.out.println(String.format("%.6f", (float) negativeCount / totalCount));
System.out.println(String.format("%.6f", (float) zeroCount / totalCount));
}
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int arr[] = new int[n];
for (int i = 0; i < n; i++) {
arr[i] = in.nextInt();
}
fractionCount(arr);
}
}
|
3e0296dde1a78d90470ea6d7bda120ae6a0f3b95 | 2,573 | java | Java | tmall-product/src/main/java/com/ysy/tmall/product/controller/AttrAttrgroupRelationController.java | SilenceIronMan/Tmall | 7ae2765a11513a7f726e562ec4df011adf6cd029 | [
"Apache-2.0"
]
| 3 | 2020-07-01T15:21:10.000Z | 2020-07-24T04:17:08.000Z | tmall-product/src/main/java/com/ysy/tmall/product/controller/AttrAttrgroupRelationController.java | SilenceIronMan/Tmall | 7ae2765a11513a7f726e562ec4df011adf6cd029 | [
"Apache-2.0"
]
| 2 | 2020-06-26T14:20:34.000Z | 2021-09-20T21:00:19.000Z | tmall-product/src/main/java/com/ysy/tmall/product/controller/AttrAttrgroupRelationController.java | SilenceIronMan/Tmall | 7ae2765a11513a7f726e562ec4df011adf6cd029 | [
"Apache-2.0"
]
| null | null | null | 28.318681 | 95 | 0.734187 | 1,064 | package com.ysy.tmall.product.controller;
import java.util.Arrays;
import java.util.Map;
//import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.ysy.tmall.product.entity.AttrAttrgroupRelationEntity;
import com.ysy.tmall.product.service.AttrAttrgroupRelationService;
import com.ysy.tmall.common.utils.PageUtils;
import com.ysy.tmall.common.utils.R;
/**
* 属性&属性分组关联
*
* @author SilenceIronMan
* @email [email protected]
* @date 2020-06-27 21:47:45
*/
@RestController
@RequestMapping("product/attrattrgrouprelation")
public class AttrAttrgroupRelationController {
@Autowired
private AttrAttrgroupRelationService attrAttrgroupRelationService;
/**
* 列表
*/
@RequestMapping("/list")
//@RequiresPermissions("product:attrattrgrouprelation:list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = attrAttrgroupRelationService.queryPage(params);
return R.ok().put("page", page);
}
/**
* 信息
*/
@RequestMapping("/info/{id}")
//@RequiresPermissions("product:attrattrgrouprelation:info")
public R info(@PathVariable("id") Long id){
AttrAttrgroupRelationEntity attrAttrgroupRelation = attrAttrgroupRelationService.getById(id);
return R.ok().put("attrAttrgroupRelation", attrAttrgroupRelation);
}
/**
* 保存
*/
@RequestMapping("/save")
//@RequiresPermissions("product:attrattrgrouprelation:save")
public R save(@RequestBody AttrAttrgroupRelationEntity attrAttrgroupRelation){
attrAttrgroupRelationService.save(attrAttrgroupRelation);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
//@RequiresPermissions("product:attrattrgrouprelation:update")
public R update(@RequestBody AttrAttrgroupRelationEntity attrAttrgroupRelation){
attrAttrgroupRelationService.updateById(attrAttrgroupRelation);
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
//@RequiresPermissions("product:attrattrgrouprelation:delete")
public R delete(@RequestBody Long[] ids){
attrAttrgroupRelationService.removeByIds(Arrays.asList(ids));
return R.ok();
}
}
|
3e0296fc5a7a6100d6c5e301c98ac0aebf51382e | 5,719 | java | Java | java/geodesic-operations/src/main/java/com/esri/arcgisruntime/geodesicoperations/MainActivity.java | 209creative/arcgis-runtime-samples-android | 99a3c09fe4affbde9c07f7d2ed4ad2358dbe2b67 | [
"Apache-2.0"
]
| 682 | 2015-01-04T03:01:48.000Z | 2022-03-29T04:48:22.000Z | java/geodesic-operations/src/main/java/com/esri/arcgisruntime/geodesicoperations/MainActivity.java | 209creative/arcgis-runtime-samples-android | 99a3c09fe4affbde9c07f7d2ed4ad2358dbe2b67 | [
"Apache-2.0"
]
| 550 | 2015-01-06T20:01:38.000Z | 2022-03-21T19:15:39.000Z | java/geodesic-operations/src/main/java/com/esri/arcgisruntime/geodesicoperations/MainActivity.java | 209creative/arcgis-runtime-samples-android | 99a3c09fe4affbde9c07f7d2ed4ad2358dbe2b67 | [
"Apache-2.0"
]
| 1,355 | 2015-01-02T20:44:55.000Z | 2022-03-24T08:41:02.000Z | 39.993007 | 118 | 0.752929 | 1,065 | /* Copyright 2018 Esri
*
* 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.esri.arcgisruntime.geodesicoperations;
import java.util.Arrays;
import android.graphics.Color;
import android.os.Bundle;
import android.view.MotionEvent;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import com.esri.arcgisruntime.ArcGISRuntimeEnvironment;
import com.esri.arcgisruntime.geometry.GeodeticCurveType;
import com.esri.arcgisruntime.geometry.Geometry;
import com.esri.arcgisruntime.geometry.GeometryEngine;
import com.esri.arcgisruntime.geometry.LinearUnit;
import com.esri.arcgisruntime.geometry.LinearUnitId;
import com.esri.arcgisruntime.geometry.Point;
import com.esri.arcgisruntime.geometry.PointCollection;
import com.esri.arcgisruntime.geometry.Polyline;
import com.esri.arcgisruntime.geometry.SpatialReferences;
import com.esri.arcgisruntime.mapping.ArcGISMap;
import com.esri.arcgisruntime.mapping.BasemapStyle;
import com.esri.arcgisruntime.mapping.view.Callout;
import com.esri.arcgisruntime.mapping.view.DefaultMapViewOnTouchListener;
import com.esri.arcgisruntime.mapping.view.Graphic;
import com.esri.arcgisruntime.mapping.view.GraphicsOverlay;
import com.esri.arcgisruntime.mapping.view.MapView;
import com.esri.arcgisruntime.symbology.SimpleLineSymbol;
import com.esri.arcgisruntime.symbology.SimpleMarkerSymbol;
public class MainActivity extends AppCompatActivity {
private MapView mMapView;
private final LinearUnit mUnitOfMeasurement = new LinearUnit(LinearUnitId.KILOMETERS);
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// authentication with an API key or named user is required to access basemaps and other
// location services
ArcGISRuntimeEnvironment.setApiKey(BuildConfig.API_KEY);
// create a map
ArcGISMap map = new ArcGISMap(BasemapStyle.ARCGIS_IMAGERY);
// set map to a map view
mMapView = findViewById(R.id.mapView);
mMapView.setMap(map);
// create a graphic overlay
GraphicsOverlay graphicsOverlay = new GraphicsOverlay();
mMapView.getGraphicsOverlays().add(graphicsOverlay);
// add a graphic at JFK to represent the flight start location
final Point start = new Point(-73.7781, 40.6413, SpatialReferences.getWgs84());
SimpleMarkerSymbol locationMarker = new SimpleMarkerSymbol(SimpleMarkerSymbol.Style.CIRCLE, Color.BLUE, 10);
Graphic startLocation = new Graphic(start, locationMarker);
graphicsOverlay.getGraphics().add(startLocation);
// create graphic for the destination
final Graphic endLocation = new Graphic();
endLocation.setSymbol(locationMarker);
graphicsOverlay.getGraphics().add(endLocation);
// create graphic representing the geodesic path between the two locations
final Graphic path = new Graphic();
path.setSymbol(new SimpleLineSymbol(SimpleLineSymbol.Style.DASH, Color.BLUE, 5));
graphicsOverlay.getGraphics().add(path);
// add onTouchListener to get the location of the user tap
mMapView.setOnTouchListener(new DefaultMapViewOnTouchListener(this, mMapView) {
@Override
public boolean onSingleTapConfirmed(MotionEvent motionEvent) {
// get the point that was clicked and convert it to a point in the map
android.graphics.Point clickLocation = new android.graphics.Point(Math.round(motionEvent.getX()),
Math.round(motionEvent.getY()));
Point mapPoint = mMapView.screenToLocation(clickLocation);
final Point destination = (Point) GeometryEngine.project(mapPoint, SpatialReferences.getWgs84());
endLocation.setGeometry(destination);
// create a straight line path between the start and end locations
PointCollection points = new PointCollection(Arrays.asList(start, destination), SpatialReferences.getWgs84());
Polyline polyline = new Polyline(points);
// densify the path as a geodesic curve and show it with the path graphic
Geometry pathGeometry = GeometryEngine
.densifyGeodetic(polyline, 1, mUnitOfMeasurement, GeodeticCurveType.GEODESIC);
path.setGeometry(pathGeometry);
// calculate the path distance
double distance = GeometryEngine.lengthGeodetic(pathGeometry, mUnitOfMeasurement, GeodeticCurveType.GEODESIC);
// create a textview for the callout
TextView calloutContent = new TextView(getApplicationContext());
calloutContent.setTextColor(Color.BLACK);
calloutContent.setSingleLine();
// format coordinates to 2 decimal places
calloutContent.setText("Distance: " + String.format("%.2f", distance) + " Kilometers");
final Callout callout = mMapView.getCallout();
callout.setLocation(mapPoint);
callout.setContent(calloutContent);
callout.show();
return true;
}
});
}
@Override
protected void onPause() {
mMapView.pause();
super.onPause();
}
@Override
protected void onResume() {
super.onResume();
mMapView.resume();
}
@Override
protected void onDestroy() {
super.onDestroy();
mMapView.dispose();
}
}
|
3e02999dbbb5b0f313a2000ca67b3fd17cd2837a | 17,517 | java | Java | dataformat-aasx/src/test/java/io/adminshell/aas/v3/dataformat/aasx/serialization/AASSimple.java | JensMueller2709/java-serializer | 87440a264c1b5d50a3911183b8f0336fcebcb37a | [
"ECL-2.0",
"Apache-2.0"
]
| null | null | null | dataformat-aasx/src/test/java/io/adminshell/aas/v3/dataformat/aasx/serialization/AASSimple.java | JensMueller2709/java-serializer | 87440a264c1b5d50a3911183b8f0336fcebcb37a | [
"ECL-2.0",
"Apache-2.0"
]
| null | null | null | dataformat-aasx/src/test/java/io/adminshell/aas/v3/dataformat/aasx/serialization/AASSimple.java | JensMueller2709/java-serializer | 87440a264c1b5d50a3911183b8f0336fcebcb37a | [
"ECL-2.0",
"Apache-2.0"
]
| null | null | null | 95.201087 | 241 | 0.76794 | 1,066 | /*
* Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.adminshell.aas.v3.dataformat.aasx.serialization;
import java.util.Arrays;
import io.adminshell.aas.v3.model.Asset;
import io.adminshell.aas.v3.model.AssetAdministrationShell;
import io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment;
import io.adminshell.aas.v3.model.AssetKind;
import io.adminshell.aas.v3.model.ConceptDescription;
import io.adminshell.aas.v3.model.DataTypeIEC61360;
import io.adminshell.aas.v3.model.IdentifierType;
import io.adminshell.aas.v3.model.KeyElements;
import io.adminshell.aas.v3.model.KeyType;
import io.adminshell.aas.v3.model.LangString;
import io.adminshell.aas.v3.model.ModelingKind;
import io.adminshell.aas.v3.model.Submodel;
import io.adminshell.aas.v3.model.impl.DefaultAdministrativeInformation;
import io.adminshell.aas.v3.model.impl.DefaultAsset;
import io.adminshell.aas.v3.model.impl.DefaultAssetAdministrationShell;
import io.adminshell.aas.v3.model.impl.DefaultAssetAdministrationShellEnvironment;
import io.adminshell.aas.v3.model.impl.DefaultAssetInformation;
import io.adminshell.aas.v3.model.impl.DefaultConceptDescription;
import io.adminshell.aas.v3.model.impl.DefaultDataSpecificationIEC61360;
import io.adminshell.aas.v3.model.impl.DefaultEmbeddedDataSpecification;
import io.adminshell.aas.v3.model.impl.DefaultFile;
import io.adminshell.aas.v3.model.impl.DefaultIdentifier;
import io.adminshell.aas.v3.model.impl.DefaultIdentifierKeyValuePair;
import io.adminshell.aas.v3.model.impl.DefaultKey;
import io.adminshell.aas.v3.model.impl.DefaultProperty;
import io.adminshell.aas.v3.model.impl.DefaultReference;
import io.adminshell.aas.v3.model.impl.DefaultSubmodel;
import io.adminshell.aas.v3.model.impl.DefaultSubmodelElementCollection;
public class AASSimple {
public static final java.io.File FILE = new java.io.File("src/test/resources/xmlExample.xml");
// AAS
public static final String AAS_ID = "ExampleMotor";
public static final String AAS_IDENTIFIER = "http://customer.com/aas/9175_7013_7091_9168";
// SUBMODEL_TECHNICAL_DATA
public static final String SUBMODEL_TECHNICAL_DATA_PROPERTY_ID_SHORT = "MaxRotationSpeed";
public static final String SUBMODEL_TECHNICAL_DATA_ID_SHORT = "TechnicalData";
public static final String SUBMODEL_TECHNICAL_DATA_ID = "http://i40.customer.com/type/1/1/7A7104BDAB57E184";
public static final String SUBMODEL_TECHNICAL_DATA_SEMANTIC_ID = "0173-1#01-AFZ615#016";
public static final String SUBMODEL_TECHNICAL_DATA_SEMANTIC_ID_PROPERTY = "0173-1#02-BAA120#008";
public static final String SUBMODEL_TECHNICAL_DATA_PROPERTY_CATEGORY = "Parameter";
public static final String SUBMODEL_TECHNICAL_DATA_PROPERTY_VALUE = "5000";
public static final String SUBMODEL_TECHNICAL_DATA_PROPERTY_VALUETYPE = "integer";
// SUBMODEL_DOCUMENTATION
private static final String SUBMODEL_DOCUMENTATION_ID_SHORT = "Documentation";
private static final String SUBMODEL_DOCUMENTATION_ID = "http://i40.customer.com/type/1/1/1A7B62B529F19152";
private static final String SUBMODEL_DOCUMENTATION_ELEMENTCOLLECTION_SEMANTIC_ID = "www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document";
private static final String SUBMODEL_DOCUMENTATION_ELEMENTCOLLECTION_ID_SHORT = "OperatingManual";
private static final String SUBMODEL_DOCUMENTATION_PROPERTY_SEMANTIC_ID = "www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title";
private static final String SUBMODEL_DOCUMENTATION_PROPERTY_ID_SHORT = "Title";
private static final String SUBMODEL_DOCUMENTATION_PROPERTY_VALUE = "OperatingManual";
private static final String SUBMODEL_DOCUMENTATION_PROPERTY_VALUETYPE = "langString";
private static final String SUBMODEL_DOCUMENTATION_FILE_SEMANTIC_ID = "www.vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile";
private static final String SUBMODEL_DOCUMENTATION_FILE_ID_SHORT = "DigitalFile_PDF";
private static final String SUBMODEL_DOCUMENTATION_FILE_MIMETYPE = "application/pdf";
private static final String SUBMODEL_DOCUMENTATION_FILE_VALUE = "/aasx/OperatingManual.pdf";
// SUBMODEL_OPERATIONAL_DATA
private static final String SUBMODEL_OPERATIONAL_DATA_ID_SHORT = "OperationalData";
private static final String SUBMODEL_OPERATIONAL_DATA_ID = "http://i40.customer.com/instance/1/1/AC69B1CB44F07935";
private static final String SUBMODEL_OPERATIONAL_DATA_SEMANTIC_ID_PROPERTY = "http://customer.com/cd/1/1/18EBD56F6B43D895";
private static final String SUBMODEL_OPERATIONAL_DATA_PROPERTY_ID_SHORT = "RotationSpeed";
private static final String SUBMODEL_OPERATIONAL_DATA_PROPERTY_CATEGORY = "Variable";
private static final String SUBMODEL_OPERATIONAL_DATA_PROPERTY_VALUE = "4370";
private static final String SUBMODEL_OPERATIONAL_DATA_PROPERTY_VALUETYPE = "integer";
public AASSimple() {
}
public static final AssetAdministrationShell AAS = new DefaultAssetAdministrationShell.Builder().idShort(AAS_ID).identification(new DefaultIdentifier.Builder().idType(IdentifierType.IRI).identifier(AAS_IDENTIFIER).build())
.assetInformation(new DefaultAssetInformation.Builder().assetKind(AssetKind.INSTANCE)
.globalAssetId(new DefaultReference.Builder().key(new DefaultKey.Builder().type(KeyElements.ASSET).value("http://customer.com/assets/KHBVZJSQKIY").idType(KeyType.IRI).build()).build())
.specificAssetId(new DefaultIdentifierKeyValuePair.Builder().key("EquipmentID").value("538fd1b3-f99f-4a52-9c75-72e9fa921270")
.externalSubjectId(new DefaultReference.Builder().key(new DefaultKey.Builder().type(KeyElements.GLOBAL_REFERENCE).value("http://customer.com/Systems/ERP/012").idType(KeyType.IRI).build()).build()).build())
.specificAssetId(new DefaultIdentifierKeyValuePair.Builder().key("DeviceID").value("QjYgPggjwkiHk4RrQiYSLg==")
.externalSubjectId(new DefaultReference.Builder().key(new DefaultKey.Builder().type(KeyElements.GLOBAL_REFERENCE).value("http://customer.com/Systems/IoT/1").idType(KeyType.IRI).build()).build()).build())
.defaultThumbnail(new DefaultFile.Builder().kind(ModelingKind.INSTANCE).idShort("thumbnail").mimeType("image/png").value("https://github.com/admin-shell/io/blob/master/verwaltungsschale-detail-part1.png").build())
.build())
.submodel(new DefaultReference.Builder().key(new DefaultKey.Builder().type(KeyElements.SUBMODEL).value("http.//i40.customer.com/type/1/1/7A7104BDAB57E184").idType(KeyType.IRI).build()).build())
.submodel(new DefaultReference.Builder().key(new DefaultKey.Builder().type(KeyElements.SUBMODEL).value("http://i40.customer.com/instance/1/1/AC69B1CB44F07935").idType(KeyType.IRI).build()).build())
.submodel(new DefaultReference.Builder().key(new DefaultKey.Builder().type(KeyElements.SUBMODEL).value("http://i40.customer.com/type/1/1/1A7B62B529F19152").idType(KeyType.IRI).build()).build()).build();
public static final Asset ASSET = new DefaultAsset.Builder().idShort("ServoDCMotor").identification(new DefaultIdentifier.Builder().idType(IdentifierType.IRI).identifier("http://customer.com/assets/KHBVZJSQKIY").build()).build();
public static final Submodel SUBMODEL_TECHNICAL_DATA = new DefaultSubmodel.Builder()
.semanticId(new DefaultReference.Builder().key(new DefaultKey.Builder().type(KeyElements.GLOBAL_REFERENCE).value(SUBMODEL_TECHNICAL_DATA_SEMANTIC_ID).idType(KeyType.IRDI).build()).build()).kind(ModelingKind.INSTANCE)
.idShort(SUBMODEL_TECHNICAL_DATA_ID_SHORT).identification(new DefaultIdentifier.Builder().identifier(SUBMODEL_TECHNICAL_DATA_ID).idType(IdentifierType.IRI).build())
.submodelElement(new DefaultProperty.Builder().kind(ModelingKind.INSTANCE)
.semanticId(new DefaultReference.Builder().key(new DefaultKey.Builder().type(KeyElements.CONCEPT_DESCRIPTION).value(SUBMODEL_TECHNICAL_DATA_SEMANTIC_ID_PROPERTY).idType(KeyType.IRDI).build()).build())
.idShort(SUBMODEL_TECHNICAL_DATA_PROPERTY_ID_SHORT).category(SUBMODEL_TECHNICAL_DATA_PROPERTY_CATEGORY).value(SUBMODEL_TECHNICAL_DATA_PROPERTY_VALUE).valueType(SUBMODEL_TECHNICAL_DATA_PROPERTY_VALUETYPE).build())
.build();
public static final Submodel SUBMODEL_OPERATIONAL_DATA = new DefaultSubmodel.Builder().kind(ModelingKind.INSTANCE).idShort(SUBMODEL_OPERATIONAL_DATA_ID_SHORT)
.identification(new DefaultIdentifier.Builder().identifier(SUBMODEL_OPERATIONAL_DATA_ID).idType(IdentifierType.IRI).build())
.submodelElement(new DefaultProperty.Builder().kind(ModelingKind.INSTANCE)
.semanticId(new DefaultReference.Builder().key(new DefaultKey.Builder().type(KeyElements.CONCEPT_DESCRIPTION).value(SUBMODEL_OPERATIONAL_DATA_SEMANTIC_ID_PROPERTY).idType(KeyType.IRI).build()).build())
.idShort(SUBMODEL_OPERATIONAL_DATA_PROPERTY_ID_SHORT).category(SUBMODEL_OPERATIONAL_DATA_PROPERTY_CATEGORY).value(SUBMODEL_OPERATIONAL_DATA_PROPERTY_VALUE).valueType(SUBMODEL_OPERATIONAL_DATA_PROPERTY_VALUETYPE).build())
.build();
public static final Submodel SUBMODEL_DOCUMENTATION = new DefaultSubmodel.Builder().kind(ModelingKind.INSTANCE).idShort(SUBMODEL_DOCUMENTATION_ID_SHORT)
.identification(new DefaultIdentifier.Builder().identifier(SUBMODEL_DOCUMENTATION_ID).idType(IdentifierType.IRI).build())
.submodelElement(new DefaultSubmodelElementCollection.Builder().kind(ModelingKind.INSTANCE)
.semanticId(new DefaultReference.Builder().key(new DefaultKey.Builder().type(KeyElements.CONCEPT_DESCRIPTION).value(SUBMODEL_DOCUMENTATION_ELEMENTCOLLECTION_SEMANTIC_ID).idType(KeyType.IRI).build()).build())
.idShort(SUBMODEL_DOCUMENTATION_ELEMENTCOLLECTION_ID_SHORT)
.value(new DefaultProperty.Builder().kind(ModelingKind.INSTANCE)
.semanticId(new DefaultReference.Builder().key(new DefaultKey.Builder().type(KeyElements.CONCEPT_DESCRIPTION).value(SUBMODEL_DOCUMENTATION_PROPERTY_SEMANTIC_ID).idType(KeyType.IRI).build()).build())
.idShort(SUBMODEL_DOCUMENTATION_PROPERTY_ID_SHORT).value(SUBMODEL_DOCUMENTATION_PROPERTY_VALUE).valueType(SUBMODEL_DOCUMENTATION_PROPERTY_VALUETYPE).build())
.value(new DefaultFile.Builder().kind(ModelingKind.INSTANCE)
.semanticId(new DefaultReference.Builder().key(new DefaultKey.Builder().type(KeyElements.CONCEPT_DESCRIPTION).value(SUBMODEL_DOCUMENTATION_FILE_SEMANTIC_ID).idType(KeyType.IRI).build()).build())
.idShort(SUBMODEL_DOCUMENTATION_FILE_ID_SHORT).mimeType(SUBMODEL_DOCUMENTATION_FILE_MIMETYPE).value(SUBMODEL_DOCUMENTATION_FILE_VALUE).build())
.ordered(false).allowDuplicates(false).build())
.build();
public static final ConceptDescription CONCEPT_DESCRIPTION_TITLE = new DefaultConceptDescription.Builder().idShort("Title")
.identification(new DefaultIdentifier.Builder().identifier("www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title").idType(IdentifierType.IRI).build())
.embeddedDataSpecification(new DefaultEmbeddedDataSpecification.Builder()
.dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder().preferredName(new LangString("Title", "EN")).preferredName(new LangString("Titel", "DE")).shortName(new LangString("Title", "EN"))
.shortName(new LangString("Titel", "DE")).dataType(DataTypeIEC61360.STRING_TRANSLATABLE).definition(new LangString("SprachabhaengigerTiteldesDokuments.", "DE")).build())
.build())
.build();
public static final ConceptDescription CONCEPT_DESCRIPTION_DIGITALFILE = new DefaultConceptDescription.Builder().idShort("DigitalFile")
.identification(new DefaultIdentifier.Builder().identifier("www.vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile").idType(IdentifierType.IRI).build())
.embeddedDataSpecification(new DefaultEmbeddedDataSpecification.Builder().dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder().preferredName(new LangString("DigitalFile", "EN"))
.preferredName(new LangString("DigitaleDatei", "DE")).shortName(new LangString("DigitalFile", "EN")).shortName(new LangString("DigitaleDatei", "DE")).dataType(DataTypeIEC61360.STRING)
.definition(new LangString("Eine Datei, die die Document Version repraesentiert. Neben der obligatorischen PDF Datei koennen weitere Dateien angegeben werden.", "DE")).build()).build())
.build();
public static final ConceptDescription CONCEPT_DESCRIPTION_MAXROTATIONSPEED = new DefaultConceptDescription.Builder().idShort("MaxRotationSpeed").category("Property")
.administration(new DefaultAdministrativeInformation.Builder().version("1").revision("2").build()).identification(new DefaultIdentifier.Builder().identifier("0173-1#02-BAA120#008").idType(IdentifierType.IRDI).build())
.embeddedDataSpecifications(Arrays.asList(new DefaultEmbeddedDataSpecification.Builder()
.dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder().preferredName(new LangString("max.Drehzahl", "de")).preferredName(new LangString("Max.rotationspeed", "en")).unit("1/min")
.unitId(new DefaultReference.Builder().key(new DefaultKey.Builder().type(KeyElements.GLOBAL_REFERENCE).value("0173-1#05-AAA650#002").idType(KeyType.IRDI).build()).build()).dataType(DataTypeIEC61360.REAL_MEASURE)
.definition(new LangString("HoechstezulaessigeDrehzahl,mitwelcherderMotoroderdieSpeiseinheitbetriebenwerdendarf", "de"))
.definition(new LangString("Greatestpermissiblerotationspeedwithwhichthemotororfeedingunitmaybeoperated", "en")).build())
.build()))
.build();
public static final ConceptDescription CONCEPT_DESCRIPTION_ROTATIONSPEED = new DefaultConceptDescription.Builder().idShort("RotationSpeed").category("Property")
.identification(new DefaultIdentifier.Builder().identifier("http://customer.com/cd/1/1/18EBD56F6B43D895").idType(IdentifierType.IRI).build())
.embeddedDataSpecification(new DefaultEmbeddedDataSpecification.Builder().dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder().preferredName(new LangString("AktuelleDrehzahl", "DE"))
.preferredName(new LangString("Actualrotationspeed", "EN")).shortName(new LangString("AktuelleDrehzahl", "DE")).shortName(new LangString("ActualRotationSpeed", "EN")).unit("1/min")
.unitId(new DefaultReference.Builder().key(new DefaultKey.Builder().type(KeyElements.GLOBAL_REFERENCE).value("0173-1#05-AAA650#002").idType(KeyType.IRDI).build()).build()).dataType(DataTypeIEC61360.REAL_MEASURE)
.definition(new LangString("Aktuelle Drehzahl, mitwelcher der Motor oder die Speiseinheit betrieben wird", "DE")).definition(new LangString("Actual rotationspeed with which the motor or feedingunit is operated", "EN"))
.build()).build())
.build();
public static final ConceptDescription CONCEPT_DESCRIPTION_DOCUMENT = new DefaultConceptDescription.Builder().idShort("Document")
.identification(new DefaultIdentifier.Builder().identifier("www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document").idType(IdentifierType.IRI).build())
.embeddedDataSpecification(new DefaultEmbeddedDataSpecification.Builder().dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder().shortName(new LangString("Document", "EN"))
.shortName(new LangString("Dokument", "DE")).sourceOfDefinition("[ISO15519-1:2010]").dataType(DataTypeIEC61360.STRING)
.definition(new LangString("Feste und geordnete Menge von fuer die Verwendung durch Personen bestimmte Informationen, die verwaltet und als Einheit zwischen Benutzern und System ausgetauscht werden kann.", "DE")).build())
.build())
.build();
public static final AssetAdministrationShellEnvironment ENVIRONMENT = new DefaultAssetAdministrationShellEnvironment.Builder().assetAdministrationShells(AAS).submodels(SUBMODEL_TECHNICAL_DATA).submodels(SUBMODEL_DOCUMENTATION)
.submodels(SUBMODEL_OPERATIONAL_DATA).conceptDescriptions(CONCEPT_DESCRIPTION_TITLE).conceptDescriptions(CONCEPT_DESCRIPTION_DIGITALFILE).conceptDescriptions(CONCEPT_DESCRIPTION_MAXROTATIONSPEED)
.conceptDescriptions(CONCEPT_DESCRIPTION_ROTATIONSPEED).conceptDescriptions(CONCEPT_DESCRIPTION_DOCUMENT).build();
}
|
3e0299b57f6f34b19893aa470789d165171babd4 | 1,015 | java | Java | src/org/dbflute/erflute/editor/model/dbexport/ddl/validator/rule/view/impl/NoViewSqlRule.java | schatten4810/erflute | 09f946972efcd5935fd752ff74f36827f726b18f | [
"Apache-2.0"
]
| null | null | null | src/org/dbflute/erflute/editor/model/dbexport/ddl/validator/rule/view/impl/NoViewSqlRule.java | schatten4810/erflute | 09f946972efcd5935fd752ff74f36827f726b18f | [
"Apache-2.0"
]
| null | null | null | src/org/dbflute/erflute/editor/model/dbexport/ddl/validator/rule/view/impl/NoViewSqlRule.java | schatten4810/erflute | 09f946972efcd5935fd752ff74f36827f726b18f | [
"Apache-2.0"
]
| null | null | null | 39.038462 | 96 | 0.727094 | 1,067 | package org.dbflute.erflute.editor.model.dbexport.ddl.validator.rule.view.impl;
import org.dbflute.erflute.core.DisplayMessages;
import org.dbflute.erflute.editor.model.dbexport.ddl.validator.ValidateResult;
import org.dbflute.erflute.editor.model.dbexport.ddl.validator.rule.view.ViewRule;
import org.dbflute.erflute.editor.model.diagram_contents.element.node.view.ERView;
import org.eclipse.core.resources.IMarker;
public class NoViewSqlRule extends ViewRule {
@Override
public boolean validate(ERView view) {
if (view.getSql() == null || view.getSql().trim().equals("")) {
ValidateResult validateResult = new ValidateResult();
validateResult.setMessage(DisplayMessages.getMessage("error.validate.no.view.sql"));
validateResult.setLocation(view.getLogicalName());
validateResult.setSeverity(IMarker.SEVERITY_WARNING);
validateResult.setObject(view);
this.addError(validateResult);
}
return true;
}
}
|
3e0299de8c18969c093660717dfe9ffe1c0d00bf | 363 | java | Java | peacetrue-statistics/src/main/java/com/github/peacetrue/statistics/TwoDimensionChat.java | peacetrue/peacetrue | fb83c622d7be43586dbee799a6bd23b42e141853 | [
"Apache-2.0"
]
| 11 | 2018-05-02T14:44:09.000Z | 2021-07-26T07:00:12.000Z | peacetrue-statistics/src/main/java/com/github/peacetrue/statistics/TwoDimensionChat.java | peacetrue/peacetrue | fb83c622d7be43586dbee799a6bd23b42e141853 | [
"Apache-2.0"
]
| 1 | 2021-07-27T01:21:23.000Z | 2021-07-27T01:21:23.000Z | peacetrue-statistics/src/main/java/com/github/peacetrue/statistics/TwoDimensionChat.java | peacetrue/peacetrue | fb83c622d7be43586dbee799a6bd23b42e141853 | [
"Apache-2.0"
]
| 1 | 2019-08-05T08:04:49.000Z | 2019-08-05T08:04:49.000Z | 14.52 | 40 | 0.69697 | 1,068 | package com.github.peacetrue.statistics;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* 二维图表
*
* @author xiayx
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class TwoDimensionChat<X, Y> {
/** x轴 */
private List<X> xAxises;
/** y轴 */
private List<Y> yAxises;
}
|
3e029aa2c44440938706e4114f078a5b1286d2ee | 7,395 | java | Java | ProyectoRedesNmap/src/co/edu/uniquindio/vista/VentanaPrincipal.java | JuanDavidSanchezAroca/Redes | 8a09e28a6d0688de3005666f85a638abf2b91995 | [
"MIT"
]
| null | null | null | ProyectoRedesNmap/src/co/edu/uniquindio/vista/VentanaPrincipal.java | JuanDavidSanchezAroca/Redes | 8a09e28a6d0688de3005666f85a638abf2b91995 | [
"MIT"
]
| null | null | null | ProyectoRedesNmap/src/co/edu/uniquindio/vista/VentanaPrincipal.java | JuanDavidSanchezAroca/Redes | 8a09e28a6d0688de3005666f85a638abf2b91995 | [
"MIT"
]
| null | null | null | 26.793478 | 99 | 0.712508 | 1,069 |
package co.edu.uniquindio.vista;
import java.awt.HeadlessException;
import java.net.SocketException;
import java.util.ArrayList;
import javax.swing.JFrame;
import javax.swing.JTabbedPane;
import javax.swing.JButton;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
import co.edu.uniquindio.logica.JNetMap;
import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JComboBox;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
/**
* Clase encargada de la vista de la aplicacion
* @author Juan David Sanchez A.
* @author Juan Camilo Correa Pacheco
* @author Carlos Alberto Cardona Beltran
* @author Univerisdad Del Quindio
* @author Armenia - Quindio
*/
public class VentanaPrincipal {
/**
* Panel contenedor auxiliar
*/
private JPanel panel;
/**
* Instancia personal de la clase de logica
*/
public JNetMap logica;
/**
* Ventana de esta clase
*/
private JFrame frame;
/**
* Campo donde se ingresa la direccion ip para escanear sus puertos
*/
private JTextField textField;
/**
* Tabla para visualizar las ip disponibles
*/
private JTable jTable1;
/**
* Combobox que contiene una lista de las tarjetas de red disponibles
*/
private JComboBox<String> cbSeleccionarTarjeta;
/**
* Tabla para visualizar los puertos disponibles
*/
private JTable jtPuertos;
/**
* Metodo para ejecutar la vista de la aplicacion
*/
public void run() {
try {
VentanaPrincipal window = new VentanaPrincipal();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* Metodo constructor de la clase
*/
public VentanaPrincipal() {
logica = new JNetMap();
initialize();
}
/**
* Inicializa los componentes
*/
private void initialize() {
frame = new JFrame();
frame.setBounds(100, 100, 728, 514);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(null);
JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
tabbedPane.setBounds(0, 0, 702, 464);
frame.getContentPane().add(tabbedPane);
JPanel panel_1 = new JPanel();
tabbedPane.addTab("Lista de equipos", null, panel_1, null);
panel_1.setLayout(null);
JLabel lbTitulo = new JLabel("Interfaces de red");
lbTitulo.setBounds(40, 12, 200, 15);
panel_1.add(lbTitulo);
cbSeleccionarTarjeta = new JComboBox<>();
cbSeleccionarTarjeta.setBounds(40, 38, 394, 30);
panel_1.add(cbSeleccionarTarjeta);
llenarComboBoxTarjetasRed();
JButton btnIniciarEscaneo = new JButton("Iniciar Escaneo");
btnIniciarEscaneo.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
listarEquiposEnRed();
}
});
btnIniciarEscaneo.setBounds(467, 120, 150, 40);
panel_1.add(btnIniciarEscaneo);
JButton btnInformacion = new JButton("Informacion");
btnInformacion.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
try {
int num = Integer.parseInt(cbSeleccionarTarjeta.getSelectedItem().toString().substring(0, 1));
logica.obtenerInformacion(num);
JOptionPane.showMessageDialog(null, logica.imprimirInformacion());
} catch (HeadlessException | SocketException e) {
JOptionPane.showMessageDialog(null, "la solicitud no se pudo procesar");
}
}
});
btnInformacion.setBounds(467, 55, 130, 40);
panel_1.add(btnInformacion);
JScrollPane scrollPane = new JScrollPane();
scrollPane.setBounds(40, 132, 394, 275);
panel_1.add(scrollPane);
jTable1 = new JTable();
scrollPane.setViewportView(jTable1);
JLabel label = new JLabel("Interfaces de red");
label.setBounds(40, 12, 200, 15);
panel_1.add(label);
JLabel lblListaDeHost = new JLabel("Lista de host disponibles en la red");
lblListaDeHost.setBounds(40, 105, 290, 15);
panel_1.add(lblListaDeHost);
panel = new JPanel();
tabbedPane.addTab("Puertos disponibles", null, panel, null);
panel.setLayout(null);
JScrollPane scrollPane_1 = new JScrollPane();
scrollPane_1.setBounds(41, 81, 394, 275);
panel.add(scrollPane_1);
jtPuertos = new JTable();
scrollPane_1.setViewportView(jtPuertos);
JLabel lblDireccionIpDel = new JLabel("Direccion IP del host");
lblDireccionIpDel.setBounds(12, 32, 160, 14);
panel.add(lblDireccionIpDel);
textField = new JTextField();
textField.setBounds(190, 30, 154, 20);
panel.add(textField);
textField.setColumns(10);
JButton btnEscanear = new JButton("Escanear");
btnEscanear.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
escanearPuertos();
}
});
btnEscanear.setBounds(413, 28, 118, 23);
panel.add(btnEscanear);
JPanel panel_3 = new JPanel();
tabbedPane.addTab("Servicios por puerto", null, panel_3, null);
}
/**
* mETODO PARA LLENAR LA TABLA CON las direcciones ip de LOS HOSTs QUE ESTAN
* DIPONIBLES EN LA RED
*/
public void listarEquiposEnRed() {
// Enviar por parametro al metodo
// para el boton escanear, se obtendria
// luego se llama logica.obtener informacion(indicedelatarjeta) enviado
// la tarjeta
try {
int num = Integer.parseInt(cbSeleccionarTarjeta.getSelectedItem().toString().substring(0, 1));
logica.obtenerInformacion(num);
} catch (NumberFormatException | SocketException e) {
// TODO Auto-generated catch block
// e.printStackTrace();
}
// luego se coge la lista de hostlogica.
// luego se llama el metodo logica.hostdiponibles
logica.hostDisponibles();
System.out.println(logica.getHostDisponible());
llenarTablaHosts();
}
/**
* Este metodo se encarga de listar en un combobox todas las tarjetas de red
* disponibles
*/
public void llenarComboBoxTarjetasRed() {
try {
logica.listarTarjetas();
int indice = 0;
for (String tarjeta : logica.getInterfacesLista()) {
cbSeleccionarTarjeta.addItem(indice + " - " + tarjeta);
indice++;
}
} catch (SocketException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
* Metodo para llenar la tabla con las direccones ip disponibles
*/
public void llenarTablaHosts() {
DefaultTableModel modelo = new DefaultTableModel();
// jTable1.removeAll();
modelo.setRowCount(0);
modelo.addColumn("Direccion IP");
jTable1.setModel(modelo);
ArrayList<String> datos = (ArrayList<String>) logica.getHostDisponible();
// LE PASO AL ARRAY LOS DATOS DEL ARRAYLIST
Object[] fila = new Object[1];
for (int i = 0; i < datos.size(); i++) {
fila[0] = (datos.get(i));
modelo.addRow(fila);
}
}
/**
* Este metodo se encarga de listar en una tabla todos los puertos que estan
* disponibles para el numero de host ingresado en el campo de texto
*/
public void escanearPuertos() {
String ip = textField.getText();
try {
if (logica.realizarPing(ip)) {
DefaultTableModel modelo = new DefaultTableModel();
modelo.addColumn("Numero de puerto");
jtPuertos.setModel(modelo);
Object[] fila = new Object[1];
for (int puerto : logica.port(ip)) {
fila[0] = puerto;
modelo.addRow(fila);
}
} else {
JOptionPane.showMessageDialog(null, "La direccion ip no es alcanzable");
}
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "Ha ocurrido un error inesperado");
}
}
}
|
3e029b7ab1d9769627e8f0e283c599ca3d06ba8a | 1,479 | java | Java | fatjdbc/src/main/java/com/qubole/quark/fatjdbc/impl/QuarkServer.java | qubole/quark | 3eb76af7fda111566792266fbc4f2a70f7b700e1 | [
"Apache-2.0"
]
| 95 | 2015-12-17T09:33:16.000Z | 2022-03-29T06:04:10.000Z | fatjdbc/src/main/java/com/qubole/quark/fatjdbc/impl/QuarkServer.java | qubole/quark | 3eb76af7fda111566792266fbc4f2a70f7b700e1 | [
"Apache-2.0"
]
| 75 | 2016-01-26T16:36:45.000Z | 2019-07-02T17:21:17.000Z | fatjdbc/src/main/java/com/qubole/quark/fatjdbc/impl/QuarkServer.java | qubole/quark | 3eb76af7fda111566792266fbc4f2a70f7b700e1 | [
"Apache-2.0"
]
| 30 | 2015-12-17T08:41:32.000Z | 2022-03-10T09:04:47.000Z | 30.8125 | 75 | 0.743746 | 1,070 | /*
* Copyright (c) 2015. Qubole Inc
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.qubole.quark.fatjdbc.impl;
import org.apache.calcite.avatica.Meta;
import com.google.common.collect.Maps;
import com.qubole.quark.fatjdbc.QuarkConnection;
import com.qubole.quark.fatjdbc.QuarkConnectionImpl;
import com.qubole.quark.fatjdbc.QuarkJdbcStatement;
import java.util.Map;
/**
* Implementation of Server.
*/
public class QuarkServer {
final Map<Integer, QuarkJdbcStatement> statementMap = Maps.newHashMap();
public void removeStatement(Meta.StatementHandle h) {
statementMap.remove(h.id);
}
public void addStatement(QuarkConnection connection,
Meta.StatementHandle h) {
final QuarkConnectionImpl c = (QuarkConnectionImpl) connection;
statementMap.put(h.id, new QuarkJdbcStatementImpl(c));
}
public QuarkJdbcStatement getStatement(Meta.StatementHandle h) {
return statementMap.get(h.id);
}
}
|
3e029bf7ea282e72e3f730c876649af8b038a78d | 3,128 | java | Java | ExtractedJars/iRobot_com.irobot.home/javafiles/com/google/gson/internal/bind/TypeAdapters$18.java | Andreas237/AndroidPolicyAutomation | c1ed10a2c6d4cf3dfda8b8e6291dee2c2a15ee8a | [
"MIT"
]
| 3 | 2019-05-01T09:22:08.000Z | 2019-07-06T22:21:59.000Z | ExtractedJars/iRobot_com.irobot.home/javafiles/com/google/gson/internal/bind/TypeAdapters$18.java | Andreas237/AndroidPolicyAutomation | c1ed10a2c6d4cf3dfda8b8e6291dee2c2a15ee8a | [
"MIT"
]
| null | null | null | ExtractedJars/iRobot_com.irobot.home/javafiles/com/google/gson/internal/bind/TypeAdapters$18.java | Andreas237/AndroidPolicyAutomation | c1ed10a2c6d4cf3dfda8b8e6291dee2c2a15ee8a | [
"MIT"
]
| 1 | 2020-11-26T12:22:02.000Z | 2020-11-26T12:22:02.000Z | 30.666667 | 79 | 0.542519 | 1,071 | // Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) annotate safe
package com.google.gson.internal.bind;
import com.google.gson.TypeAdapter;
import com.google.gson.stream.*;
import java.net.URL;
// Referenced classes of package com.google.gson.internal.bind:
// TypeAdapters
static final class TypeAdapters$18 extends TypeAdapter
{
public volatile Object read(JsonReader jsonreader)
{
return ((Object) (read(jsonreader)));
// 0 0:aload_0
// 1 1:aload_1
// 2 2:invokevirtual #17 <Method URL read(JsonReader)>
// 3 5:areturn
}
public URL read(JsonReader jsonreader)
{
if(jsonreader.peek() == JsonToken.NULL)
//* 0 0:aload_1
//* 1 1:invokevirtual #23 <Method JsonToken JsonReader.peek()>
//* 2 4:getstatic #29 <Field JsonToken JsonToken.NULL>
//* 3 7:if_acmpne 16
{
jsonreader.nextNull();
// 4 10:aload_1
// 5 11:invokevirtual #32 <Method void JsonReader.nextNull()>
return null;
// 6 14:aconst_null
// 7 15:areturn
}
jsonreader = ((JsonReader) (jsonreader.nextString()));
// 8 16:aload_1
// 9 17:invokevirtual #36 <Method String JsonReader.nextString()>
// 10 20:astore_1
if("null".equals(((Object) (jsonreader))))
//* 11 21:ldc1 #38 <String "null">
//* 12 23:aload_1
//* 13 24:invokevirtual #44 <Method boolean String.equals(Object)>
//* 14 27:ifeq 32
return null;
// 15 30:aconst_null
// 16 31:areturn
else
return new URL(((String) (jsonreader)));
// 17 32:new #46 <Class URL>
// 18 35:dup
// 19 36:aload_1
// 20 37:invokespecial #49 <Method void URL(String)>
// 21 40:areturn
}
public volatile void write(JsonWriter jsonwriter, Object obj)
{
write(jsonwriter, (URL)obj);
// 0 0:aload_0
// 1 1:aload_1
// 2 2:aload_2
// 3 3:checkcast #46 <Class URL>
// 4 6:invokevirtual #54 <Method void write(JsonWriter, URL)>
// 5 9:return
}
public void write(JsonWriter jsonwriter, URL url)
{
if(url == null)
//* 0 0:aload_2
//* 1 1:ifnonnull 9
url = null;
// 2 4:aconst_null
// 3 5:astore_2
else
//* 4 6:goto 14
url = ((URL) (url.toExternalForm()));
// 5 9:aload_2
// 6 10:invokevirtual #57 <Method String URL.toExternalForm()>
// 7 13:astore_2
jsonwriter.value(((String) (url)));
// 8 14:aload_1
// 9 15:aload_2
// 10 16:invokevirtual #63 <Method JsonWriter JsonWriter.value(String)>
// 11 19:pop
// 12 20:return
}
TypeAdapters$18()
{
// 0 0:aload_0
// 1 1:invokespecial #11 <Method void TypeAdapter()>
// 2 4:return
}
}
|
3e029c4b394c07acd9eed6af4def7d83d4ede96e | 575 | java | Java | test_filter_adaptor/src/main/java/com/wrike/qaa/adaptor/TestConfig.java | varivoda/test_filter | f3f0d62771e2024d8d0992484380bcc0e0a9ca38 | [
"MIT"
]
| 2 | 2021-11-09T17:37:11.000Z | 2021-12-09T15:11:53.000Z | test_filter_adaptor/src/main/java/com/wrike/qaa/adaptor/TestConfig.java | varivoda/test_filter | f3f0d62771e2024d8d0992484380bcc0e0a9ca38 | [
"MIT"
]
| null | null | null | test_filter_adaptor/src/main/java/com/wrike/qaa/adaptor/TestConfig.java | varivoda/test_filter | f3f0d62771e2024d8d0992484380bcc0e0a9ca38 | [
"MIT"
]
| 2 | 2021-09-13T16:50:52.000Z | 2021-10-31T16:28:34.000Z | 23.958333 | 79 | 0.662609 | 1,072 | package com.wrike.qaa.adaptor;
/**
* Created by Ivan Varivoda 06/03/2021
*
* Default way for getting test filter from System property
*/
public class TestConfig {
private static final String TEST_FILTER;
static {
String testFilterProp = System.getProperty("test.filter");
if (testFilterProp == null || testFilterProp.isEmpty()) {
throw new IllegalStateException("Set test.filter system property");
}
TEST_FILTER = testFilterProp;
}
public static String getTestFilter() {
return TEST_FILTER;
}
}
|
3e029c735b33fc1fbfabe90267700f335b36ee25 | 1,018 | java | Java | src/main/java/com/sangupta/dryredis/DryRedisHyperLogLogOperations.java | sangupta/dry-redis | 85ed8d2d0cbb620bf1065ca4302b486c3dd244f4 | [
"Apache-2.0"
]
| 6 | 2017-01-17T13:10:03.000Z | 2020-11-23T13:11:50.000Z | src/main/java/com/sangupta/dryredis/DryRedisHyperLogLogOperations.java | sangupta/dry-redis | 85ed8d2d0cbb620bf1065ca4302b486c3dd244f4 | [
"Apache-2.0"
]
| 1 | 2020-12-09T15:07:59.000Z | 2020-12-09T15:07:59.000Z | src/main/java/com/sangupta/dryredis/DryRedisHyperLogLogOperations.java | sangupta/dry-redis | 85ed8d2d0cbb620bf1065ca4302b486c3dd244f4 | [
"Apache-2.0"
]
| 2 | 2021-10-15T06:39:31.000Z | 2022-01-13T09:26:01.000Z | 26.102564 | 75 | 0.722986 | 1,073 | /**
*
* dry-redis: In-memory pure java implementation to Redis
* Copyright (c) 2016, Sandeep Gupta
*
* http://sangupta.com/projects/dry-redis
*
* 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.sangupta.dryredis;
import java.util.List;
interface DryRedisHyperLogLogOperations {
int pfadd(String key);
int pfadd(String key, String element);
long pfcount(String key);
long pfcount(List<String> keys);
String pfmerge(String destination, List<String> keys);
}
|
3e029cb7d185d9c6b77481d83c7c9a8f12779645 | 306 | java | Java | Modul 7/TP/src/Koordinat3D.java | bydzen/pbo-telyu-course | 380ba248292bad8c1553eb66d4c5c04dad8d415e | [
"MIT"
]
| null | null | null | Modul 7/TP/src/Koordinat3D.java | bydzen/pbo-telyu-course | 380ba248292bad8c1553eb66d4c5c04dad8d415e | [
"MIT"
]
| null | null | null | Modul 7/TP/src/Koordinat3D.java | bydzen/pbo-telyu-course | 380ba248292bad8c1553eb66d4c5c04dad8d415e | [
"MIT"
]
| null | null | null | 16.105263 | 46 | 0.477124 | 1,074 | package TP07;
public class Koordinat3D extends Koordinat{
private int z;
public Koordinat3D(int x, int y, int z) {
super(x, y);
this.z = z;
}
public int getZ() {
return z;
}
public void setZ(int z) {
this.z = z;
}
}
|
3e029cc27bd893ae50a6281744a3ca7dbd7f371a | 3,717 | java | Java | miru-anomaly-plugins/src/main/java/com/jivesoftware/os/miru/anomaly/plugins/AnomalyInjectable.java | leszekbednorz/miru | 209f6f0524344fd3b51e74c5738171841ea03ba9 | [
"Apache-2.0"
]
| 1 | 2019-05-24T14:03:53.000Z | 2019-05-24T14:03:53.000Z | miru-anomaly-plugins/src/main/java/com/jivesoftware/os/miru/anomaly/plugins/AnomalyInjectable.java | leszekbednorz/miru | 209f6f0524344fd3b51e74c5738171841ea03ba9 | [
"Apache-2.0"
]
| null | null | null | miru-anomaly-plugins/src/main/java/com/jivesoftware/os/miru/anomaly/plugins/AnomalyInjectable.java | leszekbednorz/miru | 209f6f0524344fd3b51e74c5738171841ea03ba9 | [
"Apache-2.0"
]
| null | null | null | 47.050633 | 139 | 0.700565 | 1,075 | package com.jivesoftware.os.miru.anomaly.plugins;
import com.google.common.base.Optional;
import com.jivesoftware.os.miru.api.MiruQueryServiceException;
import com.jivesoftware.os.miru.api.activity.MiruPartitionId;
import com.jivesoftware.os.miru.api.base.MiruTenantId;
import com.jivesoftware.os.miru.plugin.Miru;
import com.jivesoftware.os.miru.plugin.MiruProvider;
import com.jivesoftware.os.miru.plugin.partition.MiruPartitionUnavailableException;
import com.jivesoftware.os.miru.plugin.solution.MiruPartitionResponse;
import com.jivesoftware.os.miru.plugin.solution.MiruRequest;
import com.jivesoftware.os.miru.plugin.solution.MiruRequestAndReport;
import com.jivesoftware.os.miru.plugin.solution.MiruResponse;
import com.jivesoftware.os.miru.plugin.solution.MiruSolvableFactory;
import com.jivesoftware.os.mlogger.core.MetricLogger;
import com.jivesoftware.os.mlogger.core.MetricLoggerFactory;
/**
*
*/
public class AnomalyInjectable {
private static final MetricLogger LOG = MetricLoggerFactory.getLogger();
private final MiruProvider<? extends Miru> provider;
private final Anomaly anomaly;
public AnomalyInjectable(MiruProvider<? extends Miru> provider, Anomaly anomaly) {
this.provider = provider;
this.anomaly = anomaly;
}
public MiruResponse<AnomalyAnswer> score(MiruRequest<AnomalyQuery> request) throws MiruQueryServiceException, InterruptedException {
try {
LOG.debug("askAndMerge: request={}", request);
MiruTenantId tenantId = request.tenantId;
Miru miru = provider.getMiru(tenantId);
return miru.askAndMerge(tenantId,
new MiruSolvableFactory<>(request.name, provider.getStats(), "scoreAnomaly", new AnomalyQuestion(anomaly,
request,
provider.getRemotePartition(AnomalyRemotePartition.class))),
new AnomalyAnswerEvaluator(),
new AnomalyAnswerMerger(),
AnomalyAnswer.EMPTY_RESULTS,
miru.getDefaultExecutor(),
request.logLevel);
} catch (MiruPartitionUnavailableException | InterruptedException e) {
throw e;
} catch (Exception e) {
//TODO throw http error codes
throw new MiruQueryServiceException("Failed to score trending stream", e);
}
}
public MiruPartitionResponse<AnomalyAnswer> score(MiruPartitionId partitionId,
MiruRequestAndReport<AnomalyQuery, AnomalyReport> requestAndReport) throws MiruQueryServiceException, InterruptedException {
try {
LOG.debug("askImmediate: partitionId={} request={}", partitionId, requestAndReport.request);
LOG.trace("askImmediate: report={}", requestAndReport.report);
MiruTenantId tenantId = requestAndReport.request.tenantId;
Miru miru = provider.getMiru(tenantId);
return miru.askImmediate(tenantId,
partitionId,
new MiruSolvableFactory<>(requestAndReport.request.name, provider.getStats(), "scoreTrending", new AnomalyQuestion(anomaly,
requestAndReport.request,
provider.getRemotePartition(AnomalyRemotePartition.class))),
Optional.fromNullable(requestAndReport.report),
AnomalyAnswer.EMPTY_RESULTS,
requestAndReport.request.logLevel);
} catch (MiruPartitionUnavailableException | InterruptedException e) {
throw e;
} catch (Exception e) {
//TODO throw http error codes
throw new MiruQueryServiceException("Failed to score trending stream for partition: " + partitionId.getId(), e);
}
}
}
|
3e029cf7b43a5db361ea59b28213ed39eee1550e | 1,929 | java | Java | springboot-practice/src/main/java/com/nerotomato/entity/UmsMember.java | nerotomato/TroubleShooter | 59eef2c70f5061d0ed80c96dd5eba555b4465f8b | [
"Apache-2.0"
]
| null | null | null | springboot-practice/src/main/java/com/nerotomato/entity/UmsMember.java | nerotomato/TroubleShooter | 59eef2c70f5061d0ed80c96dd5eba555b4465f8b | [
"Apache-2.0"
]
| null | null | null | springboot-practice/src/main/java/com/nerotomato/entity/UmsMember.java | nerotomato/TroubleShooter | 59eef2c70f5061d0ed80c96dd5eba555b4465f8b | [
"Apache-2.0"
]
| null | null | null | 35.722222 | 105 | 0.705029 | 1,076 | package com.nerotomato.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.*;
import java.math.BigInteger;
import java.util.Date;
/**
* @Entity: 实体类, 必须
* @Table: 对应数据库中的表, 必须, name=表名,
* Indexes是声明表里的索引, columnList是索引的列, 同时声明此索引列是否唯一, 默认false
* Created by nero on 2021/4/27.
*/
@ApiModel
@Data
@Entity
@Table(name = "ums_member", indexes = {@Index(columnList = "id", unique = true),
@Index(columnList = "username", unique = true), @Index(columnList = "telephone", unique = true)})
public class UmsMember {
@Id // @Id: 指明id列, 必须 // @GeneratedValue: 表明是否自动生成, 必须, strategy也是必写, 指明主键生成策略, 默认是Oracle
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long id;
// @Column: 对应数据库列名,可选, nullable 是否可以为空, 默认true
@Column(name = "username", unique = true)
private String username;
private String password;
private String nickname;
// @Column: 对应数据库列名,可选, nullable 是否可以为空, 默认true
@Column(name = "telephone", unique = true)
private String telephone;
private int status;
private int gender;
//@JsonFormat注解会将数据库中数据按照如下格式返回给前端
@ApiModelProperty(value = "生日", example = "2021-5-12")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date birthday;
private String city;
private String job;
//@JsonFormat注解会将数据库中数据按照如下格式返回给前端
@ApiModelProperty(value = "创建时间", example = "yyyy-MM-dd HH:mm:ss.SSS")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS", timezone = "GMT+8")
private Date create_time;
//@JsonFormat注解会将数据库中数据按照如下格式返回给前端
@ApiModelProperty(value = "修改时间", example = "yyyy-MM-dd HH:mm:ss.SSS")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS", timezone = "GMT+8")
private Date update_time;
}
|
3e029e266896b4a5205f5d436d31253c093113f9 | 1,137 | java | Java | Leetcode/232_implementQueueUsingStacks.java | lu1995happy/Leetcode | afa3debdb70ab51a1ae43b03659b37e45fd4d617 | [
"MIT"
]
| null | null | null | Leetcode/232_implementQueueUsingStacks.java | lu1995happy/Leetcode | afa3debdb70ab51a1ae43b03659b37e45fd4d617 | [
"MIT"
]
| null | null | null | Leetcode/232_implementQueueUsingStacks.java | lu1995happy/Leetcode | afa3debdb70ab51a1ae43b03659b37e45fd4d617 | [
"MIT"
]
| null | null | null | 23.204082 | 79 | 0.566403 | 1,077 | import java.util.Stack;
public class implementQueueUsingStacks {
private Stack<Integer> input;
private Stack<Integer> output;
/** Initialize your data structure here. */
public implementQueueUsingStacks() {
input = new Stack<>();
output = new Stack<>();
}
/** Push element x to the back of queue. */
public void push(int x) {
input.push(x);
}
/** Removes the element from in front of queue and returns that element. */
public int pop() {
peek();
return output.pop();
}
/** Get the front element. */
public int peek() {
if (output.isEmpty()) {
while (!input.isEmpty()) {
output.push(input.pop());
}
}
return output.peek();
}
/** Returns whether the queue is empty. */
public boolean empty() {
return input.isEmpty() && output.isEmpty();
}
}
/**
* Your MyQueue object will be instantiated and called as such:
* MyQueue obj = new MyQueue();
* obj.push(x);
* int param_2 = obj.pop();
* int param_3 = obj.peek();
* boolean param_4 = obj.empty();
*/
|
3e029ef6eecfa0eecf6e5ba77add25b0b9f0833a | 6,842 | java | Java | cobigen/cobigen-tsplugin/src/test/java/com/devonfw/cobigen/tsplugin/TypeScriptMergerTest.java | ankumari1/tools-cobigen | 0053fca2c32f203b913cb51ce35cbf74720b722b | [
"Apache-2.0"
]
| null | null | null | cobigen/cobigen-tsplugin/src/test/java/com/devonfw/cobigen/tsplugin/TypeScriptMergerTest.java | ankumari1/tools-cobigen | 0053fca2c32f203b913cb51ce35cbf74720b722b | [
"Apache-2.0"
]
| null | null | null | cobigen/cobigen-tsplugin/src/test/java/com/devonfw/cobigen/tsplugin/TypeScriptMergerTest.java | ankumari1/tools-cobigen | 0053fca2c32f203b913cb51ce35cbf74720b722b | [
"Apache-2.0"
]
| null | null | null | 42.234568 | 113 | 0.658287 | 1,078 | package com.devonfw.cobigen.tsplugin;
import static org.assertj.core.api.Assertions.assertThat;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.junit.Test;
import com.devonfw.cobigen.api.exception.MergeException;
import com.devonfw.cobigen.tsplugin.merger.TypeScriptMerger;
/**
* Test methods for different TS mergers of the plugin
*/
public class TypeScriptMergerTest {
/** Test resources root path */
private static String testFileRootPath = "src/test/resources/testdata/unittest/merger/";
/**
* Checks if the ts-merger can be launched and if the iutput is correct with patchOverrides = false
* @throws MergeException
* test fails
*/
@Test
public void testMergingNoOverrides() throws MergeException {
// arrange
File baseFile = new File(testFileRootPath + "baseFile.ts");
// Next version should merge comments
// String regex = " * Should format correctly this line";
// act
String mergedContents =
new TypeScriptMerger("tsmerge", false).merge(baseFile, readTSFile("patchFile.ts"), "UTF-8");
assertThat(mergedContents).contains("bProperty");
assertThat(mergedContents).contains("aProperty: number = 2");
assertThat(mergedContents).contains("bMethod");
assertThat(mergedContents).contains("aMethod");
assertThat(mergedContents).contains("bProperty");
assertThat(mergedContents).contains("import { c, f } from 'd'");
assertThat(mergedContents).contains("import { a, e } from 'b'");
assertThat(mergedContents).contains("export { e, g } from 'f';");
assertThat(mergedContents).contains("export interface a {");
assertThat(mergedContents).contains("private b: number;");
// assertThat(mergedContents).containsPattern(regex);
mergedContents =
new TypeScriptMerger("tsmerge", false).merge(baseFile, readTSFile("patchFile.ts"), "ISO-8859-1");
assertThat(mergedContents).contains("bProperty");
assertThat(mergedContents).contains("aProperty: number = 2");
assertThat(mergedContents).contains("bMethod");
assertThat(mergedContents).contains("aMethod");
assertThat(mergedContents).contains("bProperty");
assertThat(mergedContents).contains("import { c, f } from 'd'");
assertThat(mergedContents).contains("import { a, e } from 'b'");
assertThat(mergedContents).contains("export { e, g } from 'f';");
assertThat(mergedContents).contains("export interface a {");
assertThat(mergedContents).contains("private b: number;");
// assertThat(mergedContents).containsPattern(regex);
}
/**
* Checks if the ts-merger can be launched and if the iutput is correct with patchOverrides = true
* @throws MergeException
* test fails
*/
@Test
public void testMergingOverrides() throws MergeException {
// arrange
File baseFile = new File(testFileRootPath + "baseFile.ts");
// act
String mergedContents =
new TypeScriptMerger("tsmerge", true).merge(baseFile, readTSFile("patchFile.ts"), "UTF-8");
assertThat(mergedContents).contains("bProperty");
assertThat(mergedContents).contains("aProperty: number = 3");
assertThat(mergedContents).contains("bMethod");
assertThat(mergedContents).contains("aMethod");
assertThat(mergedContents).contains("bProperty");
assertThat(mergedContents).contains("import { c, f } from 'd'");
assertThat(mergedContents).contains("import { a, e } from 'b'");
assertThat(mergedContents).contains("export { e, g } from 'f';");
assertThat(mergedContents).contains("interface a {");
assertThat(mergedContents).contains("private b: string;");
// Next version should merge comments
// assertThat(mergedContents).contains("// Should contain this comment");
mergedContents =
new TypeScriptMerger("tsmerge", true).merge(baseFile, readTSFile("patchFile.ts"), "ISO-8859-1");
assertThat(mergedContents).contains("bProperty");
assertThat(mergedContents).contains("aProperty: number = 3");
assertThat(mergedContents).contains("bMethod");
assertThat(mergedContents).contains("aMethod");
assertThat(mergedContents).contains("bProperty");
assertThat(mergedContents).contains("import { c, f } from 'd'");
assertThat(mergedContents).contains("import { a, e } from 'b'");
assertThat(mergedContents).contains("export { e, g } from 'f';");
assertThat(mergedContents).contains("interface a {");
assertThat(mergedContents).contains("private b: string;");
// Next version should merge comments
// assertThat(mergedContents).contains("// Should contain this comment");
}
/**
* Tests whether the contents will be rewritten after parsing and printing with the right encoding
* @throws IOException
* test fails
* @throws MergeException
* test fails
*/
@Test
public void testReadingEncoding() throws IOException, MergeException {
File baseFile = new File(testFileRootPath + "baseFile_encoding_UTF-8.ts");
File patchFile = new File(testFileRootPath + "patchFile.ts");
String mergedContents =
new TypeScriptMerger("", false).merge(baseFile, FileUtils.readFileToString(patchFile), "UTF-8");
assertThat(mergedContents.contains("Ñ")).isTrue();
baseFile = new File(testFileRootPath + "baseFile_encoding_ISO-8859-1.ts");
mergedContents =
new TypeScriptMerger("", false).merge(baseFile, FileUtils.readFileToString(patchFile), "ISO-8859-1");
assertThat(mergedContents.contains("Ñ"));
}
/**
* Reads a TS file
* @param fileName
* the ts file
* @return the content of the file
*/
private String readTSFile(String fileName) {
File patchFile = new File(testFileRootPath + fileName);
String file = patchFile.getAbsolutePath();
Reader reader = null;
String returnString;
try {
reader = new FileReader(file);
returnString = IOUtils.toString(reader);
reader.close();
} catch (FileNotFoundException e) {
throw new MergeException(patchFile, "Can not read file " + patchFile.getAbsolutePath());
} catch (IOException e) {
throw new MergeException(patchFile, "Can not read the base file " + patchFile.getAbsolutePath());
}
return returnString;
}
}
|
3e02a12ae58400b8a10d2de8816910bc41015d0d | 1,375 | java | Java | src/test/java/com/ginkgo/jspider/sample/WZSectionIndicator.java | xxzh2/jspider | 31a527732a4352749f18d1c60709550c288f531d | [
"MIT"
]
| null | null | null | src/test/java/com/ginkgo/jspider/sample/WZSectionIndicator.java | xxzh2/jspider | 31a527732a4352749f18d1c60709550c288f531d | [
"MIT"
]
| null | null | null | src/test/java/com/ginkgo/jspider/sample/WZSectionIndicator.java | xxzh2/jspider | 31a527732a4352749f18d1c60709550c288f531d | [
"MIT"
]
| null | null | null | 25.943396 | 98 | 0.682909 | 1,079 | package com.ginkgo.jspider.sample;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.jsoup.nodes.Element;
import com.ginkgo.jspider.crawl.document.PrasedDocument;
import com.ginkgo.jspider.indicator.SectionIndicator;
public class WZSectionIndicator implements SectionIndicator{
PrasedDocument doc ;
public PrasedDocument getDocument() {
return doc;
}
@Override
public List<Element> seekSection() {
List<Element> resList = new ArrayList<>();
// Elements elements = doc.getElementsByTag("script");
// for (Iterator<?> iterator = elements.iterator(); iterator.hasNext();) {
// Element e = (Element) iterator.next();
// if (e.html().contains(extendsKey)) {
// picPath.addAll(getPicByKey(e, extendsKey));
// }
// }
// log.info(doc.html());
Element el = doc.getElementById("list");
// log.info(el.html());
for (Iterator<?> iterator = el.getElementsByAttribute("href").iterator(); iterator.hasNext();) {
Element e = (Element) iterator.next();
// log.info(e.html());
// log.info(e.attr("href"));
// if (e.html().contains(extendsKey)) {
Element chapterEl = e;
chapterEl.attr("href", doc.getUrl() + e.attr("href"));
chapterEl.attr("name", e.text());
resList.add(chapterEl);
// }
}
return resList;
}
@Override
public void setDocument(PrasedDocument doc) {
this.doc = doc;
}
}
|
3e02a203b664fd700e9692acc89fe3bcbb8194df | 419 | java | Java | src/TestDesignPattern/dhDemo/brige/BridgeMain.java | leoeco2000/TestJava8 | fa96dc043aea3263bb5ee0ef78fd03b6a05c7d28 | [
"MIT"
]
| null | null | null | src/TestDesignPattern/dhDemo/brige/BridgeMain.java | leoeco2000/TestJava8 | fa96dc043aea3263bb5ee0ef78fd03b6a05c7d28 | [
"MIT"
]
| null | null | null | src/TestDesignPattern/dhDemo/brige/BridgeMain.java | leoeco2000/TestJava8 | fa96dc043aea3263bb5ee0ef78fd03b6a05c7d28 | [
"MIT"
]
| null | null | null | 19.952381 | 45 | 0.591885 | 1,080 | package TestDesignPattern.dhDemo.brige;
public class BridgeMain {
/**
* @param args
*/
public static void main(String[] args) {
Mobile nokia = new NokiaMobile("Nokia");
MobileSoft game = new MobileGame();
nokia.setSoft(game);
nokia.run();
Mobile moto = new MotoMible("Moto");
MobileSoft mp3 = new MobileMp3();
moto.setSoft(mp3);
moto.run();
}
}
|
3e02a3a0e2a0be5115d659caf4e1bc22085c3f0a | 58,917 | java | Java | android/src/main/java/io/emurgo/rnhaskellshelley/HaskellShelleyModule.java | ducnt-blc/react-native-haskell-shelley | 49be5bbb92407f73d634b314df3fca867ed68aaa | [
"MIT"
]
| null | null | null | android/src/main/java/io/emurgo/rnhaskellshelley/HaskellShelleyModule.java | ducnt-blc/react-native-haskell-shelley | 49be5bbb92407f73d634b314df3fca867ed68aaa | [
"MIT"
]
| null | null | null | android/src/main/java/io/emurgo/rnhaskellshelley/HaskellShelleyModule.java | ducnt-blc/react-native-haskell-shelley | 49be5bbb92407f73d634b314df3fca867ed68aaa | [
"MIT"
]
| 1 | 2021-03-17T04:10:49.000Z | 2021-03-17T04:10:49.000Z | 32.283288 | 158 | 0.598299 | 1,081 | package io.emurgo.rnhaskellshelley;
import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import android.util.Base64;
import java.util.HashMap;
import java.util.Map;
public class HaskellShelleyModule extends ReactContextBaseJavaModule {
private final ReactApplicationContext reactContext;
public HaskellShelleyModule(ReactApplicationContext reactContext) {
super(reactContext);
this.reactContext = reactContext;
}
@Override
public String getName() {
return "HaskellShelley";
}
// Utils
@ReactMethod
public final void makeIcarusBootstrapWitness(String txBodyHash, String addr, String key, Promise promise) {
Native.I
.makeIcarusBootstrapWitness(new RPtr(txBodyHash), new RPtr(addr), new RPtr(key))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void makeDaedalusBootstrapWitness(String txBodyHash, String addr, String key, Promise promise) {
Native.I
.makeDaedalusBootstrapWitness(new RPtr(txBodyHash), new RPtr(addr), new RPtr(key))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void makeVkeyWitness(String txBodyHash, String sk, Promise promise) {
Native.I
.makeVkeyWitness(new RPtr(txBodyHash), new RPtr(sk))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void hashTransaction(String txBody, Promise promise) {
Native.I
.hashTransaction(new RPtr(txBody))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void minAdaRequired(String assets, String minimumUtxoVal, Promise promise) {
Native.I
.minAdaRequired(new RPtr(assets), new RPtr(minimumUtxoVal))
.map(RPtr::toJs)
.pour(promise);
}
// BigNum
@ReactMethod
public final void bigNumFromStr(String string, Promise promise) {
Native.I
.bigNumFromStr(string)
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void bigNumToStr(String bigNum, Promise promise) {
Native.I
.bigNumToStr(new RPtr(bigNum))
.pour(promise);
}
@ReactMethod
public final void bigNumCheckedAdd(String bigNumPtr, String otherPtr, Promise promise) {
Native.I
.bigNumCheckedAdd(new RPtr(bigNumPtr), new RPtr(otherPtr))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void bigNumCheckedSub(String bigNumPtr, String otherPtr, Promise promise) {
Native.I
.bigNumCheckedSub(new RPtr(bigNumPtr), new RPtr(otherPtr))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void bigNumClampedSub(String bigNumPtr, String otherPtr, Promise promise) {
Native.I
.bigNumClampedSub(new RPtr(bigNumPtr), new RPtr(otherPtr))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void bigNumCompare(String bigNumPtr, String rhsPtr, Promise promise) {
Native.I
.bigNumCompare(new RPtr(bigNumPtr), new RPtr(rhsPtr))
.pour(promise);
}
// Value
@ReactMethod
public final void valueNew(String coin, Promise promise) {
Native.I
.valueNew(new RPtr(coin))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void valueCoin(String valuePtr, Promise promise) {
Native.I
.valueCoin(new RPtr(valuePtr))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void valueSetCoin(String valuePtr, String coinPtr, Promise promise) {
Native.I
.valueSetCoin(new RPtr(valuePtr), new RPtr(coinPtr))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void valueMultiasset(String valuePtr, Promise promise) {
Native.I
.valueMultiasset(new RPtr(valuePtr))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void valueSetMultiasset(String valuePtr, String multiassetPtr, Promise promise) {
Native.I
.valueSetMultiasset(new RPtr(valuePtr), new RPtr(multiassetPtr))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void valueCheckedAdd(String valuePtr, String rhsPtr, Promise promise) {
Native.I
.valueCheckedAdd(new RPtr(valuePtr), new RPtr(rhsPtr))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void valueCheckedSub(String valuePtr, String rhsPtr, Promise promise) {
Native.I
.valueCheckedSub(new RPtr(valuePtr), new RPtr(rhsPtr))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void valueClampedSub(String valuePtr, String rhsPtr, Promise promise) {
Native.I
.valueClampedSub(new RPtr(valuePtr), new RPtr(rhsPtr))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void valueCompare(String valuePtr, String rhsPtr, Promise promise) {
Native.I
.valueCompare(new RPtr(valuePtr), new RPtr(rhsPtr))
.pour(promise);
}
// AssetName
@ReactMethod
public final void assetNameNew(String bytes, Promise promise) {
Native.I
.assetNameNew(Base64.decode(bytes, Base64.DEFAULT))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void assetNameToBytes(String assetName, Promise promise) {
Native.I
.assetNameToBytes(new RPtr(assetName))
.map(bytes -> Base64.encodeToString(bytes, Base64.DEFAULT))
.pour(promise);
}
@ReactMethod
public final void assetNameFromBytes(String bytes, Promise promise) {
Native.I
.assetNameFromBytes(Base64.decode(bytes, Base64.DEFAULT))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void assetNameName(String assetName, Promise promise) {
Native.I
.assetNameName(new RPtr(assetName))
.map(bytes -> Base64.encodeToString(bytes, Base64.DEFAULT))
.pour(promise);
}
// AssetNames
// @ReactMethod
// public final void assetNamesToBytes(String assetNames, Promise promise) {
// Native.I
// .assetNamesToBytes(new RPtr(assetNames))
// .map(bytes -> Base64.encodeToString(bytes, Base64.DEFAULT))
// .pour(promise);
// }
//
// @ReactMethod
// public final void assetNamesFromBytes(String bytes, Promise promise) {
// Native.I
// .assetNamesFromBytes(Base64.decode(bytes, Base64.DEFAULT))
// .map(RPtr::toJs)
// .pour(promise);
// }
@ReactMethod
public final void assetNamesNew(Promise promise) {
Native.I
.assetNamesNew()
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void byronAddressFromIcarusKey(String bip32PublicKey, Integer network, Promise promise) {
Native.I
.byronAddressFromIcarusKey(new RPtr(bip32PublicKey), network)
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void assetNamesLen(String assetNames, Promise promise) {
Native.I
.assetNamesLen(new RPtr(assetNames))
.map(Long::intValue)
.pour(promise);
}
@ReactMethod
public final void assetNamesGet(String assetNames, Integer index, Promise promise) {
Native.I
.assetNamesGet(new RPtr(assetNames), index)
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void assetNamesAdd(String assetNames, String item, Promise promise) {
Native.I
.assetNamesAdd(new RPtr(assetNames), new RPtr(item))
.pour(promise);
}
// PublicKey
@ReactMethod
public final void publicKeyFromBech32(String bech32, Promise promise) {
Native.I.publicKeyFromBech32(bech32)
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void publicKeyToBech32(String pubPtr, Promise promise) {
Native.I
.publicKeyToBech32(new RPtr(pubPtr))
.pour(promise);
}
@ReactMethod
public final void publicKeyFromBytes(String bytes, Promise promise) {
Native.I
.publicKeyFromBytes(Base64.decode(bytes, Base64.DEFAULT))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void publicKeyAsBytes(String pubPtr, Promise promise) {
Native.I
.publicKeyAsBytes(new RPtr(pubPtr))
.map(bytes -> Base64.encodeToString(bytes, Base64.DEFAULT))
.pour(promise);
}
// @ReactMethod
// public final void publicKeyVerify(String pubPtr, String data, String signature, Promise promise) {
// Native.I
// .publicKeyVerify(new RPtr(pubPtr), Base64.decode(data, Base64.DEFAULT), new RPtr(signature))
// .pour(promise);
// }
@ReactMethod
public final void publicKeyHash(String pubPtr, Promise promise) {
Native.I
.publicKeyHash(new RPtr(pubPtr))
.map(RPtr::toJs)
.pour(promise);
}
// PrivateKey
@ReactMethod
public final void privateKeyToPublic(String prvPtr, Promise promise) {
Native.I
.privateKeyToPublic(new RPtr(prvPtr))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void privateKeyAsBytes(String prvPtr, Promise promise) {
Native.I
.privateKeyAsBytes(new RPtr(prvPtr))
.map(bytes -> Base64.encodeToString(bytes, Base64.DEFAULT))
.pour(promise);
}
@ReactMethod
public final void privateKeyFromExtendedBytes(String bytes, Promise promise) {
Native.I
.privateKeyFromExtendedBytes(Base64.decode(bytes, Base64.DEFAULT))
.map(RPtr::toJs)
.pour(promise);
}
// Bip32PublicKey
@ReactMethod
public final void bip32PublicKeyDerive(String bip32PublicKey, Double index, Promise promise) {
Native.I
.bip32PublicKeyDerive(new RPtr(bip32PublicKey), index.longValue())
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void bip32PublicKeyToRawKey(String bip32PublicKey, Promise promise) {
Native.I
.bip32PublicKeyToRawKey(new RPtr(bip32PublicKey))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void bip32PublicKeyFromBytes(String bytes, Promise promise) {
Native.I
.bip32PublicKeyFromBytes(Base64.decode(bytes, Base64.DEFAULT))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void bip32PublicKeyAsBytes(String bip32PublicKey, Promise promise) {
Native.I
.bip32PublicKeyAsBytes(new RPtr(bip32PublicKey))
.map(bytes -> Base64.encodeToString(bytes, Base64.DEFAULT))
.pour(promise);
}
@ReactMethod
public final void bip32PublicKeyFromBech32(String bech32Str, Promise promise) {
Native.I
.bip32PublicKeyFromBech32(bech32Str)
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void bip32PublicKeyToBech32(String bip32PublicKey, Promise promise) {
Native.I
.bip32PublicKeyToBech32(new RPtr(bip32PublicKey))
.pour(promise);
}
@ReactMethod
public final void bip32PublicKeyChaincode(String bip32PublicKey, Promise promise) {
Native.I
.bip32PublicKeyChaincode(new RPtr(bip32PublicKey))
.map(bytes -> Base64.encodeToString(bytes, Base64.DEFAULT))
.pour(promise);
}
// Bip32PrivateKey
@ReactMethod
public final void bip32PrivateKeyDerive(String bip32PrivateKey, Double index, Promise promise) {
Native.I
.bip32PrivateKeyDerive(new RPtr(bip32PrivateKey), index.longValue())
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void bip32PrivateKeyGenerateEd25519Bip32(Promise promise) {
Native.I
.bip32PrivateKeyGenerateEd25519Bip32()
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void bip32PrivateKeyToRawKey(String bip32PrivateKey, Promise promise) {
Native.I
.bip32PrivateKeyToRawKey(new RPtr(bip32PrivateKey))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void bip32PrivateKeyToPublic(String bip32PrivateKey, Promise promise) {
Native.I
.bip32PrivateKeyToPublic(new RPtr(bip32PrivateKey))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void bip32PrivateKeyFromBytes(String bytes, Promise promise) {
Native.I
.bip32PrivateKeyFromBytes(Base64.decode(bytes, Base64.DEFAULT))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void bip32PrivateKeyAsBytes(String bip32PrivateKey, Promise promise) {
Native.I
.bip32PrivateKeyAsBytes(new RPtr(bip32PrivateKey))
.map(bytes -> Base64.encodeToString(bytes, Base64.DEFAULT))
.pour(promise);
}
@ReactMethod
public final void bip32PrivateKeyFromBech32(String bech32Str, Promise promise) {
Native.I
.bip32PrivateKeyFromBech32(bech32Str)
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void bip32PrivateKeyToBech32(String bip32PrivateKey, Promise promise) {
Native.I
.bip32PrivateKeyToBech32(new RPtr(bip32PrivateKey))
.pour(promise);
}
@ReactMethod
public final void bip32PrivateKeyFromBip39Entropy(String entropy, String password, Promise promise) {
Native.I
.bip32PrivateKeyFromBip39Entropy(Base64.decode(entropy, Base64.DEFAULT), Base64.decode(password, Base64.DEFAULT))
.map(RPtr::toJs)
.pour(promise);
}
// ByronAddress
@ReactMethod
public final void byronAddressToBase58(String byronAddress, Promise promise) {
Native.I
.byronAddressToBase58(new RPtr(byronAddress))
.pour(promise);
}
@ReactMethod
public final void byronAddressFromBase58(String string, Promise promise) {
Native.I
.byronAddressFromBase58(string)
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void byronAddressIsValid(String string, Promise promise) {
Native.I
.byronAddressIsValid(string)
.pour(promise);
}
@ReactMethod
public final void byronAddressFromAddress(String address, Promise promise) {
Native.I
.byronAddressFromAddress(new RPtr(address))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void byronAddressToAddress(String byronAddress, Promise promise) {
Native.I
.byronAddressToAddress(new RPtr(byronAddress))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void byronAddressByronProtocolMagic(String byronAddress, Promise promise) {
Native.I
.byronAddressByronProtocolMagic(new RPtr(byronAddress))
.map(Long::intValue)
.pour(promise);
}
@ReactMethod
public final void byronAddressAttributes(String byronAddress, Promise promise) {
Native.I
.byronAddressAttributes(new RPtr(byronAddress))
.map(bytes -> Base64.encodeToString(bytes, Base64.DEFAULT))
.pour(promise);
}
// Address
@ReactMethod
public final void addressToBytes(String address, Promise promise) {
Native.I
.addressToBytes(new RPtr(address))
.map(bytes -> Base64.encodeToString(bytes, Base64.DEFAULT))
.pour(promise);
}
@ReactMethod
public final void addressFromBytes(String bytes, Promise promise) {
Native.I
.addressFromBytes(Base64.decode(bytes, Base64.DEFAULT))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void addressToBech32(String address, Promise promise) {
Native.I
.addressToBech32(new RPtr(address))
.pour(promise);
}
@ReactMethod
public final void addressToBech32WithPrefix(String address, String prefix, Promise promise) {
Native.I
.addressToBech32WithPrefix(new RPtr(address), prefix)
.pour(promise);
}
@ReactMethod
public final void addressFromBech32(String string, Promise promise) {
Native.I
.addressFromBech32(string)
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void addressNetworkId(String address, Promise promise) {
Native.I
.addressNetworkId(new RPtr(address))
.pour(promise);
}
// Ed25519Signature
@ReactMethod
public final void ed25519SignatureToBytes(String ed25519Signature, Promise promise) {
Native.I
.ed25519SignatureToBytes(new RPtr(ed25519Signature))
.map(bytes -> Base64.encodeToString(bytes, Base64.DEFAULT))
.pour(promise);
}
@ReactMethod
public final void ed25519SignatureFromBytes(String bytes, Promise promise) {
Native.I
.ed25519SignatureFromBytes(Base64.decode(bytes, Base64.DEFAULT))
.map(RPtr::toJs)
.pour(promise);
}
// Ed25519KeyHash
@ReactMethod
public final void ed25519KeyHashToBytes(String ed25519KeyHash, Promise promise) {
Native.I
.ed25519KeyHashToBytes(new RPtr(ed25519KeyHash))
.map(bytes -> Base64.encodeToString(bytes, Base64.DEFAULT))
.pour(promise);
}
@ReactMethod
public final void ed25519KeyHashFromBytes(String bytes, Promise promise) {
Native.I
.ed25519KeyHashFromBytes(Base64.decode(bytes, Base64.DEFAULT))
.map(RPtr::toJs)
.pour(promise);
}
// ScriptHash
@ReactMethod
public final void scriptHashToBytes(String scriptHash, Promise promise) {
Native.I
.scriptHashToBytes(new RPtr(scriptHash))
.map(bytes -> Base64.encodeToString(bytes, Base64.DEFAULT))
.pour(promise);
}
@ReactMethod
public final void scriptHashFromBytes(String bytes, Promise promise) {
Native.I
.scriptHashFromBytes(Base64.decode(bytes, Base64.DEFAULT))
.map(RPtr::toJs)
.pour(promise);
}
// ScriptHashes
@ReactMethod
public final void scriptHashesToBytes(String scriptHashes, Promise promise) {
Native.I
.scriptHashesToBytes(new RPtr(scriptHashes))
.map(bytes -> Base64.encodeToString(bytes, Base64.DEFAULT))
.pour(promise);
}
@ReactMethod
public final void scriptHashesFromBytes(String bytes, Promise promise) {
Native.I
.scriptHashesFromBytes(Base64.decode(bytes, Base64.DEFAULT))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void scriptHashesNew(Promise promise) {
Native.I
.scriptHashesNew()
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void scriptHashesLen(String scriptHashes, Promise promise) {
Native.I
.scriptHashesLen(new RPtr(scriptHashes))
.map(Long::intValue)
.pour(promise);
}
@ReactMethod
public final void scriptHashesGet(String scriptHashes, Integer index, Promise promise) {
Native.I
.scriptHashesGet(new RPtr(scriptHashes), index)
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void scriptHashesAdd(String scriptHashes, String item, Promise promise) {
Native.I
.scriptHashesAdd(new RPtr(scriptHashes), new RPtr(item))
.pour(promise);
}
// Assets
@ReactMethod
public final void assetsNew(Promise promise) {
Native.I
.assetsNew()
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void assetsLen(String assets, Promise promise) {
Native.I
.assetsLen(new RPtr(assets))
.map(Long::intValue)
.pour(promise);
}
@ReactMethod
public final void assetsInsert(String assets, String key, String value, Promise promise) {
Native.I
.assetsInsert(new RPtr(assets), new RPtr(key), new RPtr(value))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void assetsGet(String assets, String key, Promise promise) {
Native.I
.assetsGet(new RPtr(assets), new RPtr(key))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void assetsKeys(String assets, Promise promise) {
Native.I
.assetsKeys(new RPtr(assets))
.map(RPtr::toJs)
.pour(promise);
}
// MultiAsset
@ReactMethod
public final void multiAssetNew(Promise promise) {
Native.I
.multiAssetNew()
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void multiAssetLen(String multiAsset, Promise promise) {
Native.I
.multiAssetLen(new RPtr(multiAsset))
.map(Long::intValue)
.pour(promise);
}
@ReactMethod
public final void multiAssetInsert(String multiAsset, String key, String value, Promise promise) {
Native.I
.multiAssetInsert(new RPtr(multiAsset), new RPtr(key), new RPtr(value))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void multiAssetGet(String multiAsset, String key, Promise promise) {
Native.I
.multiAssetGet(new RPtr(multiAsset), new RPtr(key))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void multiAssetKeys(String multiAsset, Promise promise) {
Native.I
.multiAssetKeys(new RPtr(multiAsset))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void multiAssetSub(String multiAsset, String other, Promise promise) {
Native.I
.multiAssetSub(new RPtr(multiAsset), new RPtr(other))
.map(RPtr::toJs)
.pour(promise);
}
// TransactionHash
@ReactMethod
public final void transactionHashToBytes(String transactionHash, Promise promise) {
Native.I
.transactionHashToBytes(new RPtr(transactionHash))
.map(bytes -> Base64.encodeToString(bytes, Base64.DEFAULT))
.pour(promise);
}
@ReactMethod
public final void transactionHashFromBytes(String bytes, Promise promise) {
Native.I
.transactionHashFromBytes(Base64.decode(bytes, Base64.DEFAULT))
.map(RPtr::toJs)
.pour(promise);
}
// StakeCredential
@ReactMethod
public final void stakeCredentialFromKeyHash(String keyHash, Promise promise) {
Native.I
.stakeCredentialFromKeyHash(new RPtr(keyHash))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void stakeCredentialFromScriptHash(String scriptHash, Promise promise) {
Native.I
.stakeCredentialFromScriptHash(new RPtr(scriptHash))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void stakeCredentialToKeyHash(String stakeCredential, Promise promise) {
Native.I
.stakeCredentialToKeyHash(new RPtr(stakeCredential))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void stakeCredentialToScriptHash(String stakeCredential, Promise promise) {
Native.I
.stakeCredentialToScriptHash(new RPtr(stakeCredential))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void stakeCredentialKind(String stakeCredential, Promise promise) {
Native.I
.stakeCredentialKind(new RPtr(stakeCredential))
.pour(promise);
}
@ReactMethod
public final void stakeCredentialToBytes(String stakeCredential, Promise promise) {
Native.I
.stakeCredentialToBytes(new RPtr(stakeCredential))
.map(bytes -> Base64.encodeToString(bytes, Base64.DEFAULT))
.pour(promise);
}
@ReactMethod
public final void stakeCredentialFromBytes(String bytes, Promise promise) {
Native.I
.stakeCredentialFromBytes(Base64.decode(bytes, Base64.DEFAULT))
.map(RPtr::toJs)
.pour(promise);
}
// StakeRegistration
@ReactMethod
public final void stakeRegistrationNew(String stakeCredential, Promise promise) {
Native.I
.stakeRegistrationNew(new RPtr(stakeCredential))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void stakeRegistrationStakeCredential(String stakeRegistration, Promise promise) {
Native.I
.stakeRegistrationStakeCredential(new RPtr(stakeRegistration))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void stakeRegistrationToBytes(String stakeRegistration, Promise promise) {
Native.I
.stakeRegistrationToBytes(new RPtr(stakeRegistration))
.map(bytes -> Base64.encodeToString(bytes, Base64.DEFAULT))
.pour(promise);
}
@ReactMethod
public final void stakeRegistrationFromBytes(String bytes, Promise promise) {
Native.I
.stakeRegistrationFromBytes(Base64.decode(bytes, Base64.DEFAULT))
.map(RPtr::toJs)
.pour(promise);
}
// StakeDeregistration
@ReactMethod
public final void stakeDeregistrationNew(String stakeCredential, Promise promise) {
Native.I
.stakeDeregistrationNew(new RPtr(stakeCredential))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void stakeDeregistrationStakeCredential(String stakeDeregistration, Promise promise) {
Native.I
.stakeDeregistrationStakeCredential(new RPtr(stakeDeregistration))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void stakeDeregistrationToBytes(String stakeDeregistration, Promise promise) {
Native.I
.stakeDeregistrationToBytes(new RPtr(stakeDeregistration))
.map(bytes -> Base64.encodeToString(bytes, Base64.DEFAULT))
.pour(promise);
}
@ReactMethod
public final void stakeDeregistrationFromBytes(String bytes, Promise promise) {
Native.I
.stakeDeregistrationFromBytes(Base64.decode(bytes, Base64.DEFAULT))
.map(RPtr::toJs)
.pour(promise);
}
// StakeDelegation
@ReactMethod
public final void stakeDelegationNew(String stakeCredential, String poolKeyhash, Promise promise) {
Native.I
.stakeDelegationNew(new RPtr(stakeCredential), new RPtr(poolKeyhash))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void stakeDelegationStakeCredential(String stakeDelegation, Promise promise) {
Native.I
.stakeDelegationStakeCredential(new RPtr(stakeDelegation))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void stakeDelegationPoolKeyhash(String poolKeyHash, Promise promise) {
Native.I
.stakeDelegationPoolKeyhash(new RPtr(poolKeyHash))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void stakeDelegationToBytes(String stakeDelegation, Promise promise) {
Native.I
.stakeDelegationToBytes(new RPtr(stakeDelegation))
.map(bytes -> Base64.encodeToString(bytes, Base64.DEFAULT))
.pour(promise);
}
@ReactMethod
public final void stakeDelegationFromBytes(String bytes, Promise promise) {
Native.I
.stakeDelegationFromBytes(Base64.decode(bytes, Base64.DEFAULT))
.map(RPtr::toJs)
.pour(promise);
}
// Certificate
@ReactMethod
public final void certificateNewStakeRegistration(String stakeRegistration, Promise promise) {
Native.I
.certificateNewStakeRegistration(new RPtr(stakeRegistration))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void certificateNewStakeDeregistration(String stakeDeregistration, Promise promise) {
Native.I
.certificateNewStakeDeregistration(new RPtr(stakeDeregistration))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void certificateNewStakeDelegation(String stakeDelegation, Promise promise) {
Native.I
.certificateNewStakeDelegation(new RPtr(stakeDelegation))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void certificateAsStakeRegistration(String certificate, Promise promise) {
Native.I
.certificateAsStakeRegistration(new RPtr(certificate))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void certificateAsStakeDeregistration(String certificate, Promise promise) {
Native.I
.certificateAsStakeDeregistration(new RPtr(certificate))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void certificateAsStakeDelegation(String certificate, Promise promise) {
Native.I
.certificateAsStakeDelegation(new RPtr(certificate))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void certificateToBytes(String certificate, Promise promise) {
Native.I
.certificateToBytes(new RPtr(certificate))
.map(bytes -> Base64.encodeToString(bytes, Base64.DEFAULT))
.pour(promise);
}
@ReactMethod
public final void certificateFromBytes(String bytes, Promise promise) {
Native.I
.certificateFromBytes(Base64.decode(bytes, Base64.DEFAULT))
.map(RPtr::toJs)
.pour(promise);
}
// Certificates
@ReactMethod
public final void certificatesToBytes(String certificates, Promise promise) {
Native.I
.certificatesToBytes(new RPtr(certificates))
.map(bytes -> Base64.encodeToString(bytes, Base64.DEFAULT))
.pour(promise);
}
@ReactMethod
public final void certificatesFromBytes(String bytes, Promise promise) {
Native.I
.certificatesFromBytes(Base64.decode(bytes, Base64.DEFAULT))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void certificatesNew(Promise promise) {
Native.I
.certificatesNew()
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void certificatesLen(String certificates, Promise promise) {
Native.I
.certificatesLen(new RPtr(certificates))
.map(Long::intValue)
.pour(promise);
}
@ReactMethod
public final void certificatesGet(String certificates, Integer index, Promise promise) {
Native.I
.certificatesGet(new RPtr(certificates), index)
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void certificatesAdd(String certificates, String item, Promise promise) {
Native.I
.certificatesAdd(new RPtr(certificates), new RPtr(item))
.pour(promise);
}
// BaseAddress
@ReactMethod
public final void baseAddressNew(Integer network, String payment, String stake, Promise promise) {
Native.I
.baseAddressNew(network, new RPtr(payment), new RPtr(stake))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void baseAddressPaymentCred(String baseAddress, Promise promise) {
Native.I
.baseAddressPaymentCred(new RPtr(baseAddress))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void baseAddressStakeCred(String baseAddress, Promise promise) {
Native.I
.baseAddressStakeCred(new RPtr(baseAddress))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void baseAddressToAddress(String baseAddress, Promise promise) {
Native.I
.baseAddressToAddress(new RPtr(baseAddress))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void baseAddressFromAddress(String address, Promise promise) {
Native.I
.baseAddressFromAddress(new RPtr(address))
.map(RPtr::toJs)
.pour(promise);
}
// RewardAddress
@ReactMethod
public final void rewardAddressNew(Integer network, String payment, Promise promise) {
Native.I
.rewardAddressNew(network, new RPtr(payment))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void rewardAddressPaymentCred(String rewardAddress, Promise promise) {
Native.I
.rewardAddressPaymentCred(new RPtr(rewardAddress))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void rewardAddressToAddress(String rewardAddress, Promise promise) {
Native.I
.rewardAddressToAddress(new RPtr(rewardAddress))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void rewardAddressFromAddress(String address, Promise promise) {
Native.I
.rewardAddressFromAddress(new RPtr(address))
.map(RPtr::toJs)
.pour(promise);
}
// RewardAddresses
@ReactMethod
public final void rewardAddressesNew(Promise promise) {
Native.I
.rewardAddressesNew()
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void rewardAddressesLen(String rewardAddresses, Promise promise) {
Native.I
.rewardAddressesLen(new RPtr(rewardAddresses))
.map(Long::intValue)
.pour(promise);
}
@ReactMethod
public final void rewardAddressesGet(String rewardAddresses, Integer index, Promise promise) {
Native.I
.rewardAddressesGet(new RPtr(rewardAddresses), index)
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void rewardAddressesAdd(String rewardAddresses, String item, Promise promise) {
Native.I
.rewardAddressesAdd(new RPtr(rewardAddresses), new RPtr(item))
.pour(promise);
}
// UnitInterval
@ReactMethod
public final void unitIntervalToBytes(String unitInterval, Promise promise) {
Native.I
.unitIntervalToBytes(new RPtr(unitInterval))
.map(bytes -> Base64.encodeToString(bytes, Base64.DEFAULT))
.pour(promise);
}
@ReactMethod
public final void unitIntervalFromBytes(String bytes, Promise promise) {
Native.I
.unitIntervalFromBytes(Base64.decode(bytes, Base64.DEFAULT))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void unitIntervalNew(String numerator, String denominator, Promise promise) {
Native.I
.unitIntervalNew(new RPtr(numerator), new RPtr(denominator))
.map(RPtr::toJs)
.pour(promise);
}
// TransactionInput
@ReactMethod
public final void transactionInputToBytes(String transactionInput, Promise promise) {
Native.I
.transactionInputToBytes(new RPtr(transactionInput))
.map(bytes -> Base64.encodeToString(bytes, Base64.DEFAULT))
.pour(promise);
}
@ReactMethod
public final void transactionInputFromBytes(String bytes, Promise promise) {
Native.I
.transactionInputFromBytes(Base64.decode(bytes, Base64.DEFAULT))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void transactionInputTransactionId(String transactionInput, Promise promise) {
Native.I
.transactionInputTransactionId(new RPtr(transactionInput))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void transactionInputIndex(String transactionInput, Promise promise) {
Native.I
.transactionInputIndex(new RPtr(transactionInput))
.map(Long::intValue)
.pour(promise);
}
@ReactMethod
public final void transactionInputNew(String transactionId, Double index, Promise promise) {
Native.I
.transactionInputNew(new RPtr(transactionId), index.longValue())
.map(RPtr::toJs)
.pour(promise);
}
// TransactionInputs
@ReactMethod
public final void transactionInputsLen(String transactionInputs, Promise promise) {
Native.I
.transactionInputsLen(new RPtr(transactionInputs))
.map(Long::intValue)
.pour(promise);
}
@ReactMethod
public final void transactionInputsGet(String transactionInputs, Integer index, Promise promise) {
Native.I
.transactionInputsGet(new RPtr(transactionInputs), index)
.map(RPtr::toJs)
.pour(promise);
}
// TransactionOutput
@ReactMethod
public final void transactionOutputToBytes(String transactionOutput, Promise promise) {
Native.I
.transactionOutputToBytes(new RPtr(transactionOutput))
.map(bytes -> Base64.encodeToString(bytes, Base64.DEFAULT))
.pour(promise);
}
@ReactMethod
public final void transactionOutputFromBytes(String bytes, Promise promise) {
Native.I
.transactionOutputFromBytes(Base64.decode(bytes, Base64.DEFAULT))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void transactionOutputNew(String address, String amount, Promise promise) {
Native.I
.transactionOutputNew(new RPtr(address), new RPtr(amount))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void transactionOutputAmount(String transactionOutput, Promise promise) {
Native.I
.transactionOutputAmount(new RPtr(transactionOutput))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void transactionOutputAddress(String transactionOutput, Promise promise) {
Native.I
.transactionOutputAddress(new RPtr(transactionOutput))
.map(RPtr::toJs)
.pour(promise);
}
// TransactionOutputs
@ReactMethod
public final void transactionOutputsLen(String transactionOutputs, Promise promise) {
Native.I
.transactionOutputsLen(new RPtr(transactionOutputs))
.map(Long::intValue)
.pour(promise);
}
@ReactMethod
public final void transactionOutputsGet(String transactionOutputs, Integer index, Promise promise) {
Native.I
.transactionOutputsGet(new RPtr(transactionOutputs), index)
.map(RPtr::toJs)
.pour(promise);
}
// LinearFee
@ReactMethod
public final void linearFeeCoefficient(String linearFee, Promise promise) {
Native.I
.linearFeeCoefficient(new RPtr(linearFee))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void linearFeeConstant(String linearFee, Promise promise) {
Native.I
.linearFeeConstant(new RPtr(linearFee))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void linearFeeNew(String coefficient, String constant, Promise promise) {
Native.I
.linearFeeNew(new RPtr(coefficient), new RPtr(constant))
.map(RPtr::toJs)
.pour(promise);
}
// Vkey
@ReactMethod
public final void vkeyNew(String publicKey, Promise promise) {
Native.I
.vkeyNew(new RPtr(publicKey))
.map(RPtr::toJs)
.pour(promise);
}
// Vkeywitness
@ReactMethod
public final void vkeywitnessToBytes(String vkeywitness, Promise promise) {
Native.I
.vkeywitnessToBytes(new RPtr(vkeywitness))
.map(bytes -> Base64.encodeToString(bytes, Base64.DEFAULT))
.pour(promise);
}
@ReactMethod
public final void vkeywitnessFromBytes(String bytes, Promise promise) {
Native.I
.vkeywitnessFromBytes(Base64.decode(bytes, Base64.DEFAULT))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void vkeywitnessNew(String vkey, String signature, Promise promise) {
Native.I
.vkeywitnessNew(new RPtr(vkey), new RPtr(signature))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void vkeywitnessSignature(String vkeywitness, Promise promise) {
Native.I
.vkeywitnessSignature(new RPtr(vkeywitness))
.map(RPtr::toJs)
.pour(promise);
}
// Vkeywitnesses
@ReactMethod
public final void vkeywitnessesNew(Promise promise) {
Native.I
.vkeywitnessesNew()
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void vkeywitnessesLen(String vkeywitnesses, Promise promise) {
Native.I
.vkeywitnessesLen(new RPtr(vkeywitnesses))
.map(Long::intValue)
.pour(promise);
}
@ReactMethod
public final void vkeywitnessesAdd(String vkeywitnesses, String item, Promise promise) {
Native.I
.vkeywitnessesAdd(new RPtr(vkeywitnesses), new RPtr(item))
.pour(promise);
}
// BootstrapWitness
@ReactMethod
public final void bootstrapWitnessToBytes(String bootstrapWitness, Promise promise) {
Native.I
.bootstrapWitnessToBytes(new RPtr(bootstrapWitness))
.map(bytes -> Base64.encodeToString(bytes, Base64.DEFAULT))
.pour(promise);
}
@ReactMethod
public final void bootstrapWitnessFromBytes(String bytes, Promise promise) {
Native.I
.bootstrapWitnessFromBytes(Base64.decode(bytes, Base64.DEFAULT))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void bootstrapWitnessNew(String vkey, String signature, String chainCode, String attributes, Promise promise) {
Native.I
.bootstrapWitnessNew(new RPtr(vkey), new RPtr(signature), Base64.decode(chainCode, Base64.DEFAULT), Base64.decode(attributes, Base64.DEFAULT))
.map(RPtr::toJs)
.pour(promise);
}
// BootstrapWitnesses
@ReactMethod
public final void bootstrapWitnessesNew(Promise promise) {
Native.I
.bootstrapWitnessesNew()
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void bootstrapWitnessesLen(String witnesses, Promise promise) {
Native.I
.bootstrapWitnessesLen(new RPtr(witnesses))
.map(Long::intValue)
.pour(promise);
}
@ReactMethod
public final void bootstrapWitnessesAdd(String witnesses, String item, Promise promise) {
Native.I
.bootstrapWitnessesAdd(new RPtr(witnesses), new RPtr(item))
.pour(promise);
}
// TransactionWitnessSet
@ReactMethod
public final void transactionWitnessSetNew(Promise promise) {
Native.I
.transactionWitnessSetNew()
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void transactionWitnessSetSetVkeys(String witnessSet, String vkeys, Promise promise) {
Native.I
.transactionWitnessSetSetVkeys(new RPtr(witnessSet), new RPtr(vkeys))
.pour(promise);
}
@ReactMethod
public final void transactionWitnessSetSetBootstraps(String witnessSet, String bootstraps, Promise promise) {
Native.I
.transactionWitnessSetSetBootstraps(new RPtr(witnessSet), new RPtr(bootstraps))
.pour(promise);
}
// TransactionBody
@ReactMethod
public final void transactionBodyToBytes(String transactionBody, Promise promise) {
Native.I
.transactionBodyToBytes(new RPtr(transactionBody))
.map(bytes -> Base64.encodeToString(bytes, Base64.DEFAULT))
.pour(promise);
}
@ReactMethod
public final void transactionBodyFromBytes(String bytes, Promise promise) {
Native.I
.transactionBodyFromBytes(Base64.decode(bytes, Base64.DEFAULT))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void transactionBodyOutputs(String txBody, Promise promise) {
Native.I
.transactionBodyOutputs(new RPtr(txBody))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void transactionBodyInputs(String txBody, Promise promise) {
Native.I
.transactionBodyInputs(new RPtr(txBody))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void transactionBodyFee(String txBody, Promise promise) {
Native.I
.transactionBodyFee(new RPtr(txBody))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void transactionBodyTtl(String txBody, Promise promise) {
Native.I
.transactionBodyTtl(new RPtr(txBody))
.map(Long::intValue)
.pour(promise);
}
@ReactMethod
public final void transactionBodyCerts(String txBody, Promise promise) {
Native.I
.transactionBodyCerts(new RPtr(txBody))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void transactionBodyWithdrawals(String txBody, Promise promise) {
Native.I
.transactionBodyWithdrawals(new RPtr(txBody))
.map(RPtr::toJs)
.pour(promise);
}
// Transaction
@ReactMethod
public final void transactionBody(String tx, Promise promise) {
Native.I
.transactionBody(new RPtr(tx))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void transactionNew(String body, String witnessSet, Promise promise) {
Native.I
.transactionNew(new RPtr(body), new RPtr(witnessSet))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void transactionToBytes(String transaction, Promise promise) {
Native.I
.transactionToBytes(new RPtr(transaction))
.map(bytes -> Base64.encodeToString(bytes, Base64.DEFAULT))
.pour(promise);
}
@ReactMethod
public final void transactionFromBytes(String bytes, Promise promise) {
Native.I
.transactionFromBytes(Base64.decode(bytes, Base64.DEFAULT))
.map(RPtr::toJs)
.pour(promise);
}
// TransactionBuilder
@ReactMethod
public final void transactionBuilderAddKeyInput(String txBuilder, String hash, String input, String amount, Promise promise) {
Native.I
.transactionBuilderAddKeyInput(new RPtr(txBuilder), new RPtr(hash), new RPtr(input), new RPtr(amount))
.pour(promise);
}
@ReactMethod
public final void transactionBuilderAddScriptInput(String txBuilder, String hash, String input, String amount, Promise promise) {
Native.I
.transactionBuilderAddScriptInput(new RPtr(txBuilder), new RPtr(hash), new RPtr(input), new RPtr(amount))
.pour(promise);
}
@ReactMethod
public final void transactionBuilderAddBootstrapInput(String txBuilder, String hash, String input, String amount, Promise promise) {
Native.I
.transactionBuilderAddBootstrapInput(new RPtr(txBuilder), new RPtr(hash), new RPtr(input), new RPtr(amount))
.pour(promise);
}
@ReactMethod
public final void transactionBuilderAddInput(String txBuilder, String address, String input, String amount, Promise promise) {
Native.I
.transactionBuilderAddInput(new RPtr(txBuilder), new RPtr(address), new RPtr(input), new RPtr(amount))
.pour(promise);
}
@ReactMethod
public final void transactionBuilderFeeForInput(String txBuilder, String address, String input, String amount, Promise promise) {
Native.I
.transactionBuilderFeeForInput(new RPtr(txBuilder), new RPtr(address), new RPtr(input), new RPtr(amount))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void transactionBuilderAddOutput(String txBuilder, String output, Promise promise) {
Native.I
.transactionBuilderAddOutput(new RPtr(txBuilder), new RPtr(output))
.pour(promise);
}
@ReactMethod
public final void transactionBuilderFeeForOutput(String txBuilder, String output, Promise promise) {
Native.I
.transactionBuilderFeeForOutput(new RPtr(txBuilder), new RPtr(output))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void transactionBuilderSetFee(String txBuilder, String fee, Promise promise) {
Native.I
.transactionBuilderSetFee(new RPtr(txBuilder), new RPtr(fee))
.pour(promise);
}
@ReactMethod
public final void transactionBuilderSetTtl(String txBuilder, Double ttl, Promise promise) {
Native.I
.transactionBuilderSetTtl(new RPtr(txBuilder), ttl.longValue())
.pour(promise);
}
@ReactMethod
public final void transactionBuilderSetValidityStartInterval(String txBuilder, Double vsi, Promise promise) {
Native.I
.transactionBuilderSetValidityStartInterval(new RPtr(txBuilder), vsi.longValue())
.pour(promise);
}
@ReactMethod
public final void transactionBuilderSetCerts(String txBuilder, String certs, Promise promise) {
Native.I
.transactionBuilderSetCerts(new RPtr(txBuilder), new RPtr(certs))
.pour(promise);
}
@ReactMethod
public final void transactionBuilderSetWithdrawals(String txBuilder, String withdrawals, Promise promise) {
Native.I
.transactionBuilderSetWithdrawals(new RPtr(txBuilder), new RPtr(withdrawals))
.pour(promise);
}
@ReactMethod
public final void transactionBuilderSetMetadata(String txBuilder, String metadata, Promise promise) {
Native.I
.transactionBuilderSetMetadata(new RPtr(txBuilder), new RPtr(metadata))
.pour(promise);
}
@ReactMethod
public final void transactionBuilderNew(String linearFee, String minimumUtxoVal, String poolDeposit, String keyDeposit, Promise promise) {
Native.I
.transactionBuilderNew(new RPtr(linearFee), new RPtr(minimumUtxoVal), new RPtr(poolDeposit), new RPtr(keyDeposit))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void transactionBuilderGetExplicitInput(String txBuilder, Promise promise) {
Native.I
.transactionBuilderGetExplicitInput(new RPtr(txBuilder))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void transactionBuilderGetImplicitInput(String txBuilder, Promise promise) {
Native.I
.transactionBuilderGetImplicitInput(new RPtr(txBuilder))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void transactionBuilderGetExplicitOutput(String txBuilder, Promise promise) {
Native.I
.transactionBuilderGetExplicitOutput(new RPtr(txBuilder))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void transactionBuilderGetDeposit(String txBuilder, Promise promise) {
Native.I
.transactionBuilderGetDeposit(new RPtr(txBuilder))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void transactionBuilderGetFeeIfSet(String txBuilder, Promise promise) {
Native.I
.transactionBuilderGetFeeIfSet(new RPtr(txBuilder))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void transactionBuilderAddChangeIfNeeded(String txBuilder, String address, Promise promise) {
Native.I
.transactionBuilderAddChangeIfNeeded(new RPtr(txBuilder), new RPtr(address))
.pour(promise);
}
@ReactMethod
public final void transactionBuilderBuild(String txBuilder, Promise promise) {
Native.I
.transactionBuilderBuild(new RPtr(txBuilder))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void transactionBuilderMinFee(String txBuilder, Promise promise) {
Native.I
.transactionBuilderMinFee(new RPtr(txBuilder))
.map(RPtr::toJs)
.pour(promise);
}
// Withdrawals
@ReactMethod
public final void withdrawalsNew(Promise promise) {
Native.I
.withdrawalsNew()
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void withdrawalsLen(String withdrawals, Promise promise) {
Native.I
.withdrawalsLen(new RPtr(withdrawals))
.map(Long::intValue)
.pour(promise);
}
@ReactMethod
public final void withdrawalsInsert(String withdrawals, String key, String value, Promise promise) {
Native.I
.withdrawalsInsert(new RPtr(withdrawals), new RPtr(key), new RPtr(value))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void withdrawalsGet(String withdrawals, String key, Promise promise) {
Native.I
.withdrawalsGet(new RPtr(withdrawals), new RPtr(key))
.map(RPtr::toJs)
.pour(promise);
}
@ReactMethod
public final void withdrawalsKeys(String withdrawals, Promise promise) {
Native.I
.withdrawalsKeys(new RPtr(withdrawals))
.map(RPtr::toJs)
.pour(promise);
}
//
@ReactMethod
public final void legacyDaedalusPrivateKeyFromBytes(String bytes, Promise promise) {
Native.I
.legacyDaedalusPrivateKeyFromBytes(Base64.decode(bytes, Base64.DEFAULT))
.map(RPtr::toJs)
.pour(promise);
}
}
|
3e02a3ad28069fa45f2df228e91c82befd2f9962 | 212 | java | Java | recyclerdatagrid/src/main/java/io/github/andres_vasquez/recyclerdatagrid/models/interfaces/FillDataInterface.java | andres-vasquez/RecyclerDataGrid | b672d100b0103f69b610373252b84c299c7e0ae5 | [
"Apache-2.0"
]
| 1 | 2017-04-03T23:29:38.000Z | 2017-04-03T23:29:38.000Z | recyclerdatagrid/src/main/java/io/github/andres_vasquez/recyclerdatagrid/models/interfaces/FillDataInterface.java | andres-vasquez/RecyclerDataGrid | b672d100b0103f69b610373252b84c299c7e0ae5 | [
"Apache-2.0"
]
| 1 | 2017-04-24T14:39:15.000Z | 2017-04-24T18:55:05.000Z | recyclerdatagrid/src/main/java/io/github/andres_vasquez/recyclerdatagrid/models/interfaces/FillDataInterface.java | andres-vasquez/RecyclerDataGrid | b672d100b0103f69b610373252b84c299c7e0ae5 | [
"Apache-2.0"
]
| null | null | null | 21.2 | 68 | 0.778302 | 1,082 | package io.github.andres_vasquez.recyclerdatagrid.models.interfaces;
/**
* Created by andresvasquez on 10/2/17.
*/
public interface FillDataInterface {
public void onItemAdded(Object uniqueIdentifier);
}
|
3e02a41179c965c4e6783609c5a2863fab3b52c7 | 751 | java | Java | litho-intellij-plugin/testdata/processor/PropDefaultExtractionWithField.java | conca/litho | 26061bae949dbae11f3a9c4a5282356b843b0609 | [
"Apache-2.0"
]
| 7,886 | 2017-04-18T19:27:19.000Z | 2022-03-29T13:18:19.000Z | litho-intellij-plugin/testdata/processor/PropDefaultExtractionWithField.java | conca/litho | 26061bae949dbae11f3a9c4a5282356b843b0609 | [
"Apache-2.0"
]
| 667 | 2017-04-18T20:43:18.000Z | 2022-03-28T15:21:43.000Z | litho-intellij-plugin/testdata/processor/PropDefaultExtractionWithField.java | conca/litho | 26061bae949dbae11f3a9c4a5282356b843b0609 | [
"Apache-2.0"
]
| 824 | 2017-04-18T19:56:51.000Z | 2022-03-25T07:17:34.000Z | 37.55 | 89 | 0.748336 | 1,083 | /*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* 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.
*/
class PropDefaultExtractionWithField {
@com.facebook.litho.annotations.PropDefault static final String title = "PROP_DEFAULT";
}
|
3e02a44f03fd1f92bda242d662acbf8525950357 | 21,510 | java | Java | environmentcleanup/src/main/java/com/axway/ats/environment/database/MariaDbEnvironmentHandler.java | Axway/ats-framework | 8463fcaac3b288182c208f933888ecbb95048b23 | [
"Apache-2.0"
]
| 33 | 2017-03-08T13:23:21.000Z | 2021-12-01T08:29:15.000Z | environmentcleanup/src/main/java/com/axway/ats/environment/database/MariaDbEnvironmentHandler.java | Axway/ats-framework | 8463fcaac3b288182c208f933888ecbb95048b23 | [
"Apache-2.0"
]
| 20 | 2017-04-04T11:23:54.000Z | 2021-09-30T15:20:45.000Z | environmentcleanup/src/main/java/com/axway/ats/environment/database/MariaDbEnvironmentHandler.java | Axway/ats-framework | 8463fcaac3b288182c208f933888ecbb95048b23 | [
"Apache-2.0"
]
| 61 | 2017-04-05T14:23:22.000Z | 2021-09-28T14:33:36.000Z | 44.442149 | 139 | 0.565086 | 1,084 | /*
* Copyright 2021 Axway Software
*
* 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.axway.ats.environment.database;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.Writer;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import org.apache.log4j.Logger;
import com.axway.ats.common.systemproperties.AtsSystemProperties;
import com.axway.ats.core.dbaccess.ColumnDescription;
import com.axway.ats.core.dbaccess.ConnectionPool;
import com.axway.ats.core.dbaccess.DbRecordValue;
import com.axway.ats.core.dbaccess.DbRecordValuesList;
import com.axway.ats.core.dbaccess.DbUtils;
import com.axway.ats.core.dbaccess.exceptions.DbException;
import com.axway.ats.core.dbaccess.mariadb.DbConnMariaDB;
import com.axway.ats.core.dbaccess.mariadb.MariaDbColumnDescription;
import com.axway.ats.core.dbaccess.mariadb.MariaDbDbProvider;
import com.axway.ats.core.utils.IoUtils;
import com.axway.ats.core.utils.StringUtils;
import com.axway.ats.environment.database.exceptions.ColumnHasNoDefaultValueException;
import com.axway.ats.environment.database.exceptions.DatabaseEnvironmentCleanupException;
import com.axway.ats.environment.database.model.DbTable;
/**
* MariaDB implementation of the environment handler
*/
class MariaDbEnvironmentHandler extends AbstractEnvironmentHandler {
private static final Logger log = Logger.getLogger(MariaDbEnvironmentHandler.class);
private static final String HEX_PREFIX_STR = "0x";
/**
* Constructor
*
* @param dbConnection the database connection
*/
MariaDbEnvironmentHandler( DbConnMariaDB dbConnection,
MariaDbDbProvider dbProvider ) {
super(dbConnection, dbProvider);
}
public void restore( String backupFileName ) throws DatabaseEnvironmentCleanupException {
BufferedReader backupReader = null;
Connection connection = null;
//we need to preserve the auto commit option, as
//the connections are pooled
boolean isAutoCommit = true;
try {
log.info("Started restore of database backup from file '" + backupFileName + "'");
backupReader = new BufferedReader(new FileReader(new File(backupFileName)));
connection = ConnectionPool.getConnection(dbConnection);
isAutoCommit = connection.getAutoCommit();
connection.setAutoCommit(false);
StringBuilder sql = new StringBuilder();
String line = backupReader.readLine();
while (line != null) {
sql.append(line);
if (line.startsWith(DROP_TABLE_MARKER)) {
String table = line.substring(DROP_TABLE_MARKER.length()).trim();
String owner = table.substring(0, table.indexOf("."));
String simpleTableName = table.substring(table.indexOf(".") + 1);
dropAndRecreateTable(connection, simpleTableName, owner);
}
if (line.endsWith(EOL_MARKER)) {
PreparedStatement updateStatement = null;
// remove the OEL marker
sql.delete(sql.length() - EOL_MARKER.length(), sql.length());
if (sql.toString().trim().startsWith("INSERT INTO")) {
// This line escapes non-printable string chars. Hex data is already escaped as 0xABC without backslash(\)
String insertQuery = sql.toString().replace("\\0x", "\\");
updateStatement = connection.prepareStatement(insertQuery);
} else {
updateStatement = connection.prepareStatement(sql.toString());
}
//catch the exception and roll back, otherwise we are locked
try {
updateStatement.execute();
} catch (SQLException sqle) {
//we have to roll back the transaction and re throw the exception
connection.rollback();
throw new SQLException("Error invoking restore satement: " + sql.toString(), sqle);
} finally {
try {
updateStatement.close();
} catch (SQLException sqle) {
log.error("Unable to close prepared statement", sqle);
}
}
sql.delete(0, sql.length());
} else {
//add a new line
//FIXME: this code will add the system line ending - it
//is not guaranteed that this was the actual line ending
sql.append(AtsSystemProperties.SYSTEM_LINE_SEPARATOR);
}
line = backupReader.readLine();
}
try {
//commit the transaction
connection.commit();
} catch (SQLException sqle) {
//we have to roll back the transaction and re throw the exception
connection.rollback();
throw sqle;
}
log.info("Completed restore of database backup from file '" + backupFileName + "'");
} catch (IOException ioe) {
throw new DatabaseEnvironmentCleanupException("Could not restore backup from file "
+ backupFileName, ioe);
} catch (SQLException sqle) {
throw new DatabaseEnvironmentCleanupException("Could not restore backup from file "
+ backupFileName, sqle);
} catch (DbException dbe) {
throw new DatabaseEnvironmentCleanupException("Could not restore backup from file "
+ backupFileName, dbe);
} finally {
try {
IoUtils.closeStream(backupReader, "Could not close reader for backup file "
+ backupFileName);
if (connection != null) {
connection.setAutoCommit(isAutoCommit);
connection.close();
}
} catch (SQLException sqle) {
log.error("Could close DB connection");
}
}
}
@Override
protected List<ColumnDescription> getColumnsToSelect(
DbTable table,
String userName ) throws DbException,
ColumnHasNoDefaultValueException {
// TODO Might be replaced with JDBC DatabaseMetaData.getColumns() but should be verified with default values
ArrayList<ColumnDescription> columnsToSelect = new ArrayList<ColumnDescription>();
DbRecordValuesList[] columnsMetaData = null;
try {
columnsMetaData = dbProvider.select("SHOW COLUMNS FROM " + table.getTableName());
} catch (DbException e) {
throw new DbException("Could not get columns for table " + table.getTableName()
+ ". Check if the table is existing and that the user has permissions. See more details in the trace.");
}
for (DbRecordValuesList columnMetaData : columnsMetaData) {
String columnName = (String) columnMetaData.get("COLUMN_NAME"); // or Field
//check if the column should be skipped in the backup
if (!table.getColumnsToExclude().contains(columnName)) {
ColumnDescription colDescription = new MariaDbColumnDescription(columnName,
(String) columnMetaData.get("COLUMN_TYPE")); // or Type
columnsToSelect.add(colDescription);
} else {
//if this column has no default value, we cannot skip it in the backup
if (columnMetaData.get("COLUMN_DEFAULT") == null) { // or Default
log.error("Cannot skip columns with no default values while creating backup");
throw new ColumnHasNoDefaultValueException(table.getTableName(), columnName);
}
}
}
return columnsToSelect;
}
@Override
protected void writeTableToFile(
List<ColumnDescription> columns,
DbTable table,
DbRecordValuesList[] records,
Writer fileWriter ) throws IOException {
boolean writeDeleteStatementForCurrTable = true;
if (shouldDropTable(table)) {
/*fileWriter.write(DROP_TABLE_MARKER + table.getTableSchema() + "." + table.getTableName()
+ AtsSystemProperties.SYSTEM_LINE_SEPARATOR);*/
Connection connection = null;
try {
connection = ConnectionPool.getConnection(dbConnection);
writeDropTableStatements(fileWriter, table.getFullTableName(), connection);
writeDeleteStatementForCurrTable = false;
} finally {
DbUtils.closeConnection(connection);
}
} /*else if (!this.deleteStatementsInserted) {
writeDeleteStatements(fileWriter);
}*/
// LOCK this single table for update. Lock is released after delete and then insert of backup data.
// This leads to less potential data integrity issues. If another process updates tables at same time
// LOCK at once for all tables is not applicable as in reality DB connection hangs
if (this.addLocks && table.isLockTable()) {
fileWriter.write("LOCK TABLES `" + table.getTableName() + "` WRITE;" + EOL_MARKER
+ AtsSystemProperties.SYSTEM_LINE_SEPARATOR);
}
if (this.includeDeleteStatements && writeDeleteStatementForCurrTable) {
fileWriter.write("DELETE FROM `" + table.getTableName() + "`;" + EOL_MARKER
+ AtsSystemProperties.SYSTEM_LINE_SEPARATOR);
}
if (table.getAutoIncrementResetValue() != null) {
fileWriter.write("SET SESSION sql_mode='NO_AUTO_VALUE_ON_ZERO';" + EOL_MARKER
+ AtsSystemProperties.SYSTEM_LINE_SEPARATOR);
fileWriter.write("ALTER TABLE `" + table.getTableName() + "` AUTO_INCREMENT = "
+ table.getAutoIncrementResetValue() + ";" + EOL_MARKER
+ AtsSystemProperties.SYSTEM_LINE_SEPARATOR);
// If the table was locked, after using ALTER TABLE it becomes unlocked and will throw an error.
// ( https://mariadb.com/kb/en/altering-tables-in-mariadb/ )
// To handle this, lock the table again
if (this.addLocks && table.isLockTable()) {
fileWriter.write("LOCK TABLES `" + table.getTableName() + "` WRITE;" + EOL_MARKER
+ AtsSystemProperties.SYSTEM_LINE_SEPARATOR);
}
}
if (records.length > 0) {
StringBuilder insertStatement = new StringBuilder();
String insertBegin = "INSERT INTO `" + table.getTableName() + "` (" + getColumnsString(columns)
+ ") VALUES(";
String insertEnd = ");" + EOL_MARKER + AtsSystemProperties.SYSTEM_LINE_SEPARATOR;
for (DbRecordValuesList record : records) {
// clear the StringBuilder current data
// it is a little better (almost the same) than insertStatement.setLength( 0 ); as performance
insertStatement.delete(0, insertStatement.length());
insertStatement.append(insertBegin);
for (int i = 0; i < record.size(); i++) {
DbRecordValue recordValue = record.get(i);
String fieldValue = (String) recordValue.getValue();
if (fieldValue == null) {
fieldValue = "NULL";
}
// extract specific values depending on their type
insertStatement.append(extractValue(columns.get(i), fieldValue));
insertStatement.append(",");
}
//remove the last comma
insertStatement.delete(insertStatement.length() - 1, insertStatement.length());
insertStatement.append(insertEnd);
fileWriter.write(StringUtils.escapeNonPrintableAsciiCharacters(insertStatement.toString()));
fileWriter.flush();
}
}
// unlock table
if (this.addLocks && table.isLockTable()) {
fileWriter.write("UNLOCK TABLES;" + EOL_MARKER + AtsSystemProperties.SYSTEM_LINE_SEPARATOR);
}
fileWriter.write(AtsSystemProperties.SYSTEM_LINE_SEPARATOR);
}
private void writeDropTableStatements( Writer fileWriter, String fullTableName,
Connection connection ) throws IOException {
String tableName = fullTableName;
// generate script for restoring the exact table
String generateTableScript = generateTableScript(tableName, connection);
// drop the table
fileWriter.write("DROP TABLE " + tableName + ";" + EOL_MARKER + AtsSystemProperties.SYSTEM_LINE_SEPARATOR);
// create new table
fileWriter.write(generateTableScript + EOL_MARKER + AtsSystemProperties.SYSTEM_LINE_SEPARATOR);
}
@Override
protected void writeDeleteStatements( Writer fileWriter ) throws IOException {
// Empty. Delete and lock are handled per table in writeTableToFile
}
// escapes the characters in the value string, according to the MariaDB manual. This
// method escape each symbol *even* if the symbol itself is part of an escape sequence
protected String escapeValue( String fieldValue ) {
StringBuilder result = new StringBuilder();
for (char currentCharacter : fieldValue.toCharArray()) {
// double quote
if (currentCharacter == '"') {
result.append("\\\"");
// single quote
} else if (currentCharacter == '\'') {
result.append("''");
// backslash
} else if (currentCharacter == '\\') {
result.append("\\\\");
// any other character
} else {
result.append(currentCharacter);
}
}
return result.toString();
}
/**
* Extracts the specific value, considering it's type and the specifics associated with it
*
* @param column the column description
* @param fieldValue the value of the field as String
* @return the value as it should be represented in the backup
*/
private StringBuilder extractValue(
ColumnDescription column,
String fieldValue ) {
StringBuilder insertStatement = new StringBuilder();
if (log.isTraceEnabled()) {
log.trace("Getting backup-friendly string for db value: '" + fieldValue + "' for column "
+ column + ".");
}
if ("NULL".equals(fieldValue)) {
insertStatement.append(fieldValue);
} else if (column.isTypeNumeric()) {
// non-string values. Should not be in quotes and do not need escaping
// BIT type stores only two types of values - 0 and 1, we need to
// extract them and pass them back as string
if (column.isTypeBit()) {
// MariaDB BIT type has possibility to store 1-64 bits. Represent value as hex number 0xnnnn
if (fieldValue.startsWith(HEX_PREFIX_STR)) {
// value already in hex notation. This is because for BIT(>1) resultSet.getObject(col) currently
// returns byte[]
insertStatement.append(fieldValue);
} else {
insertStatement.append(HEX_PREFIX_STR);
long bitsInLong = -1;
try {
bitsInLong = Long.parseLong(fieldValue);
if (bitsInLong < 0) { // overflow for BIT(64) case
log.error(new IllegalArgumentException("Bit value '" + fieldValue
+ "' is too large for parsing."));
}
} catch (NumberFormatException e) {
log.error("Error parsing bit representation to long for field value: '" + fieldValue
+ "', DB column " + column.toString()
+ ". Check if you are running with old JDBC driver.", e);
}
insertStatement.append(Long.toHexString(bitsInLong));
}
} else {
insertStatement.append(fieldValue);
}
} else if (column.isTypeBinary()) {
// value is already in hex mode. In MariaDB apostrophes should not be used as boundaries
insertStatement.append(fieldValue);
} else {
// String variant. Needs escaping
insertStatement.append("'");
fieldValue = escapeValue(fieldValue);
insertStatement.append(fieldValue);
insertStatement.append("'");
}
return insertStatement;
}
@Override
protected String disableForeignKeyChecksStart() {
return "SET FOREIGN_KEY_CHECKS = 0;" + EOL_MARKER + AtsSystemProperties.SYSTEM_LINE_SEPARATOR;
}
@Override
protected String disableForeignKeyChecksEnd() {
return "";
// TODO: disable foreign checks in current way is session-wide and code relies that at the end it should be reset.
// better use this explicitly to know potential errors on commit
// return "SET FOREIGN_KEY_CHECKS = 1;" + EOL_MARKER + ATSSystemProperties.SYSTEM_LINE_SEPARATOR;
}
// DROP table (fast cleanup) functionality methods
private void dropAndRecreateTable( Connection connection, String table, String schema ) {
String tableName = schema + "." + table;
// generate script for restoring the exact table
String generateTableScript = generateTableScript(tableName, connection);
// drop the table
executeUpdate("DROP TABLE " + tableName + ";", connection);
// create new table
executeUpdate(generateTableScript, connection);
}
private String generateTableScript( String tableName, Connection connection ) throws DbException {
PreparedStatement preparedStatement = null;
ResultSet rs = null;
try {
String query = "SHOW CREATE TABLE " + tableName + ";";
preparedStatement = connection.prepareStatement(query);
rs = preparedStatement.executeQuery();
String createQuery = new String();
if (rs.next()) {
createQuery = rs.getString(2);
}
return createQuery;
} catch (Exception e) {
throw new DbException("Error while generating script for the table '" + tableName + "'.", e);
} finally {
DbUtils.closeStatement(preparedStatement);
}
}
private void executeUpdate( String query, Connection connection ) throws DbException {
PreparedStatement stmnt = null;
try {
stmnt = connection.prepareStatement(query);
stmnt.executeUpdate();
} catch (SQLException e) {
throw new DbException(
"SQL errorCode=" + e.getErrorCode() + " sqlState=" + e.getSQLState() + " "
+ e.getMessage(), e);
} finally {
DbUtils.closeStatement(stmnt);
}
}
}
|
3e02a4f8491e5d65deea69861999a99ec70725d1 | 5,056 | java | Java | protempa-framework/src/main/java/org/protempa/LowLevelAbstractionConsequence.java | candyam5522/protempa | 5a620d1a407c7a5426d1cf17d47b97717cf71634 | [
"Apache-2.0"
]
| 1 | 2019-01-23T05:59:02.000Z | 2019-01-23T05:59:02.000Z | protempa-framework/src/main/java/org/protempa/LowLevelAbstractionConsequence.java | candyam5522/protempa | 5a620d1a407c7a5426d1cf17d47b97717cf71634 | [
"Apache-2.0"
]
| 27 | 2015-11-14T14:19:26.000Z | 2019-12-09T17:42:27.000Z | protempa-framework/src/main/java/org/protempa/LowLevelAbstractionConsequence.java | candyam5522/protempa | 5a620d1a407c7a5426d1cf17d47b97717cf71634 | [
"Apache-2.0"
]
| 6 | 2016-01-29T15:17:24.000Z | 2019-06-26T20:09:57.000Z | 37.176471 | 168 | 0.631131 | 1,085 | /*
* #%L
* Protempa Framework
* %%
* Copyright (C) 2012 - 2013 Emory University
* %%
* 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%
*/
package org.protempa;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.drools.WorkingMemory;
import org.drools.rule.Declaration;
import org.drools.spi.Consequence;
import org.drools.spi.KnowledgeHelper;
import org.protempa.proposition.Context;
import org.protempa.proposition.PrimitiveParameter;
import org.protempa.proposition.Sequence;
import org.protempa.proposition.interval.Relation;
/**
* @author Andrew Post
*/
final class LowLevelAbstractionConsequence implements Consequence {
private static final long serialVersionUID = 2455607587534331595L;
private static final Logger LOGGER = Logger.getLogger(LowLevelAbstractionConsequence.class.getName());
private static final Relation REL = new Relation(null, null, 0, null, null,
null, null, null, null, null, null, null, 0, null, null, null);
private final LowLevelAbstractionDefinition def;
private final Algorithm algorithm;
private final DerivationsBuilder derivationsBuilder;
private transient MyObjectAsserter objAsserter;
private void doProcess(KnowledgeHelper knowledgeHelper, Sequence<PrimitiveParameter> subSeq) throws AlgorithmProcessingException, AlgorithmInitializationException {
objAsserter.knowledgeHelper = knowledgeHelper;
LowLevelAbstractionFinder.process(subSeq, this.def, this.algorithm,
objAsserter, this.derivationsBuilder, knowledgeHelper.getWorkingMemory());
objAsserter.knowledgeHelper = null;
}
private static class MyObjectAsserter implements ObjectAsserter {
private KnowledgeHelper knowledgeHelper;
@Override
public void assertObject(Object obj) {
knowledgeHelper.insertLogical(obj);
LOGGER.log(Level.FINER, "Asserted derived proposition {0}", obj);
}
}
LowLevelAbstractionConsequence(
LowLevelAbstractionDefinition simpleAbstractionDef,
Algorithm algorithm, DerivationsBuilder derivationsBuilder) {
this.def = simpleAbstractionDef;
this.algorithm = algorithm;
this.derivationsBuilder = derivationsBuilder;
this.objAsserter = new MyObjectAsserter();
}
@SuppressWarnings("unchecked")
@Override
public void evaluate(KnowledgeHelper kh, WorkingMemory wm)
throws Exception {
List<PrimitiveParameter> pl =
(List<PrimitiveParameter>) kh.get(
kh.getDeclaration("result"));
Declaration declaration = kh.getDeclaration("result2");
Sequence<PrimitiveParameter> seq =
new Sequence<>(this.def.getAbstractedFrom(), pl);
if (declaration != null) {
List<Context> contexts =
(List<Context>) kh.get(kh.getDeclaration("result2"));
Sequence<Context> contextSeq =
new Sequence<>(this.def.getContextId(), contexts);
LinkedList<PrimitiveParameter> ll = new LinkedList<>(seq);
for (Context context : contextSeq) {
boolean in = false;
Iterator<PrimitiveParameter> itr = ll.iterator();
PrimitiveParameter tp = itr.next();
Sequence<PrimitiveParameter> subSeq =
new Sequence<>(seq.getPropositionIds());
while (true) {
if (REL.hasRelation(tp.getInterval(), context.getInterval())) {
subSeq.add(tp);
in = true;
itr.remove();
} else if (in) {
in = false;
break;
}
if (itr.hasNext()) {
tp = itr.next();
} else {
break;
}
}
if (!subSeq.isEmpty()) {
doProcess(kh, subSeq);
subSeq.clear();
}
}
} else {
doProcess(kh, seq);
}
}
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
s.defaultReadObject();
this.objAsserter = new MyObjectAsserter();
}
}
|
3e02a581ba98b289575c6f30ebfd4615a32ec616 | 5,157 | java | Java | src/com/quollwriter/ui/LayoutImagePanel.java | garybentley/quollwriter | b6ffb0eaf986e68d3cbecfd3a3f31e202cf7c4ac | [
"Apache-2.0"
]
| 115 | 2015-03-16T01:10:19.000Z | 2022-03-04T00:44:25.000Z | src/com/quollwriter/ui/LayoutImagePanel.java | garybentley/quollwriter | b6ffb0eaf986e68d3cbecfd3a3f31e202cf7c4ac | [
"Apache-2.0"
]
| 20 | 2015-07-21T18:04:02.000Z | 2022-03-29T20:44:55.000Z | src/com/quollwriter/ui/LayoutImagePanel.java | garybentley/quollwriter | b6ffb0eaf986e68d3cbecfd3a3f31e202cf7c4ac | [
"Apache-2.0"
]
| 27 | 2015-09-24T19:46:03.000Z | 2022-01-11T23:19:23.000Z | 22.818584 | 145 | 0.457436 | 1,086 | package com.quollwriter.ui;
import java.util.List;
import java.util.ArrayList;
import java.util.StringTokenizer;
import java.awt.*;
import java.awt.font.*;
import java.awt.geom.*;
import javax.swing.*;
import com.quollwriter.data.*;
import static com.quollwriter.LanguageStrings.*;
import static com.quollwriter.Environment.getUIString;
public class LayoutImagePanel extends JPanel implements Icon
{
private int xoffset = 0;
private int yoffset = 0;
private List<String> parts = new ArrayList<> ();
public LayoutImagePanel (String type)
{
if (type.startsWith ("layout-"))
{
type = type.substring ("layout-".length ());
}
StringTokenizer t = new StringTokenizer (type,
"-");
while (t.hasMoreTokens ())
{
this.parts.add (t.nextToken ());
}
this.setBorder (UIUtils.createLineBorder ());
}
@Override
public int getIconWidth ()
{
return 120;
}
@Override
public int getIconHeight ()
{
return 60;
}
@Override
public void paintIcon (Component c,
Graphics g,
int x,
int y)
{
this.xoffset = x;
this.yoffset = y;
this.paintComponent (g);
}
@Override
public Dimension getPreferredSize ()
{
return new Dimension (120, 60);
}
@Override
public void paintComponent (Graphics g)
{
super.paintComponent (g);
Graphics2D g2 = (Graphics2D) g;
Font font = new Font ("Segoe UI", Font.BOLD, 12);
int x = 0;
int y = 0;
int h = 60;
Rectangle r = new Rectangle (x, y, 0, h);
for (String p : this.parts)
{
if (p.equals ("ch"))
{
int w = 60;
if (this.parts.size () == 2)
{
w = 90;
}
r.width = w;
g2.setColor (Color.white);
g2.fillRect (r.x + this.xoffset, r.y + this.yoffset, r.width, r.height);
g2.setColor (Color.black);
this.drawString (g2,
getUIString (options,lookandsound,labels,tabs),
r,
0,
font);
r.x += w;
}
if (p.equals ("ps"))
{
// Draw a project
int w = 30;
r.width = w;
g2.setColor (UIUtils.hexToColor ("#C07016"));
g2.fillRect (r.x + this.xoffset, r.y + this.yoffset, r.width, r.height);
g2.setColor (Color.white);
this.drawString (g2,
getUIString (objectnames,singular, Project.OBJECT_TYPE),
r,
Math.PI/2,
font);
r.x += w;
}
if (p.equals ("os"))
{
// Draw a other
int w = 30;
r.width = w;
g2.setColor (UIUtils.hexToColor ("#1732AE"));
g2.fillRect (r.x + this.xoffset, r.y + this.yoffset, r.width, r.height);
g2.setColor (Color.white);
this.drawString (g2,
getUIString (options,lookandsound,labels,other),
r,
Math.PI/2,
font);
r.x += w;
}
}
g2.setColor (Color.black);
g2.drawRect (0 + this.xoffset, 0 + this.yoffset, 119, 59);
this.xoffset = 0;
this.yoffset = 0;
}
private void drawString (Graphics2D g2,
String text,
Rectangle rect,
double rotation,
Font font)
{
AffineTransform trans = g2.getTransform ();
RenderingHints rh = new RenderingHints (RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB);
g2.setRenderingHints (rh);
FontMetrics metrics = g2.getFontMetrics (font);
LineMetrics lmetrics = metrics.getLineMetrics (text, g2);
int x = rect.x + ((rect.width - metrics.stringWidth (text)) /2) + this.xoffset;
int y = rect.y + ((rect.height - metrics.getHeight ()) / 2) + metrics.getAscent () + this.yoffset;
if (rotation != 0)
{
y = -1 * (rect.x + ((rect.width - (int) lmetrics.getHeight () + - metrics.getDescent () + metrics.getAscent ()) / 2) + this.xoffset);
x = rect.y + ((rect.height - metrics.stringWidth (text)) / 2) + this.yoffset;
}
g2.setFont (font);
g2.rotate (rotation);
g2.drawString (text, x, y);
g2.setTransform (trans);
}
}
|
3e02a5d58816abf2b73a9e1044dc5af0dc730ac2 | 2,271 | java | Java | src/main/java/net/astechdesign/clients/model/todo/Todo.java | aaronrs/ContactOrders | 0dd8e730b6a9470c816164d17d572232cbded35c | [
"Apache-2.0"
]
| null | null | null | src/main/java/net/astechdesign/clients/model/todo/Todo.java | aaronrs/ContactOrders | 0dd8e730b6a9470c816164d17d572232cbded35c | [
"Apache-2.0"
]
| null | null | null | src/main/java/net/astechdesign/clients/model/todo/Todo.java | aaronrs/ContactOrders | 0dd8e730b6a9470c816164d17d572232cbded35c | [
"Apache-2.0"
]
| null | null | null | 22.485149 | 96 | 0.629238 | 1,087 | package net.astechdesign.clients.model.todo;
import javafx.beans.property.*;
import java.time.LocalDate;
public class Todo {
private final IntegerProperty id;
private final IntegerProperty contactId;
private final ObjectProperty<LocalDate> date;
private final StringProperty notes;
private final StringProperty name;
private final StringProperty town;
public Todo(int id, int contactId, LocalDate date, String notes) {
this(id, contactId, date, notes, "", "");
}
public Todo(int id, int contactId, LocalDate date, String notes, String name, String town) {
this.id = new SimpleIntegerProperty(id);
this.contactId = new SimpleIntegerProperty(contactId);
this.date = new SimpleObjectProperty<>(date);
this.notes = new SimpleStringProperty(notes);
this.name = new SimpleStringProperty(name);
this.town = new SimpleStringProperty(town);
}
public int getId() {
return id.get();
}
public int getContactId() {
return contactId.get();
}
public LocalDate getDate() {
return date.get();
}
public String getNotes() {
return notes.get();
}
public String getName() {
return name.get();
}
public String getTown() {
return town.get();
}
public void setId(int id) {
this.id.setValue(id);
}
public void setContactId(int contactId) {
this.contactId.setValue(contactId);
}
public void setDate(LocalDate date) {
this.date.setValue(date);
}
public void setNotes(String value) {
this.notes.setValue(value);
}
public void setName(String value) {
this.name.setValue(value);
}
public void setTown(String value) {
this.town.setValue(value);
}
public IntegerProperty idProperty() {
return id;
}
public IntegerProperty contactIdProperty() {
return contactId;
}
public ObjectProperty<LocalDate> dateProperty() {
return date;
}
public StringProperty notesProperty() {
return notes;
}
public StringProperty nameProperty() {
return name;
}
public StringProperty townProperty() {
return town;
}
}
|
3e02a5f396346dc383c525a05c5f1a0e36227c59 | 1,254 | java | Java | mq-cloud/src/main/java/com/sohu/tv/mq/cloud/web/controller/ContactUSController.java | AochongZhang/mqcloud | 34e833f4e65519c3e665e474379ec4c7622f891e | [
"Apache-2.0"
]
| 605 | 2019-03-22T11:21:12.000Z | 2022-03-31T10:18:40.000Z | mq-cloud/src/main/java/com/sohu/tv/mq/cloud/web/controller/ContactUSController.java | AochongZhang/mqcloud | 34e833f4e65519c3e665e474379ec4c7622f891e | [
"Apache-2.0"
]
| 18 | 2019-03-29T05:19:13.000Z | 2022-03-30T11:57:47.000Z | mq-cloud/src/main/java/com/sohu/tv/mq/cloud/web/controller/ContactUSController.java | AochongZhang/mqcloud | 34e833f4e65519c3e665e474379ec4c7622f891e | [
"Apache-2.0"
]
| 172 | 2019-03-28T11:21:57.000Z | 2022-03-24T05:22:30.000Z | 25.591837 | 91 | 0.649123 | 1,088 | package com.sohu.tv.mq.cloud.web.controller;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.sohu.tv.mq.cloud.util.MQCloudConfigHelper;
/**
* 联系我们
*
* @author yongfeigao
* @date 2018年10月15日
*/
@Controller
@RequestMapping("/contact")
public class ContactUSController extends ViewController {
@Autowired
private MQCloudConfigHelper mqCloudConfigHelper;
/**
* 获取配置信息
* @return
* @throws Exception
*/
@RequestMapping
public String index(Map<String, Object> map) throws Exception {
List<Map<String, String>> operatorList = mqCloudConfigHelper.getOperatorContact();
if(operatorList != null) {
setResult(map, "operatorList", operatorList);
}
String specialThx = mqCloudConfigHelper.getSpecialThx();
if(specialThx != null) {
setResult(map, "specialThx", specialThx);
}
return viewModule() + "/index";
}
@Override
public String viewModule() {
return "contact";
}
}
|
3e02a67986d1c0bfcdbd5fbca7064cf3d40ccf10 | 11,185 | java | Java | itests/test/src/test/java/org/apache/karaf/itests/BundleTest.java | sho25/karaf | 95110009181760c3e7ef86e96834a763899962db | [
"Apache-2.0"
]
| null | null | null | itests/test/src/test/java/org/apache/karaf/itests/BundleTest.java | sho25/karaf | 95110009181760c3e7ef86e96834a763899962db | [
"Apache-2.0"
]
| null | null | null | itests/test/src/test/java/org/apache/karaf/itests/BundleTest.java | sho25/karaf | 95110009181760c3e7ef86e96834a763899962db | [
"Apache-2.0"
]
| null | null | null | 16.047346 | 810 | 0.813768 | 1,089 | begin_unit|revision:0.9.5;language:Java;cregit-version:0.0.1
begin_comment
comment|/* * 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. */
end_comment
begin_package
package|package
name|org
operator|.
name|apache
operator|.
name|karaf
operator|.
name|itests
package|;
end_package
begin_import
import|import static
name|org
operator|.
name|junit
operator|.
name|Assert
operator|.
name|assertFalse
import|;
end_import
begin_import
import|import static
name|org
operator|.
name|junit
operator|.
name|Assert
operator|.
name|assertTrue
import|;
end_import
begin_import
import|import
name|javax
operator|.
name|management
operator|.
name|MBeanServer
import|;
end_import
begin_import
import|import
name|javax
operator|.
name|management
operator|.
name|ObjectName
import|;
end_import
begin_import
import|import
name|javax
operator|.
name|management
operator|.
name|openmbean
operator|.
name|TabularDataSupport
import|;
end_import
begin_import
import|import
name|org
operator|.
name|apache
operator|.
name|karaf
operator|.
name|bundle
operator|.
name|core
operator|.
name|BundleService
import|;
end_import
begin_import
import|import
name|org
operator|.
name|apache
operator|.
name|karaf
operator|.
name|jaas
operator|.
name|boot
operator|.
name|principal
operator|.
name|RolePrincipal
import|;
end_import
begin_import
import|import
name|org
operator|.
name|junit
operator|.
name|Test
import|;
end_import
begin_import
import|import
name|org
operator|.
name|junit
operator|.
name|runner
operator|.
name|RunWith
import|;
end_import
begin_import
import|import
name|org
operator|.
name|ops4j
operator|.
name|pax
operator|.
name|exam
operator|.
name|junit
operator|.
name|PaxExam
import|;
end_import
begin_import
import|import
name|org
operator|.
name|ops4j
operator|.
name|pax
operator|.
name|exam
operator|.
name|spi
operator|.
name|reactors
operator|.
name|ExamReactorStrategy
import|;
end_import
begin_import
import|import
name|org
operator|.
name|ops4j
operator|.
name|pax
operator|.
name|exam
operator|.
name|spi
operator|.
name|reactors
operator|.
name|PerClass
import|;
end_import
begin_import
import|import
name|java
operator|.
name|lang
operator|.
name|management
operator|.
name|ManagementFactory
import|;
end_import
begin_class
annotation|@
name|RunWith
argument_list|(
name|PaxExam
operator|.
name|class
argument_list|)
annotation|@
name|ExamReactorStrategy
argument_list|(
name|PerClass
operator|.
name|class
argument_list|)
specifier|public
class|class
name|BundleTest
extends|extends
name|BaseTest
block|{
specifier|private
specifier|static
specifier|final
name|RolePrincipal
index|[]
name|ADMIN_ROLES
init|=
block|{
operator|new
name|RolePrincipal
argument_list|(
name|BundleService
operator|.
name|SYSTEM_BUNDLES_ROLE
argument_list|)
block|,
operator|new
name|RolePrincipal
argument_list|(
literal|"admin"
argument_list|)
block|,
operator|new
name|RolePrincipal
argument_list|(
literal|"manager"
argument_list|)
block|}
decl_stmt|;
annotation|@
name|Test
specifier|public
name|void
name|listCommand
parameter_list|()
throws|throws
name|Exception
block|{
name|String
name|listOutput
init|=
name|executeCommand
argument_list|(
literal|"bundle:list -t 0"
argument_list|,
name|ADMIN_ROLES
argument_list|)
decl_stmt|;
name|System
operator|.
name|out
operator|.
name|println
argument_list|(
name|listOutput
argument_list|)
expr_stmt|;
name|assertFalse
argument_list|(
name|listOutput
operator|.
name|isEmpty
argument_list|()
argument_list|)
expr_stmt|;
block|}
annotation|@
name|Test
specifier|public
name|void
name|listViaMBean
parameter_list|()
throws|throws
name|Exception
block|{
name|MBeanServer
name|mbeanServer
init|=
name|ManagementFactory
operator|.
name|getPlatformMBeanServer
argument_list|()
decl_stmt|;
name|ObjectName
name|name
init|=
operator|new
name|ObjectName
argument_list|(
literal|"org.apache.karaf:type=bundle,name=root"
argument_list|)
decl_stmt|;
name|TabularDataSupport
name|value
init|=
operator|(
name|TabularDataSupport
operator|)
name|mbeanServer
operator|.
name|getAttribute
argument_list|(
name|name
argument_list|,
literal|"Bundles"
argument_list|)
decl_stmt|;
name|assertTrue
argument_list|(
name|value
operator|.
name|size
argument_list|()
operator|>
literal|0
argument_list|)
expr_stmt|;
block|}
annotation|@
name|Test
specifier|public
name|void
name|capabilitiesCommand
parameter_list|()
throws|throws
name|Exception
block|{
name|String
name|allCapabilitiesOutput
init|=
name|executeCommand
argument_list|(
literal|"bundle:capabilities"
argument_list|,
name|ADMIN_ROLES
argument_list|)
decl_stmt|;
name|System
operator|.
name|out
operator|.
name|println
argument_list|(
name|allCapabilitiesOutput
argument_list|)
expr_stmt|;
name|assertFalse
argument_list|(
name|allCapabilitiesOutput
operator|.
name|isEmpty
argument_list|()
argument_list|)
expr_stmt|;
name|String
name|jmxWhiteboardBundleCapabilitiesOutput
init|=
name|executeCommand
argument_list|(
literal|"bundle:capabilities org.apache.aries.jmx.whiteboard"
argument_list|,
name|ADMIN_ROLES
argument_list|)
decl_stmt|;
name|System
operator|.
name|out
operator|.
name|println
argument_list|(
name|jmxWhiteboardBundleCapabilitiesOutput
argument_list|)
expr_stmt|;
name|assertContains
argument_list|(
literal|"osgi.wiring.bundle; org.apache.aries.jmx.whiteboard 1.2.0 [UNUSED]"
argument_list|,
name|jmxWhiteboardBundleCapabilitiesOutput
argument_list|)
expr_stmt|;
block|}
annotation|@
name|Test
specifier|public
name|void
name|classesCommand
parameter_list|()
throws|throws
name|Exception
block|{
name|String
name|allClassesOutput
init|=
name|executeCommand
argument_list|(
literal|"bundle:classes"
argument_list|,
name|ADMIN_ROLES
argument_list|)
decl_stmt|;
name|assertFalse
argument_list|(
name|allClassesOutput
operator|.
name|isEmpty
argument_list|()
argument_list|)
expr_stmt|;
name|String
name|jmxWhiteboardBundleClassesOutput
init|=
name|executeCommand
argument_list|(
literal|"bundle:classes org.apache.aries.jmx.whiteboard"
argument_list|,
name|ADMIN_ROLES
argument_list|)
decl_stmt|;
name|System
operator|.
name|out
operator|.
name|println
argument_list|(
name|jmxWhiteboardBundleClassesOutput
argument_list|)
expr_stmt|;
name|assertContains
argument_list|(
literal|"org/apache/aries/jmx/whiteboard/Activator$MBeanTracker.class"
argument_list|,
name|jmxWhiteboardBundleClassesOutput
argument_list|)
expr_stmt|;
block|}
comment|/** * TODO We need some more thorough tests for diag */
annotation|@
name|Test
specifier|public
name|void
name|diagCommand
parameter_list|()
throws|throws
name|Exception
block|{
name|String
name|allDiagOutput
init|=
name|executeCommand
argument_list|(
literal|"bundle:diag"
argument_list|)
decl_stmt|;
name|assertTrue
argument_list|(
name|allDiagOutput
operator|.
name|isEmpty
argument_list|()
argument_list|)
expr_stmt|;
block|}
annotation|@
name|Test
specifier|public
name|void
name|findClassCommand
parameter_list|()
throws|throws
name|Exception
block|{
name|String
name|findClassOutput
init|=
name|executeCommand
argument_list|(
literal|"bundle:find-class jmx"
argument_list|)
decl_stmt|;
name|System
operator|.
name|out
operator|.
name|println
argument_list|(
name|findClassOutput
argument_list|)
expr_stmt|;
name|assertFalse
argument_list|(
name|findClassOutput
operator|.
name|isEmpty
argument_list|()
argument_list|)
expr_stmt|;
block|}
annotation|@
name|Test
specifier|public
name|void
name|headersCommand
parameter_list|()
throws|throws
name|Exception
block|{
name|String
name|headersOutput
init|=
name|executeCommand
argument_list|(
literal|"bundle:headers org.apache.aries.jmx.whiteboard"
argument_list|,
name|ADMIN_ROLES
argument_list|)
decl_stmt|;
name|System
operator|.
name|out
operator|.
name|println
argument_list|(
name|headersOutput
argument_list|)
expr_stmt|;
name|assertContains
argument_list|(
literal|"Bundle-Activator = org.apache.aries.jmx.whiteboard.Activator"
argument_list|,
name|headersOutput
argument_list|)
expr_stmt|;
block|}
annotation|@
name|Test
specifier|public
name|void
name|infoCommand
parameter_list|()
throws|throws
name|Exception
block|{
name|String
name|infoOutput
init|=
name|executeCommand
argument_list|(
literal|"bundle:info org.apache.karaf.management.server"
argument_list|,
name|ADMIN_ROLES
argument_list|)
decl_stmt|;
name|System
operator|.
name|out
operator|.
name|println
argument_list|(
name|infoOutput
argument_list|)
expr_stmt|;
name|assertContains
argument_list|(
literal|"This bundle starts the Karaf embedded MBean server"
argument_list|,
name|infoOutput
argument_list|)
expr_stmt|;
block|}
annotation|@
name|Test
specifier|public
name|void
name|installUninstallCommand
parameter_list|()
throws|throws
name|Exception
block|{
name|executeCommand
argument_list|(
literal|"bundle:install mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-lang/2.4_6"
argument_list|,
name|ADMIN_ROLES
argument_list|)
expr_stmt|;
name|assertBundleInstalled
argument_list|(
literal|"org.apache.servicemix.bundles.commons-lang"
argument_list|)
expr_stmt|;
name|executeCommand
argument_list|(
literal|"bundle:uninstall org.apache.servicemix.bundles.commons-lang"
argument_list|,
name|ADMIN_ROLES
argument_list|)
expr_stmt|;
name|assertBundleNotInstalled
argument_list|(
literal|"org.apache.servicemix.bundles.commons-lang"
argument_list|)
expr_stmt|;
block|}
annotation|@
name|Test
specifier|public
name|void
name|showTreeCommand
parameter_list|()
throws|throws
name|Exception
block|{
name|String
name|bundleTreeOutput
init|=
name|executeCommand
argument_list|(
literal|"bundle:tree-show org.apache.karaf.management.server"
argument_list|,
name|ADMIN_ROLES
argument_list|)
decl_stmt|;
name|System
operator|.
name|out
operator|.
name|println
argument_list|(
name|bundleTreeOutput
argument_list|)
expr_stmt|;
name|assertFalse
argument_list|(
name|bundleTreeOutput
operator|.
name|isEmpty
argument_list|()
argument_list|)
expr_stmt|;
block|}
annotation|@
name|Test
specifier|public
name|void
name|statusCommand
parameter_list|()
throws|throws
name|Exception
block|{
name|String
name|statusOutput
init|=
name|executeCommand
argument_list|(
literal|"bundle:status org.apache.karaf.management.server"
argument_list|,
name|ADMIN_ROLES
argument_list|)
decl_stmt|;
name|System
operator|.
name|out
operator|.
name|println
argument_list|(
name|statusOutput
argument_list|)
expr_stmt|;
name|assertFalse
argument_list|(
name|statusOutput
operator|.
name|isEmpty
argument_list|()
argument_list|)
expr_stmt|;
block|}
block|}
end_class
end_unit
|
3e02a754d4406bd958853987470e68412a422134 | 557 | java | Java | src/main/java/alexmog/apilib/exceptions/BaseException.java | Hartorn/ApiLib | c9567db066ee38085ee8b5968402e54b258ca19f | [
"MIT"
]
| 1 | 2017-11-19T18:50:34.000Z | 2017-11-19T18:50:34.000Z | src/main/java/alexmog/apilib/exceptions/BaseException.java | Hartorn/ApiLib | c9567db066ee38085ee8b5968402e54b258ca19f | [
"MIT"
]
| 1 | 2019-02-19T20:43:37.000Z | 2019-02-19T20:43:37.000Z | src/main/java/alexmog/apilib/exceptions/BaseException.java | Hartorn/ApiLib | c9567db066ee38085ee8b5968402e54b258ca19f | [
"MIT"
]
| 2 | 2019-02-19T19:57:21.000Z | 2019-11-14T01:41:42.000Z | 23.208333 | 82 | 0.750449 | 1,090 | package alexmog.apilib.exceptions;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@SuppressWarnings("serial")
@JsonIgnoreProperties({ "cause", "localizedMessage", "stackTrace", "suppressed" })
public class BaseException extends RuntimeException {
private int status;
public BaseException(int status, String message) {
super(message);
this.status = status;
}
public BaseException(int status, String message, Throwable cause) {
super(message, cause);
this.status = status;
}
public int getStatus() {
return status;
}
}
|
3e02a7b5bafa957aba136dea9224e22c3663772c | 1,363 | java | Java | streaming-connectors/base/src/main/java/org/pragmaticminds/crunch/serialization/Serializer.java | JulianFeinauer/crunch | 7feb3e2d20d45484dd0cf42661df55ea28cbec69 | [
"Apache-2.0"
]
| 11 | 2018-12-20T13:10:31.000Z | 2020-03-05T07:29:38.000Z | streaming-connectors/base/src/main/java/org/pragmaticminds/crunch/serialization/Serializer.java | JulianFeinauer/crunch | 7feb3e2d20d45484dd0cf42661df55ea28cbec69 | [
"Apache-2.0"
]
| 11 | 2018-12-21T09:49:10.000Z | 2019-08-27T15:09:27.000Z | streaming-connectors/base/src/main/java/org/pragmaticminds/crunch/serialization/Serializer.java | JulianFeinauer/crunch | 7feb3e2d20d45484dd0cf42661df55ea28cbec69 | [
"Apache-2.0"
]
| 3 | 2019-04-10T18:27:05.000Z | 2021-09-08T11:11:27.000Z | 29.630435 | 73 | 0.697726 | 1,091 | /*
* 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.pragmaticminds.crunch.serialization;
/**
* An interface for converting objects to bytes.
*
* @param <T> Type to be serialized from.
* @author julian
*/
public interface Serializer<T> extends AutoCloseable {
/**
* Convert {@code data} into a byte array.
*
* @param data typed data
* @return serialized bytes
*/
byte[] serialize(T data);
/**
* Close this serializer.
* <p>
* This method must be idempotent as it may be called multiple times.
*/
@Override
void close();
}
|
3e02a7c1fc537af560387d41dade47026684b6b7 | 1,951 | java | Java | src/main/java/org/jabref/logic/formatter/casechanger/TitleParser.java | kingb18/jabref | 3fe34a0ee319f49c87258f0aee0360f486107c91 | [
"MIT"
]
| 2,813 | 2015-01-03T20:12:42.000Z | 2022-03-31T09:09:58.000Z | src/main/java/org/jabref/logic/formatter/casechanger/TitleParser.java | kingb18/jabref | 3fe34a0ee319f49c87258f0aee0360f486107c91 | [
"MIT"
]
| 6,523 | 2015-02-23T22:52:33.000Z | 2022-03-31T22:54:25.000Z | src/main/java/org/jabref/logic/formatter/casechanger/TitleParser.java | kingb18/jabref | 3fe34a0ee319f49c87258f0aee0360f486107c91 | [
"MIT"
]
| 2,535 | 2015-01-03T20:14:40.000Z | 2022-03-30T08:27:11.000Z | 24.696203 | 82 | 0.53511 | 1,092 | package org.jabref.logic.formatter.casechanger;
import java.util.LinkedList;
import java.util.List;
import java.util.Optional;
/**
* Parses a title to a list of words.
*/
public final class TitleParser {
private StringBuilder buffer;
private int wordStart;
public List<Word> parse(String title) {
List<Word> words = new LinkedList<>();
boolean[] isProtected = determineProtectedChars(title);
reset();
int index = 0;
for (char c : title.toCharArray()) {
if (Character.isWhitespace(c)) {
createWord(isProtected).ifPresent(words::add);
} else {
if (wordStart == -1) {
wordStart = index;
}
buffer.append(c);
}
index++;
}
createWord(isProtected).ifPresent(words::add);
return words;
}
private Optional<Word> createWord(boolean[] isProtected) {
if (buffer.length() <= 0) {
return Optional.empty();
}
char[] chars = buffer.toString().toCharArray();
boolean[] protectedChars = new boolean[chars.length];
System.arraycopy(isProtected, wordStart, protectedChars, 0, chars.length);
reset();
return Optional.of(new Word(chars, protectedChars));
}
private void reset() {
wordStart = -1;
buffer = new StringBuilder();
}
private static boolean[] determineProtectedChars(String title) {
boolean[] isProtected = new boolean[title.length()];
char[] chars = title.toCharArray();
int brackets = 0;
for (int i = 0; i < title.length(); i++) {
if (chars[i] == '{') {
brackets++;
} else if (chars[i] == '}') {
brackets--;
} else {
isProtected[i] = brackets > 0;
}
}
return isProtected;
}
}
|
3e02a7e9afd2321dc4ab2aaaca6423aa0dc9b169 | 3,323 | java | Java | modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/GetIdentityLinksForTaskCmd.java | le-shi/flowable-engine | 0b610fd04b23769212f328cee330a65991fa7683 | [
"Apache-2.0"
]
| 5,250 | 2016-10-13T08:15:16.000Z | 2022-03-31T13:53:26.000Z | modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/GetIdentityLinksForTaskCmd.java | le-shi/flowable-engine | 0b610fd04b23769212f328cee330a65991fa7683 | [
"Apache-2.0"
]
| 1,736 | 2016-10-13T17:03:10.000Z | 2022-03-31T19:27:39.000Z | modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/GetIdentityLinksForTaskCmd.java | le-shi/flowable-engine | 0b610fd04b23769212f328cee330a65991fa7683 | [
"Apache-2.0"
]
| 2,271 | 2016-10-13T08:27:26.000Z | 2022-03-31T15:36:02.000Z | 44.306667 | 154 | 0.730364 | 1,093 | /* 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.flowable.cmmn.engine.impl.cmd;
import java.io.Serializable;
import java.util.List;
import org.flowable.cmmn.engine.CmmnEngineConfiguration;
import org.flowable.cmmn.engine.impl.util.CommandContextUtil;
import org.flowable.common.engine.impl.interceptor.Command;
import org.flowable.common.engine.impl.interceptor.CommandContext;
import org.flowable.identitylink.api.IdentityLink;
import org.flowable.identitylink.api.IdentityLinkType;
import org.flowable.identitylink.service.impl.persistence.entity.IdentityLinkEntity;
import org.flowable.task.service.impl.persistence.entity.TaskEntity;
/**
* @author Tijs Rademakers
*/
public class GetIdentityLinksForTaskCmd implements Command<List<IdentityLink>>, Serializable {
private static final long serialVersionUID = 1L;
protected String taskId;
public GetIdentityLinksForTaskCmd(String taskId) {
this.taskId = taskId;
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public List<IdentityLink> execute(CommandContext commandContext) {
CmmnEngineConfiguration cmmnEngineConfiguration = CommandContextUtil.getCmmnEngineConfiguration(commandContext);
TaskEntity task = cmmnEngineConfiguration.getTaskServiceConfiguration().getTaskService().getTask(taskId);
List<IdentityLink> identityLinks = (List) task.getIdentityLinks();
// assignee is not part of identity links in the db.
// so if there is one, we add it here.
// @Tom: we discussed this long on skype and you agreed ;-)
// an assignee *is* an identityLink, and so must it be reflected in the API
//
// Note: we cant move this code to the TaskEntity (which would be cleaner),
// since the task.delete cascaded to all associated identityLinks
// and of course this leads to exception while trying to delete a non-existing identityLink
if (task.getAssignee() != null) {
IdentityLinkEntity identityLink = cmmnEngineConfiguration.getIdentityLinkServiceConfiguration().getIdentityLinkService().createIdentityLink();
identityLink.setUserId(task.getAssignee());
identityLink.setType(IdentityLinkType.ASSIGNEE);
identityLink.setTaskId(task.getId());
identityLinks.add(identityLink);
}
if (task.getOwner() != null) {
IdentityLinkEntity identityLink = cmmnEngineConfiguration.getIdentityLinkServiceConfiguration().getIdentityLinkService().createIdentityLink();
identityLink.setUserId(task.getOwner());
identityLink.setTaskId(task.getId());
identityLink.setType(IdentityLinkType.OWNER);
identityLinks.add(identityLink);
}
return identityLinks;
}
}
|
3e02a8d164359cba46bd55e0aedb0496e6a28bfd | 10,423 | java | Java | java/org/apache/coyote/http11/Http11Nio2Protocol.java | dblevins/tomcat | 3f37ea98c21cd6daf8d58578287e10c846ce6b51 | [
"Apache-2.0"
]
| 1 | 2020-12-26T04:52:15.000Z | 2020-12-26T04:52:15.000Z | java/org/apache/coyote/http11/Http11Nio2Protocol.java | dblevins/tomcat | 3f37ea98c21cd6daf8d58578287e10c846ce6b51 | [
"Apache-2.0"
]
| 3 | 2021-02-03T19:34:55.000Z | 2022-01-21T23:47:50.000Z | target/classes/org/apache/coyote/http11/Http11Nio2Protocol.java | fs1483/tomcat8-source | f57f1c19675182b95b0f255ea75d317f53961b28 | [
"Apache-2.0"
]
| 1 | 2021-12-06T01:13:18.000Z | 2021-12-06T01:13:18.000Z | 35.332203 | 100 | 0.610573 | 1,094 | /*
* 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.coyote.http11;
import java.io.IOException;
import java.nio.channels.ReadPendingException;
import javax.net.ssl.SSLEngine;
import javax.servlet.http.HttpUpgradeHandler;
import org.apache.coyote.AbstractProtocol;
import org.apache.coyote.Processor;
import org.apache.coyote.http11.upgrade.Nio2Processor;
import org.apache.juli.logging.Log;
import org.apache.juli.logging.LogFactory;
import org.apache.tomcat.util.net.AbstractEndpoint;
import org.apache.tomcat.util.net.Nio2Channel;
import org.apache.tomcat.util.net.Nio2Endpoint;
import org.apache.tomcat.util.net.Nio2Endpoint.Handler;
import org.apache.tomcat.util.net.Nio2Endpoint.Nio2SocketWrapper;
import org.apache.tomcat.util.net.SSLImplementation;
import org.apache.tomcat.util.net.SecureNio2Channel;
import org.apache.tomcat.util.net.SocketStatus;
import org.apache.tomcat.util.net.SocketWrapper;
/**
* HTTP/1.1 protocol implementation using NIO2.
*/
public class Http11Nio2Protocol extends AbstractHttp11JsseProtocol<Nio2Channel> {
private static final Log log = LogFactory.getLog(Http11Nio2Protocol.class);
@Override
protected Log getLog() { return log; }
@Override
protected AbstractEndpoint.Handler getHandler() {
return cHandler;
}
public Http11Nio2Protocol() {
endpoint=new Nio2Endpoint();
cHandler = new Http11ConnectionHandler(this);
((Nio2Endpoint) endpoint).setHandler(cHandler);
setSoLinger(Constants.DEFAULT_CONNECTION_LINGER);
setSoTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT);
setTcpNoDelay(Constants.DEFAULT_TCP_NO_DELAY);
}
public Nio2Endpoint getEndpoint() {
return ((Nio2Endpoint)endpoint);
}
@Override
public void start() throws Exception {
super.start();
if (npnHandler != null) {
npnHandler.init(getEndpoint(), 0, getAdapter());
}
}
// -------------------- Properties--------------------
private final Http11ConnectionHandler cHandler;
// -------------------- Pool setup --------------------
public void setAcceptorThreadPriority(int threadPriority) {
((Nio2Endpoint)endpoint).setAcceptorThreadPriority(threadPriority);
}
public void setPollerThreadPriority(int threadPriority) {
((Nio2Endpoint)endpoint).setPollerThreadPriority(threadPriority);
}
public int getAcceptorThreadPriority() {
return ((Nio2Endpoint)endpoint).getAcceptorThreadPriority();
}
public int getPollerThreadPriority() {
return ((Nio2Endpoint)endpoint).getThreadPriority();
}
public boolean getUseSendfile() {
return endpoint.getUseSendfile();
}
public void setUseSendfile(boolean useSendfile) {
((Nio2Endpoint)endpoint).setUseSendfile(useSendfile);
}
// -------------------- Tcp setup --------------------
public void setOomParachute(int oomParachute) {
((Nio2Endpoint)endpoint).setOomParachute(oomParachute);
}
// ----------------------------------------------------- JMX related methods
@Override
protected String getNamePrefix() {
return ("http-nio2");
}
// -------------------- Connection handler --------------------
protected static class Http11ConnectionHandler
extends AbstractConnectionHandler<Nio2Channel,Http11Nio2Processor>
implements Handler {
protected Http11Nio2Protocol proto;
Http11ConnectionHandler(Http11Nio2Protocol proto) {
this.proto = proto;
}
@Override
protected AbstractProtocol<Nio2Channel> getProtocol() {
return proto;
}
@Override
protected Log getLog() {
return log;
}
@Override
public SSLImplementation getSslImplementation() {
return proto.sslImplementation;
}
/**
* Expected to be used by the Poller to release resources on socket
* close, errors etc.
*/
@Override
public void release(SocketWrapper<Nio2Channel> socket) {
Processor<Nio2Channel> processor =
connections.remove(socket.getSocket());
if (processor != null) {
processor.recycle(true);
recycledProcessors.push(processor);
}
}
@Override
public SocketState process(SocketWrapper<Nio2Channel> socket,
SocketStatus status) {
if (proto.npnHandler != null) {
SocketState ss = proto.npnHandler.process(socket, status);
if (ss != SocketState.OPEN) {
return ss;
}
}
return super.process(socket, status);
}
/**
* Expected to be used by the handler once the processor is no longer
* required.
*
* @param socket
* @param processor
* @param isSocketClosing Not used in HTTP
* @param addToPoller
*/
@Override
public void release(SocketWrapper<Nio2Channel> socket,
Processor<Nio2Channel> processor, boolean isSocketClosing,
boolean addToPoller) {
processor.recycle(isSocketClosing);
recycledProcessors.push(processor);
if (socket.isAsync()) {
((Nio2Endpoint) proto.endpoint).removeTimeout(socket);
}
if (addToPoller) {
((Nio2Endpoint) proto.endpoint).awaitBytes(socket);
}
}
@Override
protected void initSsl(SocketWrapper<Nio2Channel> socket,
Processor<Nio2Channel> processor) {
if (proto.isSSLEnabled() &&
(proto.sslImplementation != null)
&& (socket.getSocket() instanceof SecureNio2Channel)) {
SecureNio2Channel ch = (SecureNio2Channel)socket.getSocket();
processor.setSslSupport(
proto.sslImplementation.getSSLSupport(
ch.getSslEngine().getSession()));
} else {
processor.setSslSupport(null);
}
}
@Override
protected void longPoll(SocketWrapper<Nio2Channel> socket,
Processor<Nio2Channel> processor) {
if (processor.isAsync()) {
socket.setAsync(true);
((Nio2Endpoint) proto.endpoint).addTimeout(socket);
} else if (processor.isUpgrade()) {
if (((Nio2SocketWrapper) socket).isUpgradeInit()) {
try {
((Nio2Endpoint) proto.endpoint).awaitBytes(socket);
} catch (ReadPendingException e) {
// Ignore, the initial state after upgrade is
// impossible to predict, and a read must be pending
// to get a first notification
}
}
} else {
// Either:
// - this is comet request
// - this is an upgraded connection
// - the request line/headers have not been completely
// read
// The completion handlers should be in place,
// so nothing to do here
}
}
@Override
public Http11Nio2Processor createProcessor() {
Http11Nio2Processor processor = new Http11Nio2Processor(
proto.getMaxHttpHeaderSize(), (Nio2Endpoint) proto.endpoint,
proto.getMaxTrailerSize(), proto.getMaxExtensionSize(),
proto.getMaxSwallowSize());
processor.setAdapter(proto.getAdapter());
processor.setMaxKeepAliveRequests(proto.getMaxKeepAliveRequests());
processor.setKeepAliveTimeout(proto.getKeepAliveTimeout());
processor.setConnectionUploadTimeout(
proto.getConnectionUploadTimeout());
processor.setDisableUploadTimeout(proto.getDisableUploadTimeout());
processor.setCompressionMinSize(proto.getCompressionMinSize());
processor.setCompression(proto.getCompression());
processor.setNoCompressionUserAgents(proto.getNoCompressionUserAgents());
processor.setCompressableMimeTypes(proto.getCompressableMimeTypes());
processor.setRestrictedUserAgents(proto.getRestrictedUserAgents());
processor.setSocketBuffer(proto.getSocketBuffer());
processor.setMaxSavePostSize(proto.getMaxSavePostSize());
processor.setServer(proto.getServer());
register(processor);
return processor;
}
@Override
protected Processor<Nio2Channel> createUpgradeProcessor(
SocketWrapper<Nio2Channel> socket,
HttpUpgradeHandler httpUpgradeProcessor)
throws IOException {
return new Nio2Processor(proto.endpoint, socket, httpUpgradeProcessor,
proto.getUpgradeAsyncWriteBufferSize());
}
@Override
public void onCreateSSLEngine(SSLEngine engine) {
if (proto.npnHandler != null) {
proto.npnHandler.onCreateEngine(engine);
}
}
@Override
public void closeAll() {
for (Nio2Channel channel : connections.keySet()) {
((Nio2Endpoint) proto.endpoint).closeSocket(channel.getSocket(), SocketStatus.STOP);
}
}
}
}
|
3e02a8d178197ba990a6021826b42be3f8ab5b25 | 5,752 | java | Java | athena-federation-sdk/src/main/java/com/amazonaws/athena/connector/lambda/serde/v2/LambdaFunctionExceptionSerDe.java | StoneDot/aws-athena-query-federation | 46f807ef5c6609d4ec42ead617804ed99450968c | [
"Apache-2.0"
]
| 399 | 2019-11-26T18:09:21.000Z | 2022-03-28T19:13:21.000Z | athena-federation-sdk/src/main/java/com/amazonaws/athena/connector/lambda/serde/v2/LambdaFunctionExceptionSerDe.java | StoneDot/aws-athena-query-federation | 46f807ef5c6609d4ec42ead617804ed99450968c | [
"Apache-2.0"
]
| 430 | 2019-11-27T20:35:23.000Z | 2022-03-31T13:06:35.000Z | athena-federation-sdk/src/main/java/com/amazonaws/athena/connector/lambda/serde/v2/LambdaFunctionExceptionSerDe.java | StoneDot/aws-athena-query-federation | 46f807ef5c6609d4ec42ead617804ed99450968c | [
"Apache-2.0"
]
| 199 | 2019-11-27T17:54:44.000Z | 2022-03-28T17:06:55.000Z | 42.294118 | 132 | 0.634736 | 1,095 | /*-
* #%L
* Amazon Athena Query Federation SDK
* %%
* Copyright (C) 2019 - 2020 Amazon Web Services
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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%
*/
package com.amazonaws.athena.connector.lambda.serde.v2;
import com.amazonaws.athena.connector.lambda.serde.BaseDeserializer;
import com.amazonaws.services.lambda.invoke.LambdaFunctionException;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.base.Joiner;
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
/**
* Used strictly for deserialization only since we do not own {@link LambdaFunctionException} and never need-to/should serialize it.
*/
public class LambdaFunctionExceptionSerDe
{
private static final Joiner COMMA_JOINER = Joiner.on(",");
private static final String ERROR_TYPE_FIELD = "errorType";
private static final String ERROR_MESSAGE_FIELD = "errorMessage";
private static final String CAUSE_FIELD = "cause";
private static final String STACK_TRACE_FIELD = "stackTrace";
private LambdaFunctionExceptionSerDe(){}
public static final class Deserializer extends BaseDeserializer<LambdaFunctionException>
{
public Deserializer()
{
super(LambdaFunctionException.class);
}
@Override
public LambdaFunctionException deserialize(JsonParser jparser, DeserializationContext ctxt)
throws IOException
{
validateObjectStart(jparser.getCurrentToken());
// readTree consumes object end token so skip validation
return doDeserialize(jparser, ctxt);
}
@Override
public LambdaFunctionException doDeserialize(JsonParser jparser, DeserializationContext ctxt)
throws IOException
{
JsonNode root = jparser.getCodec().readTree(jparser);
return recursiveParse(root);
}
private LambdaFunctionException recursiveParse(JsonNode root)
{
String errorType = getNullableStringValue(root, ERROR_TYPE_FIELD);
String errorMessage = getNullableStringValue(root, ERROR_MESSAGE_FIELD);
LambdaFunctionException cause = null;
JsonNode causeNode = root.get(CAUSE_FIELD);
if (causeNode != null) {
cause = recursiveParse(causeNode);
}
List<List<String>> stackTraces = new LinkedList<>();
JsonNode stackTraceNode = root.get(STACK_TRACE_FIELD);
if (stackTraceNode != null) {
if (stackTraceNode.isArray()) {
Iterator<JsonNode> elements = stackTraceNode.elements();
while (elements.hasNext()) {
List<String> innerList = new LinkedList<>();
JsonNode element = elements.next();
if (element.isArray()) {
Iterator<JsonNode> innerElements = element.elements();
while (innerElements.hasNext()) {
innerList.add(innerElements.next().asText());
}
}
else {
// emulate DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY
innerList.add(element.asText());
}
stackTraces.add(innerList);
}
}
}
// HACK: LambdaFunctionException is only intended to be instantiated by Lambda server-side, so its constructors
// are package-private or deprecated. Thus the need for reflection here. If the signature of the preferred
// constructor does change, we fall back to the deprecated constructor (which requires us to append the stackTrace
// to the errorMessage to not lose it). If the deprecated constructor is removed then this will not compile
// and the appropriate adjustment can be made.
try {
Constructor<LambdaFunctionException> constructor = LambdaFunctionException.class.getDeclaredConstructor(
String.class, String.class, LambdaFunctionException.class, List.class);
constructor.setAccessible(true);
return constructor.newInstance(errorType, errorMessage, cause, stackTraces);
}
catch (ReflectiveOperationException e) {
return new LambdaFunctionException(appendStackTrace(errorMessage, stackTraces), false, errorType);
}
}
private String getNullableStringValue(JsonNode parent, String field)
{
JsonNode child = parent.get(field);
if (child != null) {
return child.asText();
}
return null;
}
private String appendStackTrace(String errorMessage, List<List<String>> stackTraces)
{
return errorMessage + ". Stack trace: " + stackTraces;
}
}
}
|
3e02a8de9204e2990958c8bd89dbf53e7ffa372a | 4,050 | java | Java | src/test/java/com/outlook/test/BPM/TestCase_Outlook_Login_Invalid_On_Firefox.java | MarcusChang/WWE_LoginTestAuto | 657d3eb9f393225c3802c37083c46c658ae51e81 | [
"Apache-2.0"
]
| 1 | 2016-04-13T18:24:35.000Z | 2016-04-13T18:24:35.000Z | src/test/java/com/outlook/test/BPM/TestCase_Outlook_Login_Invalid_On_Firefox.java | MarcusChang/WWE_LoginTestAuto | 657d3eb9f393225c3802c37083c46c658ae51e81 | [
"Apache-2.0"
]
| null | null | null | src/test/java/com/outlook/test/BPM/TestCase_Outlook_Login_Invalid_On_Firefox.java | MarcusChang/WWE_LoginTestAuto | 657d3eb9f393225c3802c37083c46c658ae51e81 | [
"Apache-2.0"
]
| null | null | null | 42.1875 | 193 | 0.744198 | 1,096 | package com.outlook.test.BPM;
import com.outlook.test.BPM.PageFactory.Outlook_Page_Dashboard;
import com.outlook.test.BPM.PageFactory.Outlook_Page_Login;
import com.outlook.test.BPM.TestParams.BaseTest;
import com.outlook.test.BPM.TestParams.ProjectParams;
import com.outlook.test.BPM.Utils.*;
import com.relevantcodes.extentreports.ExtentTest;
import com.relevantcodes.extentreports.LogStatus;
import org.junit.*;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
/**
* Created by Marcus_Chang on 2016/4/14.
*/
public class TestCase_Outlook_Login_Invalid_On_Firefox extends BaseTest {
private static WebDriver firefoxDriver;
private static Outlook_Page_Login OutlookPageLogin;
private static ReportsUtils report;
private static ScreenShotTaker capture;
private static ExtentTest logger;
private static TestUtilFunctions testUtil;
@Rule
public RetryTest retry = new RetryTest(3, firefoxDriver, logger, capture);
@BeforeClass
public static void init() {
//create the testUtilFunctions instance
testUtil = new TestUtilFunctions();
//initial DriverUtilFunctions.class,set the driver boot path in its constructor
new DriverUtilFunctions("Firefox");
DesiredCapabilities firefoxCapabilities = testUtil.setFirefoxDriverProperties();
//create a Firefox browser instance
firefoxDriver = new FirefoxDriver(firefoxCapabilities);
//Create the ReportsUtils instance
report = new ReportsUtils();
//Create the ScreenShotTaker instance
capture = new ScreenShotTaker();
//Begin to log the report details
logger = report.testLogger("TestCase_Outlook_Login_Invalid_On_Firefox");
//initial LogUtilFunctions.class,set the system level info log configuration by create the class instance
LogUtilFunctions logUtil = new LogUtilFunctions();
logUtil.setLoggerProperties("TestCase_Outlook_Login_Invalid_On_Firefox", ProjectParams.getTestCase_Outlook_Login_Invalid_On_Firefox_LayOut(), ProjectParams.getFireFoxDriverLocalPath());
OutlookPageLogin = new Outlook_Page_Login();
//Maximize the browser window
OutlookPageLogin.MaxPageWindow(firefoxDriver);
}
@Test
public void TestAction_Outlook_Login_Invalid_On_Firefox() {
//Action 1 : Open the Outlook login page
logger.log(LogStatus.INFO, "Begin the test and open the test login page.");
OutlookPageLogin.OpenTargetURL(firefoxDriver, ProjectParams.getOutlookURL());
//Grab all target web elements on the page : Outlook_Page_Login
OutlookPageLogin.getOutlookPageLoginElements(firefoxDriver);
//Assert the page title == [登陆]
Assert.assertTrue(OutlookPageLogin.Txt_PageTitle.equals("登录"));
logger.log(LogStatus.PASS, "Outlook Login Page Opened!");
//Input the user name & pass to login
OutlookPageLogin.cleanLoginPageInputTextArea(firefoxDriver, testUtil);
OutlookPageLogin.Ipt_UserName.sendKeys(ProjectParams.getLoginUserName_Invalid());
OutlookPageLogin.Ipt_PassWord.sendKeys(ProjectParams.getLoginUserPass_Invalid());
OutlookPageLogin.Btn_Login.click();
//Action 2 : verify the login action
logger.log(LogStatus.INFO, "Login the Outlook Failed and prepare to grab target alert elements on the page.");
//Grab all target web elements on the page : Outlook.com
OutlookPageLogin.getOutlookPageLoginElements(firefoxDriver);
//Assert the Popup alert errors
Assert.assertTrue(OutlookPageLogin.Txt_PopUserNameError.isDisplayed());
Assert.assertTrue(OutlookPageLogin.Txt_PopPassWordError.isDisplayed());
logger.log(LogStatus.FAIL, "Login Failed! Check the Login Username & Password. TestAction_Login -> Finished!");
}
@AfterClass
public static void tearDown() {
report.endTestLogger(logger);
firefoxDriver.quit();
}
}
|
3e02a98fddd61cd9846cc2f2c2a72ebbcfbb95ff | 694 | java | Java | model/src/main/java/com/github/zhangyanwei/sct/model/converter/JsonConverter.java | zhangyanwei/spring-cloud-template | 5b1ba07d507792eb3d0706ee2d83001dd4b68c6e | [
"MIT"
]
| 1 | 2019-11-07T07:26:15.000Z | 2019-11-07T07:26:15.000Z | model/src/main/java/com/github/zhangyanwei/sct/model/converter/JsonConverter.java | zhangyanwei/spring-cloud-template | 5b1ba07d507792eb3d0706ee2d83001dd4b68c6e | [
"MIT"
]
| null | null | null | model/src/main/java/com/github/zhangyanwei/sct/model/converter/JsonConverter.java | zhangyanwei/spring-cloud-template | 5b1ba07d507792eb3d0706ee2d83001dd4b68c6e | [
"MIT"
]
| null | null | null | 30.173913 | 78 | 0.763689 | 1,097 | package com.github.zhangyanwei.sct.model.converter;
import javax.persistence.AttributeConverter;
import static com.github.zhangyanwei.sct.common.utils.Json.readValue;
import static com.github.zhangyanwei.sct.common.utils.Json.writeValueAsString;
import static com.google.common.base.Strings.isNullOrEmpty;
abstract class JsonConverter<T> implements AttributeConverter<T, String> {
@Override
public String convertToDatabaseColumn(T attribute) {
return writeValueAsString(attribute);
}
@Override
public T convertToEntityAttribute(String data) {
return isNullOrEmpty(data) ? null : readValue(data, type());
}
abstract protected Class<T> type();
}
|
3e02aa87b96f45e84898ab0e966581606ed00819 | 726 | java | Java | asterix-modules/asterix/src/main/java/com/danimaniarqsoft/asterix/core/ModelOperationsService.java | danimaniarqsoft/asterix-gen | dc46a3c1e2bc362a6b6e43746567c6078625be0b | [
"MIT"
]
| null | null | null | asterix-modules/asterix/src/main/java/com/danimaniarqsoft/asterix/core/ModelOperationsService.java | danimaniarqsoft/asterix-gen | dc46a3c1e2bc362a6b6e43746567c6078625be0b | [
"MIT"
]
| null | null | null | asterix-modules/asterix/src/main/java/com/danimaniarqsoft/asterix/core/ModelOperationsService.java | danimaniarqsoft/asterix-gen | dc46a3c1e2bc362a6b6e43746567c6078625be0b | [
"MIT"
]
| null | null | null | 26.888889 | 92 | 0.783747 | 1,098 | package com.danimaniarqsoft.asterix.core;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.danimaniarqsoft.asterix.maven.MavenProject;
@Service
public class ModelOperationsService {
private static final Logger LOGGER = LoggerFactory.getLogger(ModelOperationsService.class);
@Autowired
private MavenProject mavenProject;
public String showModelList() {
LOGGER.info(mavenProject.getModelPath().getAbsolutePath());
StringBuilder sb = new StringBuilder();
for (String file : mavenProject.getModelPath().list()) {
sb.append(file);
sb.append("\n");
}
return sb.toString();
}
}
|
3e02ab2b3f5cf0c984c454feeb23570e2a2cc62b | 226 | java | Java | src/main/java/org/ldmud/jldmud/rt/net/package-info.java | lduening/jldmud | 10e91076247ed0534c19d1a1868d7b2fcd7ec930 | [
"MIT"
]
| 1 | 2017-01-29T14:20:59.000Z | 2017-01-29T14:20:59.000Z | src/main/java/org/ldmud/jldmud/rt/net/package-info.java | lduening/jldmud | 10e91076247ed0534c19d1a1868d7b2fcd7ec930 | [
"MIT"
]
| null | null | null | src/main/java/org/ldmud/jldmud/rt/net/package-info.java | lduening/jldmud | 10e91076247ed0534c19d1a1868d7b2fcd7ec930 | [
"MIT"
]
| null | null | null | 25.111111 | 87 | 0.70354 | 1,099 | /**
* Copyright (C) 2016 jLDMud Developers.
* This file is free software under the MIT License - see the file LICENSE for details.
*/
/**
* All classes directly related to network I/O.
*/
package org.ldmud.jldmud.rt.net; |
3e02ab3bf577976043d2f9a0f201af1d35bd1dd6 | 366 | java | Java | containment-core/src/main/java/com/spx/containment/chain/api/BOMItemView.java | mike-henry/containment | 7ab858f3a120b0aee476f6aec7fd81b65dce1a91 | [
"Apache-2.0"
]
| null | null | null | containment-core/src/main/java/com/spx/containment/chain/api/BOMItemView.java | mike-henry/containment | 7ab858f3a120b0aee476f6aec7fd81b65dce1a91 | [
"Apache-2.0"
]
| 6 | 2018-08-25T19:43:14.000Z | 2019-03-31T21:08:37.000Z | containment-core/src/main/java/com/spx/containment/chain/api/BOMItemView.java | mike-henry/containment | 7ab858f3a120b0aee476f6aec7fd81b65dce1a91 | [
"Apache-2.0"
]
| null | null | null | 19.263158 | 39 | 0.789617 | 1,100 | package com.spx.containment.chain.api;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@EqualsAndHashCode
@NoArgsConstructor
@AllArgsConstructor
public class BOMItemView {
private String productReference;
private int quantity;
}
|
3e02abe994492a1a4cb2e1ddd3fb3f5c863dc425 | 979 | java | Java | wemirr-platform-authority/src/main/java/com/wemirr/platform/authority/domain/dto/DictionaryItemDTO.java | lvpv/wemirr-platform | 33a23b4d74a2a8e6acf1d838efc8acec437d7d97 | [
"Apache-2.0"
]
| 22 | 2021-08-18T10:27:39.000Z | 2022-03-23T09:39:57.000Z | wemirr-platform-authority/src/main/java/com/wemirr/platform/authority/domain/dto/DictionaryItemDTO.java | lvpv/wemirr-platform | 33a23b4d74a2a8e6acf1d838efc8acec437d7d97 | [
"Apache-2.0"
]
| null | null | null | wemirr-platform-authority/src/main/java/com/wemirr/platform/authority/domain/dto/DictionaryItemDTO.java | lvpv/wemirr-platform | 33a23b4d74a2a8e6acf1d838efc8acec437d7d97 | [
"Apache-2.0"
]
| 4 | 2021-09-27T06:47:56.000Z | 2022-02-23T14:04:59.000Z | 19.58 | 50 | 0.610827 | 1,101 | package com.wemirr.platform.authority.domain.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/**
* @author Levin
*/
@Data
public class DictionaryItemDTO {
/**
* 编码
* 一颗树仅仅有一个统一的编码
*/
@Schema(description = "值")
@NotBlank(message = "值不能为空")
@Length(max = 64, message = "值的长度不能超过{max}")
private String value;
/**
* 名称
*/
@Schema(description = "名称")
@NotBlank(message = "名称不能为空")
@Length(max = 64, message = "名称长度不能超过{max}")
private String label;
/**
* 描述
*/
@Schema(description = "描述")
@Length(max = 200, message = "描述长度不能超过{max}")
private String description;
@Schema(description = "颜色")
@Length(max = 20, message = "颜色长度不能超过{max}")
private String color;
/**
* 状态
*/
@Schema(description = "状态")
private Boolean status;
}
|
3e02ac2602e64e06f0c227b8b42f3fd4dd6656d0 | 1,386 | java | Java | src/main/java/com/crowsofwar/gorecore/tree/test/TestSendMessage.java | WitchTime/WitchTime | a4422baf557badddb0fcbfaac3a1f77990e21924 | [
"Apache-2.0",
"MIT"
]
| null | null | null | src/main/java/com/crowsofwar/gorecore/tree/test/TestSendMessage.java | WitchTime/WitchTime | a4422baf557badddb0fcbfaac3a1f77990e21924 | [
"Apache-2.0",
"MIT"
]
| null | null | null | src/main/java/com/crowsofwar/gorecore/tree/test/TestSendMessage.java | WitchTime/WitchTime | a4422baf557badddb0fcbfaac3a1f77990e21924 | [
"Apache-2.0",
"MIT"
]
| null | null | null | 26.653846 | 76 | 0.751082 | 1,102 | /*
This file is part of AvatarMod.
AvatarMod is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
AvatarMod is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with AvatarMod. If not, see <http://www.gnu.org/licenses/>.
*/
package com.crowsofwar.gorecore.tree.test;
import java.util.List;
import com.crowsofwar.gorecore.format.FormattedMessage;
import com.crowsofwar.gorecore.tree.CommandCall;
import com.crowsofwar.gorecore.tree.ICommandNode;
import com.crowsofwar.gorecore.tree.NodeFunctional;
/**
*
*
* @author CrowsOfWar
*/
public class TestSendMessage extends NodeFunctional {
private final FormattedMessage message;
/**
* @param name
* @param op
*/
public TestSendMessage(String name, FormattedMessage message) {
super(name, false);
this.message = message;
}
@Override
protected ICommandNode doFunction(CommandCall call, List<String> options) {
message.send(call.getFrom());
return null;
}
}
|
3e02aca7bad179acfd4a2017c06b519996e4dc0d | 1,280 | java | Java | src/main/java/com/eyesfly/service/impl/ResourceService.java | Eyesfly/cms | 3cf70ed4b5f3669a04e41ab5e2aecefbed68efcc | [
"MIT"
]
| null | null | null | src/main/java/com/eyesfly/service/impl/ResourceService.java | Eyesfly/cms | 3cf70ed4b5f3669a04e41ab5e2aecefbed68efcc | [
"MIT"
]
| null | null | null | src/main/java/com/eyesfly/service/impl/ResourceService.java | Eyesfly/cms | 3cf70ed4b5f3669a04e41ab5e2aecefbed68efcc | [
"MIT"
]
| null | null | null | 27.826087 | 66 | 0.752344 | 1,103 | package com.eyesfly.service.impl;
import com.eyesfly.entity.Resource;
import com.eyesfly.mapper.ResourceMapper;
import com.eyesfly.service.IResourceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Created by Administrator on 2016/5/31.
*/
@Service("resourceService")
public class ResourceService implements IResourceService{
@Autowired
private ResourceMapper resourceMapper;
public int deleteByPrimaryKey(Long id) {
return resourceMapper.deleteByPrimaryKey(id);
}
public int insert(Resource record) {
return resourceMapper.insert(record);
}
public int insertSelective(Resource record) {
return resourceMapper.insertSelective(record);
}
public Resource selectByPrimaryKey(Long id) {
return resourceMapper.selectByPrimaryKey(id);
}
public int updateByPrimaryKeySelective(Resource record) {
return resourceMapper.updateByPrimaryKeySelective(record);
}
public int updateByPrimaryKey(Resource record) {
return resourceMapper.updateByPrimaryKey(record);
}
public List<String> findPermissions(String username) {
return resourceMapper.findPermissions(username);
}
}
|
3e02ad494e7337ee047dcf5912cef8c7cdbf029a | 142 | java | Java | mlo-srv/src/main/java/org/o3project/mlo/server/rpc/service/package-info.java | o3project/mlo-net | 7df9af392e6b430c1c276b91eb6a75d6dfc916b8 | [
"Apache-2.0"
]
| 4 | 2015-03-17T06:21:59.000Z | 2016-08-13T01:21:28.000Z | mlo-srv/src/main/java/org/o3project/mlo/server/rpc/service/package-info.java | o3project/mlo-net | 7df9af392e6b430c1c276b91eb6a75d6dfc916b8 | [
"Apache-2.0"
]
| null | null | null | mlo-srv/src/main/java/org/o3project/mlo/server/rpc/service/package-info.java | o3project/mlo-net | 7df9af392e6b430c1c276b91eb6a75d6dfc916b8 | [
"Apache-2.0"
]
| 3 | 2015-04-08T02:57:18.000Z | 2019-07-17T06:17:17.000Z | 23.666667 | 86 | 0.774648 | 1,104 |
/**
* This package provides interfaces and classes to communicate with external services.
*/
package org.o3project.mlo.server.rpc.service;
|
3e02ad7b5575267fb6eb6bcc43c1c5f344b61231 | 288 | java | Java | test-suite/src/test/java/io/micronaut/docs/replaces/qualifiers/named/beans/SomeInterfaceReplaceNamedImplTwo.java | altro3/micronaut-core | d166511ce28f208f045553f04a5fedb709a6fd28 | [
"Apache-2.0"
]
| null | null | null | test-suite/src/test/java/io/micronaut/docs/replaces/qualifiers/named/beans/SomeInterfaceReplaceNamedImplTwo.java | altro3/micronaut-core | d166511ce28f208f045553f04a5fedb709a6fd28 | [
"Apache-2.0"
]
| null | null | null | test-suite/src/test/java/io/micronaut/docs/replaces/qualifiers/named/beans/SomeInterfaceReplaceNamedImplTwo.java | altro3/micronaut-core | d166511ce28f208f045553f04a5fedb709a6fd28 | [
"Apache-2.0"
]
| null | null | null | 20.571429 | 84 | 0.784722 | 1,105 | package io.micronaut.docs.replaces.qualifiers.named.beans;
import jakarta.inject.Named;
import jakarta.inject.Singleton;
@Named("two")
@Singleton
public class SomeInterfaceReplaceNamedImplTwo implements SomeInterfaceReplaceNamed {
@Override
public void doSomething() {
}
}
|
3e02affdab4cad8372919ba2eb55e557e246a727 | 970 | java | Java | jersey2-simple-example/src/main/java/org/jersey2/simple/basic/resource/HeaderParamRestService.java | ameizi/jersey2-restfull-examples | 6032c3d2b01f3e7507fe1275fafc2c7ff6a80e7a | [
"MIT"
]
| 3 | 2016-12-28T02:09:12.000Z | 2018-02-03T03:11:54.000Z | jersey2-simple-example/src/main/java/org/jersey2/simple/basic/resource/HeaderParamRestService.java | ameizi/jersey2-restfull-examples | 6032c3d2b01f3e7507fe1275fafc2c7ff6a80e7a | [
"MIT"
]
| null | null | null | jersey2-simple-example/src/main/java/org/jersey2/simple/basic/resource/HeaderParamRestService.java | ameizi/jersey2-restfull-examples | 6032c3d2b01f3e7507fe1275fafc2c7ff6a80e7a | [
"MIT"
]
| null | null | null | 20.208333 | 71 | 0.689691 | 1,106 | package org.jersey2.simple.basic.resource;
import javax.ws.rs.GET;
import javax.ws.rs.HeaderParam;
import javax.ws.rs.Path;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.Response;
@Path("/userAgent")
public class HeaderParamRestService {
/**
* HeaderParam Example
* http://localhost:8080/v1/api/userAgent/v1
* @param userAgent
* @return
*/
@GET
@Path("/v1")
public Response addUser(@HeaderParam("user-agent") String userAgent) {
return Response.status(200)
.entity("addUser is called, userAgent : " + userAgent)
.build();
}
/**
* Context Example
* http://localhost:8080/v1/api/userAgent/v2
* @param headers
* @return
*/
@GET
@Path("/v2")
public Response addUser(@Context HttpHeaders headers) {
String userAgent = headers.getRequestHeader("user-agent").get(0);
return Response.status(200)
.entity("addUser is called, userAgent : " + userAgent)
.build();
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.