id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
14,701
} return attachmentUri; }</BUG> public static Attachment createAttachment(ObjectFactory objectFactory, URI baseUri, <BUG>com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl, XWiki xwikiApi, Boolean withPrettyNames) {</BUG> Attachment attachment = objectFactory.createAttachment(); fillAttachment(attachment, objectFactory, baseUri, xwikiAttachment, xwikiRelativeUrl, xwikiAbsoluteUrl,
com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl, XWiki xwikiApi, {
14,702
attachmentLink.setRel(Relations.ATTACHMENT_DATA); attachment.getLinks().add(attachmentLink); return attachment; } public static Attachment createAttachmentAtVersion(ObjectFactory objectFactory, URI baseUri, <BUG>com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl, XWiki xwikiApi, Boolean withPrettyNames) {</BUG> Attachment attachment = new Attachment();
com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl, XWiki xwikiApi, {
14,703
.build(doc.getWiki(), doc.getSpace(), doc.getName(), doc.getVersion(), xwikiObject.getClassName(), xwikiObject.getNumber()).toString();</BUG> } else { <BUG>propertiesUri = UriBuilder .fromUri(baseUri) .path(ObjectPropertiesResource.class) .build(doc.getWiki(), doc.getSpace(), doc.getName(), xwikiObject.getClassName(), xwikiObject.getNumber()).toString();</BUG> }
fillObjectSummary(objectSummary, objectFactory, baseUri, doc, xwikiObject, xwikiApi, withPrettyNames); Link objectLink = getObjectLink(objectFactory, baseUri, doc, xwikiObject, useVersion, Relations.OBJECT); objectSummary.getLinks().add(objectLink); String propertiesUri; if (useVersion) { uri(baseUri, ObjectPropertiesAtPageVersionResource.class, doc.getWiki(), doc.getSpace(), doc.getName(), doc.getVersion(), xwikiObject.getClassName(), xwikiObject.getNumber()); uri(baseUri, ObjectPropertiesResource.class, doc.getWiki(), doc.getSpace(), doc.getName(), xwikiObject.getClassName(), xwikiObject.getNumber());
14,704
.build(doc.getWiki(), doc.getSpace(), doc.getName(), doc.getVersion(), xwikiObject.getClassName(), xwikiObject.getNumber(), propertyClass.getName()) .toString();</BUG> } else { <BUG>propertyUri = UriBuilder .fromUri(baseUri) .path(ObjectPropertyResource.class) .build(doc.getWiki(), doc.getSpace(), doc.getName(), xwikiObject.getClassName(), xwikiObject.getNumber(), propertyClass.getName()).toString();</BUG> }
propertiesUri = uri(baseUri, ObjectPropertiesResource.class, doc.getWiki(), doc.getSpace(), doc.getName(), xwikiObject.getClassName(), xwikiObject.getNumber());
14,705
.build(doc.getWiki(), doc.getSpace(), doc.getName(), doc.getVersion(), xwikiObject.getClassName(), xwikiObject.getNumber()).toString();</BUG> } else { <BUG>objectUri = UriBuilder .fromUri(baseUri) .path(ObjectResource.class) .build(doc.getWiki(), doc.getSpace(), doc.getName(), xwikiObject.getClassName(), xwikiObject.getNumber()).toString();</BUG> }
private static Link getObjectLink(ObjectFactory objectFactory, URI baseUri, Document doc, BaseObject xwikiObject, boolean useVersion, String relation) String objectUri; if (useVersion) { uri(baseUri, ObjectAtPageVersionResource.class, doc.getWiki(), doc.getSpace(), doc.getName(), doc.getVersion(), xwikiObject.getClassName(), xwikiObject.getNumber()); uri(baseUri, ObjectResource.class, doc.getWiki(), doc.getSpace(), doc.getName(), xwikiObject.getClassName(), xwikiObject.getNumber());
14,706
Link propertyLink = objectFactory.createLink(); propertyLink.setHref(propertyUri); propertyLink.setRel(Relations.SELF); property.getLinks().add(propertyLink); clazz.getProperties().add(property); <BUG>} String classUri = UriBuilder.fromUri(baseUri).path(ClassResource.class).build(wikiName, xwikiClass.getName()).toString();</BUG> Link classLink = objectFactory.createLink(); classLink.setHref(classUri);
String classUri = uri(baseUri, ClassResource.class, wikiName, xwikiClass.getName());
14,707
String classUri = UriBuilder.fromUri(baseUri).path(ClassResource.class).build(wikiName, xwikiClass.getName()).toString();</BUG> Link classLink = objectFactory.createLink(); classLink.setHref(classUri); classLink.setRel(Relations.SELF); <BUG>clazz.getLinks().add(classLink); String propertiesUri = UriBuilder.fromUri(baseUri).path(ClassPropertiesResource.class).build(wikiName, xwikiClass.getName()) .toString();</BUG> Link propertyLink = objectFactory.createLink();
propertyLink.setHref(propertyUri); propertyLink.setRel(Relations.SELF); property.getLinks().add(propertyLink); clazz.getProperties().add(property); } String classUri = uri(baseUri, ClassResource.class, wikiName, xwikiClass.getName()); String propertiesUri = uri(baseUri, ClassPropertiesResource.class, wikiName, xwikiClass.getName());
14,708
<BUG>package org.xwiki.rest.internal; import org.apache.commons.lang3.StringUtils;</BUG> import org.xwiki.component.manager.ComponentManager; import org.xwiki.context.Execution; import org.xwiki.model.reference.EntityReferenceSerializer;
import java.net.URI; import javax.ws.rs.core.UriBuilder; import org.apache.commons.httpclient.URIException; import org.apache.commons.httpclient.util.URIUtil; import org.apache.commons.lang3.StringUtils;
14,709
return switchStatementAssignsVariable(switchStatement, variable, stamp, checkedMethods); } else if(statement instanceof PsiSwitchLabelStatement){ return false; } else{ <BUG>throw new RuntimeException("unknown statement: " + statement); }</BUG> } private boolean switchStatementAssignsVariable( @NotNull PsiSwitchStatement switchStatement,
assert false : "unknown statement: " + statement;
14,710
private boolean referenceExpressionAssignsVariable( @NotNull PsiReferenceExpression referenceExpression, @NotNull PsiVariable variable, int stamp, @NotNull Set<MethodSignature> checkedMethods) { final PsiExpression qualifierExpression = <BUG>referenceExpression.getQualifierExpression(); if(variable.equals(referenceExpression.resolve())){</BUG> final PsiElement parent = referenceExpression.getParent(); if(parent instanceof PsiAssignmentExpression){ final PsiAssignmentExpression assignmentExpression =
if (expressionAssignsVariable(qualifierExpression, variable, stamp, checkedMethods)) { return true; } if(variable.equals(referenceExpression.resolve())){
14,711
for(final PsiExpression argument : arguments){ if(expressionAssignsVariable(argument, variable, stamp, checkedMethods)){ return true; } <BUG>} final PsiReferenceExpression methodExpression = callExpression.getMethodExpression(); if(expressionAssignsVariable(methodExpression, variable, stamp, checkedMethods)) { return true;</BUG> }
[DELETED]
14,712
import com.github.reinert.jjschema.ManagedReference; import java.util.Collection; import java.util.Set; public class ArraySchemaWrapper extends SchemaWrapper { final SchemaWrapper itemsSchemaWrapper; <BUG>public ArraySchemaWrapper(Class<?> type, Class<?> parametrizedType, Set<ManagedReference> managedReferences, String relativeId) { </BUG> super(type); setType("array"); if (parametrizedType != null) {
public ArraySchemaWrapper(Class<?> type, Class<?> parametrizedType, Set<ManagedReference> managedReferences, String relativeId, boolean ignoreProperties) {
14,713
if (!Collection.class.isAssignableFrom(type)) throw new RuntimeException("Cannot instantiate a SchemaWrapper of a non Collection class with a Parametrized Type."); if (managedReferences == null) this.itemsSchemaWrapper = SchemaWrapperFactory.createWrapper(parametrizedType); else <BUG>this.itemsSchemaWrapper = SchemaWrapperFactory.createWrapper(parametrizedType, managedReferences, relativeId); </BUG> setItems(this.itemsSchemaWrapper.asJson()); } else { this.itemsSchemaWrapper = null;
this.itemsSchemaWrapper = SchemaWrapperFactory.createWrapper(parametrizedType, managedReferences, relativeId, ignoreProperties);
14,714
this(type, parametrizedType, managedReferences, null); </BUG> } <BUG>public ArraySchemaWrapper(Class<?> type, Class<?> parametrizedType) { this(type, parametrizedType, null); </BUG> } public ArraySchemaWrapper(Class<?> type, RefSchemaWrapper refSchemaWrapper) {
setItems(this.itemsSchemaWrapper.asJson()); } else { this.itemsSchemaWrapper = null; public ArraySchemaWrapper(Class<?> type, Class<?> parametrizedType, Set<ManagedReference> managedReferences, boolean ignoreProperties) { this(type, parametrizedType, managedReferences, null, ignoreProperties); public ArraySchemaWrapper(Class<?> type, Class<?> parametrizedType, boolean ignoreProperties) { this(type, parametrizedType, null, ignoreProperties);
14,715
public boolean isCustomWrapper() { return true; } @Override public Iterator<PropertyWrapper> iterator() { <BUG>return propertyWrappers.iterator(); }</BUG> protected void processProperties() { HashMap<Method, Field> properties = findProperties(); for (Entry<Method, Field> prop : properties.entrySet()) {
return propertyWrappers != null ? propertyWrappers.iterator() : Collections.<PropertyWrapper>emptyIterator();
14,716
public static final ObjectMapper MAPPER = new ObjectMapper(); private SchemaWrapperFactory() {} public static SchemaWrapper createWrapper(Class<?> type) { return createWrapper(type, null); } <BUG>public static SchemaWrapper createArrayWrapper(Class<?> type, Class<?> parametrizedType) { return new ArraySchemaWrapper(type, parametrizedType); </BUG> }
public static SchemaWrapper createArrayWrapper(Class<?> type, Class<?> parametrizedType, boolean ignoreProperties) { return new ArraySchemaWrapper(type, parametrizedType, ignoreProperties);
14,717
import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; import com.github.reinert.jjschema.Attributes; import com.github.reinert.jjschema.ManagedReference; import com.github.reinert.jjschema.Nullable; <BUG>import com.github.reinert.jjschema.SchemaIgnore; import java.lang.reflect.AccessibleObject;</BUG> import java.lang.reflect.Field; import java.lang.reflect.Method; import java.lang.reflect.ParameterizedType;
import com.github.reinert.jjschema.SchemaIgnoreProperties; import java.lang.reflect.AccessibleObject;
14,718
relativeId = propertiesStr + getName() + itemsStr; } else { relativeId = propertiesStr + getName(); } processReference(propertyType); <BUG>if (getAccessibleObject().getAnnotation(SchemaIgnore.class) != null) { this.schemaWrapper = new EmptySchemaWrapper();</BUG> } else if (getReferenceType() == ReferenceType.BACKWARD) { SchemaWrapper schemaWrapperLocal; String id = processId(method.getReturnType());
if (shouldIgnoreField()) { this.schemaWrapper = new EmptySchemaWrapper();
14,719
import org.apache.hadoop.yarn.ipc.RPCUtil; import org.apache.hadoop.yarn.ipc.YarnRPC; import org.apache.hadoop.yarn.server.api.ResourceManagerAdministrationProtocol; import org.apache.hadoop.yarn.server.api.protocolrecords.AddToClusterNodeLabelsRequest; import org.apache.hadoop.yarn.server.api.protocolrecords.AddToClusterNodeLabelsResponse; <BUG>import org.apache.hadoop.yarn.api.protocolrecords.GetClusterNodeLabelsRequest; import org.apache.hadoop.yarn.api.protocolrecords.GetClusterNodeLabelsResponse; import org.apache.hadoop.yarn.api.protocolrecords.GetNodesToLabelsRequest; import org.apache.hadoop.yarn.api.protocolrecords.GetNodesToLabelsResponse;</BUG> import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshAdminAclsRequest;
[DELETED]
14,720
import org.apache.hadoop.yarn.server.api.protocolrecords.RemoveFromClusterNodeLabelsResponse; import org.apache.hadoop.yarn.server.api.protocolrecords.ReplaceLabelsOnNodeRequest; import org.apache.hadoop.yarn.server.api.protocolrecords.ReplaceLabelsOnNodeResponse; import org.apache.hadoop.yarn.server.api.protocolrecords.UpdateNodeResourceRequest; import org.apache.hadoop.yarn.server.api.protocolrecords.UpdateNodeResourceResponse; <BUG>import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.GetClusterNodeLabelsResponsePBImpl; import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.GetNodesToLabelsResponsePBImpl;</BUG> import org.apache.hadoop.yarn.server.resourcemanager.reservation.ReservationSystem; import org.apache.hadoop.yarn.server.resourcemanager.rmnode.RMNode; import org.apache.hadoop.yarn.server.resourcemanager.rmnode.RMNodeResourceUpdateEvent;
[DELETED]
14,721
return ret; } @Override public RefreshQueuesResponse refreshQueues(RefreshQueuesRequest request) throws YarnException, StandbyException { <BUG>String argName = "refreshQueues"; UserGroupInformation user = checkAcls(argName); if (!isRMActive()) { RMAuditLogger.logFailure(user.getShortUserName(), argName, adminAcl.toString(), "AdminService", "ResourceManager is not active. Can not refresh queues."); throwStandbyException(); }</BUG> RefreshQueuesResponse response =
final String msg = "refresh queues."; checkRMStatus(user.getShortUserName(), argName, msg);
14,722
YarnConfiguration.YARN_SITE_CONFIGURATION_FILE); rmContext.getNodesListManager().refreshNodes(conf); RMAuditLogger.logSuccess(user.getShortUserName(), argName, "AdminService"); return recordFactory.newRecordInstance(RefreshNodesResponse.class); <BUG>} catch (IOException ioe) { LOG.info("Exception refreshing nodes ", ioe); RMAuditLogger.logFailure(user.getShortUserName(), argName, adminAcl.toString(), "AdminService", "Exception refreshing nodes"); throw RPCUtil.getRemoteException(ioe);</BUG> }
throw logAndWrapException(ioe, user.getShortUserName(), argName, msg);
14,723
return refreshAdminAcls(true); } private RefreshAdminAclsResponse refreshAdminAcls(boolean checkRMHAState) throws YarnException, IOException { String argName = "refreshAdminAcls"; <BUG>UserGroupInformation user = checkAcls(argName); if (checkRMHAState && !isRMActive()) { RMAuditLogger.logFailure(user.getShortUserName(), argName, adminAcl.toString(), "AdminService", "ResourceManager is not active. Can not refresh user-groups."); throwStandbyException();</BUG> }
if (checkRMHAState) { checkRMStatus(user.getShortUserName(), argName, "refresh Admin ACLs.");
14,724
throw RPCUtil.getRemoteException( new IOException("Service Authorization (" + CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHORIZATION + ") not enabled.")); } <BUG>String argName = "refreshServiceAcls"; if (!isRMActive()) { RMAuditLogger.logFailure(UserGroupInformation.getCurrentUser() .getShortUserName(), argName, adminAcl.toString(), "AdminService", "ResourceManager is not active. Can not refresh Service ACLs."); throwStandbyException(); }</BUG> PolicyProvider policyProvider = RMPolicyProvider.getInstance();
UserGroupInformation user = checkAcls(argName); checkRMStatus(user.getShortUserName(), argName, "refresh Service ACLs.");
14,725
return this.server; } @Override public AddToClusterNodeLabelsResponse addToClusterNodeLabels(AddToClusterNodeLabelsRequest request) throws YarnException, IOException { <BUG>String argName = "addToClusterNodeLabels"; UserGroupInformation user = checkAcls(argName); if (!isRMActive()) { RMAuditLogger.logFailure(user.getShortUserName(), argName, adminAcl.toString(), "AdminService", "ResourceManager is not active. Can not add labels."); throwStandbyException(); }</BUG> AddToClusterNodeLabelsResponse response =
final String msg = "add labels."; checkRMStatus(user.getShortUserName(), argName, msg);
14,726
try { rmContext.getNodeLabelManager().addToCluserNodeLabels(request.getNodeLabels()); RMAuditLogger .logSuccess(user.getShortUserName(), argName, "AdminService"); return response; <BUG>} catch (IOException ioe) { LOG.info("Exception add labels", ioe); RMAuditLogger.logFailure(user.getShortUserName(), argName, adminAcl.toString(), "AdminService", "Exception add label"); throw RPCUtil.getRemoteException(ioe);</BUG> }
throw logAndWrapException(ioe, user.getShortUserName(), argName, msg);
14,727
} } @Override public RemoveFromClusterNodeLabelsResponse removeFromClusterNodeLabels( RemoveFromClusterNodeLabelsRequest request) throws YarnException, IOException { <BUG>String argName = "removeFromClusterNodeLabels"; UserGroupInformation user = checkAcls(argName); if (!isRMActive()) { RMAuditLogger.logFailure(user.getShortUserName(), argName, adminAcl.toString(), "AdminService", "ResourceManager is not active. Can not remove labels."); throwStandbyException(); }</BUG> RemoveFromClusterNodeLabelsResponse response =
final String msg = "remove labels."; checkRMStatus(user.getShortUserName(), argName, msg);
14,728
try { rmContext.getNodeLabelManager().removeFromClusterNodeLabels(request.getNodeLabels()); RMAuditLogger .logSuccess(user.getShortUserName(), argName, "AdminService"); return response; <BUG>} catch (IOException ioe) { LOG.info("Exception remove labels", ioe); RMAuditLogger.logFailure(user.getShortUserName(), argName, adminAcl.toString(), "AdminService", "Exception remove label"); throw RPCUtil.getRemoteException(ioe);</BUG> }
throw logAndWrapException(ioe, user.getShortUserName(), argName, msg);
14,729
} } @Override public ReplaceLabelsOnNodeResponse replaceLabelsOnNode( ReplaceLabelsOnNodeRequest request) throws YarnException, IOException { <BUG>String argName = "replaceLabelsOnNode"; UserGroupInformation user = checkAcls(argName); if (!isRMActive()) { RMAuditLogger.logFailure(user.getShortUserName(), argName, adminAcl.toString(), "AdminService", "ResourceManager is not active. Can not set node to labels."); throwStandbyException(); }</BUG> ReplaceLabelsOnNodeResponse response =
final String msg = "set node to labels."; checkRMStatus(user.getShortUserName(), argName, msg);
14,730
request.getNodeToLabels()); RMAuditLogger .logSuccess(user.getShortUserName(), argName, "AdminService"); return response; } catch (IOException ioe) { <BUG>LOG.info("Exception set node to labels. ", ioe); RMAuditLogger.logFailure(user.getShortUserName(), argName, adminAcl.toString(), "AdminService", "Exception set node to labels."); throw RPCUtil.getRemoteException(ioe); </BUG> }
throw logAndWrapException(ioe, user.getShortUserName(), argName, msg);
14,731
wrapper.setNativeRange(NativeRange.newInstance(doc)); } NativeRange nativeRange = wrapper.getNativeRange().cast(); nativeRange.setStart(range.getStartContainer(), range.getStartOffset()); nativeRange.setEnd(range.getEndContainer(), range.getEndOffset()); <BUG>getNativeSelection().addRange(nativeRange); DOMUtils.getInstance().scrollIntoView(range); }</BUG> @Override
selection.addRange(nativeRange);
14,732
if (localRoot == null) localRoot = localFile; if (localRoot.equals(localFile)) localPathPrefix = ""; else <BUG>localPathPrefix = IOUtil.getRelativePath(localRoot, localFile).replace(FILE_SEPARATOR_CHAR, '/'); }</BUG> assertLocalRootNotNull(); } protected void assertLocalRootNotNull() {
if (! localPathPrefix.isEmpty() && ! localPathPrefix.startsWith("/")) localPathPrefix = "/" + localPathPrefix;
14,733
package co.codewizards.cloudstore.core.repo.transport; import java.net.URL; import java.util.Date; import java.util.UUID; <BUG>import co.codewizards.cloudstore.core.dto.ChangeSetDto; import co.codewizards.cloudstore.core.dto.DirectoryDto;</BUG> import co.codewizards.cloudstore.core.dto.NormalFileDto; import co.codewizards.cloudstore.core.dto.RepoFileDto; import co.codewizards.cloudstore.core.dto.RepositoryDto;
import co.codewizards.cloudstore.core.dto.ConfigPropSetDto; import co.codewizards.cloudstore.core.dto.DirectoryDto;
14,734
import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement public class ChangeSetDto { private RepositoryDto repositoryDto; private List<ModificationDto> modificationDtos; <BUG>private List<RepoFileDto> repoFileDtos; public RepositoryDto getRepositoryDto() {</BUG> return repositoryDto; } public void setRepositoryDto(RepositoryDto repositoryDto) {
private ConfigPropSetDto parentConfigPropSetDto; public RepositoryDto getRepositoryDto() {
14,735
import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; import org.slf4j.Logger; import org.slf4j.LoggerFactory; <BUG>import co.codewizards.cloudstore.core.dto.ChangeSetDto; import co.codewizards.cloudstore.core.dto.CopyModificationDto;</BUG> import co.codewizards.cloudstore.core.dto.DeleteModificationDto; import co.codewizards.cloudstore.core.dto.DirectoryDto; import co.codewizards.cloudstore.core.dto.FileChunkDto;
import co.codewizards.cloudstore.core.dto.ConfigPropSetDto; import co.codewizards.cloudstore.core.dto.CopyModificationDto;
14,736
import java.util.Properties; import java.util.regex.Matcher; import java.util.regex.Pattern; import co.codewizards.cloudstore.core.appid.AppIdRegistry; public interface Config { <BUG>String APP_ID_SIMPLE_ID = AppIdRegistry.getInstance().getAppIdOrFail().getSimpleId(); String PROPERTIES_FILE_NAME_FOR_DIRECTORY_LOCAL = '.' + APP_ID_SIMPLE_ID + ".local.properties"; String SYSTEM_PROPERTY_PREFIX = APP_ID_SIMPLE_ID + '.';</BUG> String getProperty(final String key, final String defaultValue);
String PROPERTIES_FILE_NAME_SUFFIX = ".properties"; String PROPERTIES_FILE_NAME_FOR_DIRECTORY_LOCAL = '.' + APP_ID_SIMPLE_ID + ".local" + PROPERTIES_FILE_NAME_SUFFIX; String PROPERTIES_FILE_NAME_FOR_DIRECTORY = '.' + APP_ID_SIMPLE_ID + PROPERTIES_FILE_NAME_SUFFIX; String PROPERTIES_FILE_NAME_PARENT_PREFIX = "parent."; String PROPERTIES_FILE_NAME_PARENT = "parent" + PROPERTIES_FILE_NAME_SUFFIX; String SYSTEM_PROPERTY_PREFIX = APP_ID_SIMPLE_ID + '.';
14,737
package co.codewizards.cloudstore.core.dto.jaxb; import co.codewizards.cloudstore.core.auth.EncryptedSignedAuthToken; <BUG>import co.codewizards.cloudstore.core.dto.ChangeSetDto; import co.codewizards.cloudstore.core.dto.CopyModificationDto;</BUG> import co.codewizards.cloudstore.core.dto.DeleteModificationDto; import co.codewizards.cloudstore.core.dto.DirectoryDto; import co.codewizards.cloudstore.core.dto.Error;
import co.codewizards.cloudstore.core.dto.ConfigPropSetDto; import co.codewizards.cloudstore.core.dto.CopyModificationDto;
14,738
import co.codewizards.cloudstore.core.dto.UidList; public class CloudStoreJaxbContextProviderImpl extends AbstractCloudStoreJaxbContextProvider { @Override public Class<?>[] getClassesToBeBound() { return new Class<?>[] { <BUG>ChangeSetDto.class, CopyModificationDto.class,</BUG> DeleteModificationDto.class, DirectoryDto.class, EncryptedSignedAuthToken.class,
ConfigPropSetDto.class, CopyModificationDto.class,
14,739
import org.apache.sling.jcr.resource.JcrResourceConstants; import org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl; import org.apache.sling.jcr.resource.internal.helper.MapEntries; import org.apache.sling.jcr.resource.internal.helper.Mapping; import org.apache.sling.performance.annotation.PerformanceTestSuite; <BUG>import org.apache.sling.performance.tests.ResolveNonExistingWith10000AliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWith10000VanityPathTest; import org.apache.sling.performance.tests.ResolveNonExistingWith1000AliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWith1000VanityPathTest; import org.apache.sling.performance.tests.ResolveNonExistingWith5000AliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWith5000VanityPathTest;</BUG> import org.junit.runner.RunWith;
import org.apache.sling.performance.tests.ResolveNonExistingWithManyAliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWithManyVanityPathTest;
14,740
@PerformanceTestSuite public ParameterizedTestList testPerformance() throws Exception { Helper helper = new Helper(); ParameterizedTestList testCenter = new ParameterizedTestList(); testCenter.setTestSuiteTitle("jcr.resource-2.0.10"); <BUG>testCenter.addTestObject(new ResolveNonExistingWith1000VanityPathTest(helper)); testCenter.addTestObject(new ResolveNonExistingWith5000VanityPathTest(helper)); testCenter.addTestObject(new ResolveNonExistingWith10000VanityPathTest(helper)); testCenter.addTestObject(new ResolveNonExistingWith1000AliasTest(helper)); testCenter.addTestObject(new ResolveNonExistingWith5000AliasTest(helper)); testCenter.addTestObject(new ResolveNonExistingWith10000AliasTest(helper)); </BUG> return testCenter;
testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith1000VanityPathTest",helper, 100, 10)); testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith5000VanityPathTest",helper, 100, 50)); testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith10000VanityPathTest",helper, 100, 100)); testCenter.addTestObject(new ResolveNonExistingWithManyAliasTest("ResolveNonExistingWithManyAliasTest",helper, 1000)); testCenter.addTestObject(new ResolveNonExistingWithManyAliasTest("ResolveNonExistingWith5000AliasTest",helper, 5000)); testCenter.addTestObject(new ResolveNonExistingWithManyAliasTest("ResolveNonExistingWith10000AliasTest",helper, 10000));
14,741
package org.apache.sling.performance; <BUG>import static org.mockito.Mockito.*; import javax.jcr.NamespaceRegistry;</BUG> import javax.jcr.Session; import junitx.util.PrivateAccessor;
import static org.mockito.Mockito.when; import static org.mockito.Mockito.mock; import javax.jcr.NamespaceRegistry;
14,742
import org.apache.sling.jcr.resource.JcrResourceConstants; import org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl; import org.apache.sling.jcr.resource.internal.helper.MapEntries; import org.apache.sling.jcr.resource.internal.helper.Mapping; import org.apache.sling.performance.annotation.PerformanceTestSuite; <BUG>import org.apache.sling.performance.tests.ResolveNonExistingWith10000AliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWith10000VanityPathTest; import org.apache.sling.performance.tests.ResolveNonExistingWith1000AliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWith1000VanityPathTest; import org.apache.sling.performance.tests.ResolveNonExistingWith5000AliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWith5000VanityPathTest;</BUG> import org.junit.runner.RunWith;
import org.apache.sling.performance.tests.ResolveNonExistingWithManyAliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWithManyVanityPathTest;
14,743
import org.apache.sling.api.resource.ResourceResolver; import org.apache.sling.jcr.api.SlingRepository; import org.apache.sling.jcr.resource.JcrResourceConstants; import org.apache.sling.jcr.resource.internal.helper.jcr.JcrResourceProviderFactory; import org.apache.sling.performance.annotation.PerformanceTestSuite; <BUG>import org.apache.sling.performance.tests.ResolveNonExistingWith10000AliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWith10000VanityPathTest; import org.apache.sling.performance.tests.ResolveNonExistingWith1000AliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWith1000VanityPathTest; import org.apache.sling.performance.tests.ResolveNonExistingWith5000AliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWith5000VanityPathTest;</BUG> import org.apache.sling.resourceresolver.impl.ResourceResolverFactoryActivator;
import org.apache.sling.performance.tests.ResolveNonExistingWithManyAliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWithManyVanityPathTest;
14,744
@PerformanceTestSuite public ParameterizedTestList testPerformance() throws Exception { Helper helper = new Helper(); ParameterizedTestList testCenter = new ParameterizedTestList(); testCenter.setTestSuiteTitle("jcr.resource-2.2.0"); <BUG>testCenter.addTestObject(new ResolveNonExistingWith1000VanityPathTest(helper)); testCenter.addTestObject(new ResolveNonExistingWith5000VanityPathTest(helper)); testCenter.addTestObject(new ResolveNonExistingWith10000VanityPathTest(helper)); testCenter.addTestObject(new ResolveNonExistingWith1000AliasTest(helper)); testCenter.addTestObject(new ResolveNonExistingWith5000AliasTest(helper)); testCenter.addTestObject(new ResolveNonExistingWith10000AliasTest(helper)); </BUG> return testCenter;
testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith1000VanityPathTest",helper, 100, 10)); testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith5000VanityPathTest",helper, 100, 50)); testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith10000VanityPathTest",helper, 100, 100)); testCenter.addTestObject(new ResolveNonExistingWithManyAliasTest("ResolveNonExistingWith1000AliasTest",helper, 1000)); testCenter.addTestObject(new ResolveNonExistingWithManyAliasTest("ResolveNonExistingWith5000AliasTest",helper, 5000)); testCenter.addTestObject(new ResolveNonExistingWithManyAliasTest("ResolveNonExistingWith10000AliasTest",helper, 10000));
14,745
import org.codehaus.groovy.control.CompilationUnit; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public final class GroovyTreeParser implements TreeParser { private static final Logger logger = LoggerFactory.getLogger(GroovyTreeParser.class); <BUG>private static final String GROOVY_DEFAULT_INTERFACE = "groovy.lang.GroovyObject"; private static final String JAVA_DEFAULT_OBJECT = "java.lang.Object"; private Map<URI, Set<SymbolInformation>> fileSymbols = Maps.newHashMap(); private Map<String, Set<SymbolInformation>> typeReferences = Maps.newHashMap();</BUG> private final Supplier<CompilationUnit> unitSupplier;
private Indexer indexer = new Indexer();
14,746
if (scriptClass != null) { sourceUnit.getAST().getStatementBlock().getVariableScope().getDeclaredVariables().values().forEach( variable -> { SymbolInformation symbol = getVariableSymbolInformation(scriptClass.getName(), sourceUri, variable); <BUG>addToValueSet(newTypeReferences, variable.getType().getName(), symbol); symbols.add(symbol); }); } newFileSymbols.put(workspaceUriSupplier.get(sourceUri), symbols);</BUG> });
newIndexer.addSymbol(sourceUnit.getSource().getURI(), symbol); if (classes.containsKey(variable.getType().getName())) { newIndexer.addReference(classes.get(variable.getType().getName()), GroovyLocations.createLocation(sourceUri, variable.getType()));
14,747
} if (typeReferences.containsKey(foundSymbol.getName())) { foundReferences.addAll(typeReferences.get(foundSymbol.getName()));</BUG> } <BUG>return foundReferences; }</BUG> @Override public Set<SymbolInformation> getFilteredSymbols(String query) { checkNotNull(query, "query must not be null"); Pattern pattern = getQueryPattern(query);
}); sourceUnit.getAST().getStatementBlock() .visit(new MethodVisitor(newIndexer, sourceUri, sourceUnit.getAST().getScriptClassDummy(), classes, Maps.newHashMap(), Optional.absent(), workspaceUriSupplier));
14,748
<BUG>package com.palantir.ls.server.api; import io.typefox.lsapi.ReferenceParams;</BUG> import io.typefox.lsapi.SymbolInformation; import java.net.URI; import java.util.Map;
import com.google.common.base.Optional; import io.typefox.lsapi.Location; import io.typefox.lsapi.Position; import io.typefox.lsapi.ReferenceParams;
14,749
import java.util.Map; import java.util.Set; public interface TreeParser { void parseAllSymbols(); Map<URI, Set<SymbolInformation>> getFileSymbols(); <BUG>Map<String, Set<SymbolInformation>> getTypeReferences(); Set<SymbolInformation> findReferences(ReferenceParams params); Set<SymbolInformation> getFilteredSymbols(String query);</BUG> }
Map<Location, Set<Location>> getReferences(); Set<Location> findReferences(ReferenceParams params); Optional<Location> gotoDefinition(URI uri, Position position); Set<SymbolInformation> getFilteredSymbols(String query);
14,750
.workspaceSymbolProvider(true) .referencesProvider(true) .completionProvider(new CompletionOptionsBuilder() .resolveProvider(false) .triggerCharacter(".") <BUG>.build()) .build();</BUG> InitializeResult result = new InitializeResultBuilder() .capabilities(capabilities) .build();
.definitionProvider(true)
14,751
package com.palantir.ls.server; import com.palantir.ls.server.api.CompilerWrapper; import com.palantir.ls.server.api.TreeParser; import com.palantir.ls.server.api.WorkspaceCompiler; <BUG>import io.typefox.lsapi.FileEvent; import io.typefox.lsapi.PublishDiagnosticsParams;</BUG> import io.typefox.lsapi.ReferenceParams; import io.typefox.lsapi.SymbolInformation; import io.typefox.lsapi.TextDocumentContentChangeEvent;
import com.google.common.base.Optional; import io.typefox.lsapi.Location; import io.typefox.lsapi.Position; import io.typefox.lsapi.PublishDiagnosticsParams;
14,752
Bundle savedInstanceState) { final View rootView = inflater.inflate(R.layout.tab_qibla, container, false); final QiblaCompassView qiblaCompassView = (QiblaCompassView)rootView.findViewById(R.id.qibla_compass); qiblaCompassView.setConstants(((TextView)rootView.findViewById(R.id.bearing_north)), getText(R.string.bearing_north), ((TextView)rootView.findViewById(R.id.bearing_qibla)), getText(R.string.bearing_qibla)); <BUG>sOrientationListener = new SensorListener() { </BUG> public void onSensorChanged(int s, float v[]) { float northDirection = v[SensorManager.DATA_X]; qiblaCompassView.setDirections(northDirection, sQiblaDirection);
sOrientationListener = new android.hardware.SensorListener() {
14,753
response.appendContentString(id + "Stop();"); } } if (observeFieldID != null) { boolean fullSubmit = booleanValueForBinding("fullSubmit", false, component); <BUG>AjaxObserveField.appendToResponse(response, context, this, observeFieldID, id, fullSubmit, createObserveFieldOptions(component)); </BUG> } response.appendContentString("AUC.register('" + id + "'"); NSDictionary nonDefaultOptions = AjaxUpdateContainer.removeDefaultOptions(options);
AjaxObserveField.appendToResponse(response, context, this, observeFieldID, false, id, fullSubmit, createObserveFieldOptions(component));
14,754
import com.webobjects.appserver.WORequest; import com.webobjects.appserver.WOResponse; import com.webobjects.foundation.NSDictionary; import com.webobjects.foundation.NSMutableArray; import com.webobjects.foundation.NSMutableDictionary; <BUG>import er.extensions.ERXAjaxApplication; public class AjaxObserveField extends AjaxDynamicElement {</BUG> public AjaxObserveField(String name, NSDictionary associations, WOElement children) { super(name, associations, children); }
import er.extensions.ERXComponentUtilities; import er.extensions.ERXValueUtilities; public class AjaxObserveField extends AjaxDynamicElement {
14,755
<BUG>import com.webobjects.appserver.*; public class ToggleExample extends WOComponent {</BUG> public boolean _toggleAreaVisible; public boolean _toggleAreaVisible2;
import com.webobjects.appserver.WOActionResults; import com.webobjects.appserver.WOComponent; import com.webobjects.appserver.WOContext; import com.webobjects.foundation.NSArray; import com.webobjects.foundation.NSMutableArray; import com.webobjects.foundation.NSMutableSet; public class ToggleExample extends WOComponent {
14,756
}</BUG> @Override public boolean isBlockHandler(TagContext context) { WikiParameter param = context.getParams().getParameter("class"); <BUG>if (param != null) { List<String> classes = Arrays.asList(param.getValue().split(" ")); if (classes.contains("wikimodel-emptyline")) {</BUG> return true; }
import org.xwiki.rendering.wikimodel.WikiParameter; import org.xwiki.rendering.wikimodel.xhtml.impl.XhtmlHandler.TagStack.TagContext; public class DivisionTagHandler extends BlockTagHandler if (Arrays.asList(param.getValue().split(" ")).contains("wikimodel-emptyline")) {
14,757
return true; } } return false; } <BUG>protected String getDocumentClass() { return "wikimodel-document"; }</BUG> @Override
[DELETED]
14,758
public class XWikiHeaderTagHandler extends HeaderTagHandler { @Override protected void begin(TagContext context) { <BUG>String tag = context.getName(); int level = Integer.parseInt(tag.substring(1, 2)); </BUG> sendEmptyLines(context); WikiParameters params = context.getParams();
int level = Integer.parseInt(context.getName().substring(1, 2));
14,759
return true; } @Override protected void begin(TagContext context) { <BUG>String tag = context.getName(); int level = Integer.parseInt(tag.substring(1, 2)); </BUG> sendEmptyLines(context); context.getScannerContext().beginHeader(level, context.getParams());
int level = Integer.parseInt(context.getName().substring(1, 2));
14,760
</BUG> begin(markup, context); } protected void begin(String markup, XhtmlHandler.TagStack.TagContext context) <BUG>{ StringBuffer listStyles = (StringBuffer) context .getTagStack() .getStackParameter("listStyles"); listStyles.append(markup); context.getScannerContext().beginListItem(listStyles.toString());</BUG> }
super(documentContainer, requiresDocument, contentContainer); @Override public void begin(XhtmlHandler.TagStack.TagContext context) String markup = context.getParent().isTag("ol") ? "#" : "*"; context.getScannerContext().beginListItem(context.getTagStack().pushListStyle(markup.charAt(0)));
14,761
{ super(false, true, true); } @Override public boolean isBlockHandler(TagContext context) <BUG>{ int quoteDepth = (Integer) context.getTagStack().getStackParameter( "quoteDepth");</BUG> return quoteDepth == 0; }
public ParagraphTagHandler()
14,762
{ super(false, true, false); } @Override public boolean isBlockHandler(TagContext context) <BUG>{ return !(context.getParent().getName().equals("li") || context.getParent().getName().equals("dd") || context .getParent() .getName() .equals("dt"));</BUG> }
public ListTagHandler()
14,763
sendEmptyLines(context); context.getScannerContext().beginList(context.getParams()); } @Override protected void end(TagContext context) <BUG>{ StringBuffer listStyles = (StringBuffer) context .getTagStack() .getStackParameter("listStyles"); if (listStyles.length() == 0) {</BUG> context.getScannerContext().endList();
if (context.getTagStack().isEndOfList()) {
14,764
{ super(false, false, false); } @Override protected void begin(TagContext context) <BUG>{ int quoteDepth = (Integer) context.getTagStack().getStackParameter( QuoteTagHandler.QUOTEDEPTH);</BUG> if (quoteDepth > 0) { context.getScannerContext().beginQuotLine(quoteDepth);
public BreakTagHandler() int quoteDepth = context.getTagStack().getQuoteDepth();
14,765
} context.getScannerContext().endQuotLine(); if (quoteDepth == 0) { context.getScannerContext().endQuot(); } <BUG>context.getTagStack().setStackParameter(QUOTEDEPTH, quoteDepth); }</BUG> }
@Override public boolean isBlockHandler(TagContext context) return !(context.getParent().isTag("blockquote"));
14,766
this.xhtmlMarkerResourceReferenceParser = xhtmlMarkerResourceReferenceParser; } @Override public void onComment(String content, TagStack stack) { <BUG>boolean ignoreElements = (Boolean) stack.getStackParameter("ignoreElements"); if (!ignoreElements && content.startsWith("startwikilink:")) {</BUG> handleLinkCommentStart(XMLUtils.unescapeXMLComment(content), stack); } else if (!ignoreElements && content.startsWith("stopwikilink")) { handleLinkCommentStop(XMLUtils.unescapeXMLComment(content), stack);
boolean ignoreElements = stack.shouldIgnoreElements(); if (!ignoreElements && content.startsWith("startwikilink:")) {
14,767
package org.orekit.estimation.measurements; import org.hipparchus.Field; <BUG>import org.hipparchus.RealFieldElement; import org.hipparchus.analysis.differentiation.DerivativeStructure;</BUG> import org.hipparchus.geometry.euclidean.threed.FieldVector3D; import org.hipparchus.geometry.euclidean.threed.Vector3D; import org.hipparchus.geometry.euclidean.twod.Vector2D;
import org.hipparchus.analysis.differentiation.DSFactory; import org.hipparchus.analysis.differentiation.DerivativeStructure;
14,768
delay = receiverPosition.distance(transitP).multiply(cReciprocal); delta = FastMath.abs(delay.getReal() - previous); } while (count++ < 10 && delta >= 2 * FastMath.ulp(delay.getReal())); return delay; } <BUG>public OffsetDerivatives getOffsetDerivatives(final int parameters, </BUG> final int eastOffsetIndex, final int northOffsetIndex, final int zenithOffsetIndex)
public OffsetDerivatives getOffsetDerivatives(final DSFactory factory,
14,769
final FieldVector3D<DerivativeStructure> meridianCenterToOffset = zeroNorth.add(offsetOrigin).subtract(meridianCenter); final FieldVector3D<DerivativeStructure> meridianZ = meridianCenterToOffset.normalize(); FieldVector3D<DerivativeStructure> meridianE = FieldVector3D.crossProduct(Vector3D.PLUS_K, meridianZ); if (meridianE.getNormSq().getValue() < Precision.SAFE_MIN) { <BUG>meridianE = new FieldVector3D<DerivativeStructure>(new DerivativeStructure(parameters, 1, 0.0), new DerivativeStructure(parameters, 1, 1.0), new DerivativeStructure(parameters, 1, 0.0)); } else {</BUG> meridianE = meridianE.normalize();
meridianE = new FieldVector3D<>(factory.getDerivativeField().getZero(), factory.getDerivativeField().getOne(), factory.getDerivativeField().getZero()); } else {
14,770
final FieldVector3D<DerivativeStructure> transverseCenterToOffset = zeroEast.add(offsetOrigin).subtract(transverseCenter); final FieldVector3D<DerivativeStructure> transverseZ = transverseCenterToOffset.normalize(); FieldVector3D<DerivativeStructure> transverseE = FieldVector3D.crossProduct(Vector3D.PLUS_K, transverseZ); if (transverseE.getNormSq().getValue() < Precision.SAFE_MIN) { <BUG>transverseE = new FieldVector3D<DerivativeStructure>(new DerivativeStructure(parameters, 1, 0.0), new DerivativeStructure(parameters, 1, 1.0), new DerivativeStructure(parameters, 1, 0.0)); } else {</BUG> transverseE = transverseE.normalize();
transverseE = new FieldVector3D<>(factory.getDerivativeField().getZero(), factory.getDerivativeField().getOne(), factory.getDerivativeField().getZero()); } else {
14,771
final double[] x = d1.getX().add(d2.getX()).getAllDerivatives(); x[0] = v.getX(); final double[] y = d1.getY().add(d2.getY()).getAllDerivatives(); y[0] = v.getY(); final double[] z = d1.getZ().add(d2.getZ()).getAllDerivatives(); <BUG>z[0] = v.getZ(); final int parameters = d1.getX().getFreeParameters(); final int order = d1.getX().getOrder(); return new FieldVector3D<DerivativeStructure>(new DerivativeStructure(parameters, order, x), new DerivativeStructure(parameters, order, y), new DerivativeStructure(parameters, order, z));</BUG> }
return new FieldVector3D<>(d1.getX().getFactory().build(x), d1.getX().getFactory().build(y), d1.getX().getFactory().build(z));
14,772
package org.orekit.forces; import java.util.ArrayList; import java.util.List; <BUG>import org.hipparchus.RealFieldElement; import org.hipparchus.analysis.differentiation.DerivativeStructure;</BUG> import org.hipparchus.geometry.euclidean.threed.FieldRotation; import org.hipparchus.geometry.euclidean.threed.FieldVector3D; import org.hipparchus.geometry.euclidean.threed.Rotation;
import org.hipparchus.analysis.differentiation.DSFactory; import org.hipparchus.analysis.differentiation.DerivativeStructure;
14,773
private final Vector3D saZ; private double dragCoeff; private double absorptionCoeff; private double specularReflectionCoeff; private double diffuseReflectionCoeff; <BUG>private final PVCoordinatesProvider sun; public BoxAndSolarArraySpacecraft(final double xLength, final double yLength,</BUG> final double zLength, final PVCoordinatesProvider sun, final double solarArrayArea, final Vector3D solarArrayAxis,
private final DSFactory factory; public BoxAndSolarArraySpacecraft(final double xLength, final double yLength,
14,774
final String paramName) throws OrekitException { if (!DRAG_COEFFICIENT.equals(paramName)) { throw new OrekitException(OrekitMessages.UNSUPPORTED_PARAMETER_NAME, paramName, DRAG_COEFFICIENT); } <BUG>final DerivativeStructure dragCoeffDS = new DerivativeStructure(1, 1, 0, dragCoeff); </BUG> final Vector3D v = rotation.applyTo(relativeVelocity); final Vector3D solarArrayFacet = new Vector3D(solarArrayArea, getNormal(date, frame, position, rotation)); double sv = FastMath.abs(Vector3D.dotProduct(solarArrayFacet, v));
final DerivativeStructure dragCoeffDS = factory.variable(0, dragCoeff);
14,775
import org.orekit.propagation.SpacecraftState; import org.orekit.time.AbsoluteDate; import org.orekit.utils.Constants; import org.orekit.utils.TimeStampedFieldPVCoordinates; public class Range extends AbstractMeasurement<Range> { <BUG>private final GroundStation station; public Range(final GroundStation station, final AbsoluteDate date,</BUG> final double range, final double sigma, final double baseWeight) throws OrekitException { super(date, range, sigma, baseWeight,
private final DSFactory factory; public Range(final GroundStation station, final AbsoluteDate date,
14,776
throws OrekitException { super(date, range, sigma, baseWeight, station.getEastOffsetDriver(), station.getNorthOffsetDriver(), station.getZenithOffsetDriver()); <BUG>this.station = station; }</BUG> public GroundStation getStation() { return station; }
this.factory = new DSFactory(9, 1);
14,777
import org.orekit.frames.Transform; import org.orekit.propagation.SpacecraftState; import org.orekit.time.AbsoluteDate; import org.orekit.utils.AngularCoordinates; public class Angular extends AbstractMeasurement<Angular> { <BUG>private final GroundStation station; public Angular(final GroundStation station, final AbsoluteDate date,</BUG> final double[] angular, final double[] sigma, final double[] baseWeight) throws OrekitException { super(date, angular, sigma, baseWeight,
private final DSFactory factory; public Angular(final GroundStation station, final AbsoluteDate date,
14,778
throws OrekitException { super(date, angular, sigma, baseWeight, station.getEastOffsetDriver(), station.getNorthOffsetDriver(), station.getZenithOffsetDriver()); <BUG>this.station = station; }</BUG> public GroundStation getStation() { return station; }
this.factory = new DSFactory(6, 1);
14,779
final double delta = getDate().durationFrom(state.getDate()); final double dt = delta - tauD; final SpacecraftState transitState = state.shiftedBy(dt); final Frame bodyFrame = station.getOffsetFrame().getParentShape().getBodyFrame(); final Transform iner2Body = state.getFrame().getTransformTo(bodyFrame, getDate()); <BUG>final OffsetDerivatives od = station.getOffsetDerivatives(6, 3, 4, 5); </BUG> final FieldVector3D<DerivativeStructure> east = od.getEast(); final FieldVector3D<DerivativeStructure> north = od.getNorth(); final FieldVector3D<DerivativeStructure> zenith = od.getZenith();
final OffsetDerivatives od = station.getOffsetDerivatives(factory, 3, 4, 5);
14,780
final FieldVector3D<DerivativeStructure> east = od.getEast(); final FieldVector3D<DerivativeStructure> north = od.getNorth(); final FieldVector3D<DerivativeStructure> zenith = od.getZenith(); final FieldVector3D<DerivativeStructure> qP = od.getOrigin(); final Vector3D transitp = iner2Body.transformPosition(transitState.getPVCoordinates().getPosition()); <BUG>final FieldVector3D<DerivativeStructure> pP = new FieldVector3D<DerivativeStructure>(new DerivativeStructure(6, 1, 0, transitp.getX()), new DerivativeStructure(6, 1, 1, transitp.getY()), new DerivativeStructure(6, 1, 2, transitp.getZ())); final FieldVector3D<DerivativeStructure> staSat = pP.subtract(qP);</BUG> final DerivativeStructure baseAzimuth = DerivativeStructure.atan2(staSat.dotProduct(east), staSat.dotProduct(north));
final FieldVector3D<DerivativeStructure> pP = new FieldVector3D<>(factory.variable(0, transitp.getX()), factory.variable(1, transitp.getY()), factory.variable(2, transitp.getZ())); final FieldVector3D<DerivativeStructure> staSat = pP.subtract(qP);
14,781
final double twoPiWrap = MathUtils.normalizeAngle(baseAzimuth.getReal(), getObservedValue()[0]) - baseAzimuth.getReal(); final DerivativeStructure azimuth = baseAzimuth.add(twoPiWrap); final DerivativeStructure elevation = staSat.dotProduct(zenith).divide(staSat.getNorm()).asin(); final EstimatedMeasurement<Angular> estimated = <BUG>new EstimatedMeasurement<Angular>(this, iteration, evaluation, transitState); estimated.setEstimatedValue(azimuth.getValue(), elevation.getValue());</BUG> final AngularCoordinates ac = iner2Body.getInverse().getAngular(); final Vector3D tto = new Vector3D(azimuth.getPartialDerivative(1, 0, 0, 0, 0, 0), azimuth.getPartialDerivative(0, 1, 0, 0, 0, 0),
new EstimatedMeasurement<>(this, iteration, evaluation, transitState); estimated.setEstimatedValue(azimuth.getValue(), elevation.getValue());
14,782
package org.orekit.estimation; import org.hipparchus.analysis.UnivariateFunction; <BUG>import org.hipparchus.analysis.UnivariateVectorFunction; import org.hipparchus.analysis.differentiation.DerivativeStructure;</BUG> import org.hipparchus.analysis.differentiation.FiniteDifferencesDifferentiator; import org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction; import org.hipparchus.analysis.differentiation.UnivariateDifferentiableVectorFunction;
import org.hipparchus.analysis.differentiation.DSFactory; import org.hipparchus.analysis.differentiation.DerivativeStructure;
14,783
import org.orekit.orbits.OrbitType; import org.orekit.orbits.PositionAngle; import org.orekit.propagation.SpacecraftState; import org.orekit.propagation.numerical.NumericalPropagator; import org.orekit.utils.ParameterDriver; <BUG>public class EstimationUtils { private EstimationUtils() {</BUG> } public static ParameterFunction differentiate(final ParameterFunction function, final ParameterDriver driver,
private static final DSFactory FACTORY = new DSFactory(1, 1); private EstimationUtils() {
14,784
if (!parameterDriver.getName().equals(driver.getName())) { throw new OrekitException(OrekitMessages.UNSUPPORTED_PARAMETER_NAME, parameterDriver.getName(), driver.getName()); } try { <BUG>final DerivativeStructure dsParam = new DerivativeStructure(1, 1, 0, parameterDriver.getNormalizedValue()); </BUG> final DerivativeStructure dsValue = differentiated.value(dsParam); return dsValue.getPartialDerivative(1); } catch (OrekitExceptionWrapper oew) {
final DerivativeStructure dsParam = FACTORY.variable(0, parameterDriver.getNormalizedValue());
14,785
final UnivariateVectorFunction componentJ = new StateComponentFunction(j, function, state, orbitType, positionAngle); final FiniteDifferencesDifferentiator differentiator = new FiniteDifferencesDifferentiator(nbPoints, tolerances[j]); final UnivariateDifferentiableVectorFunction differentiatedJ = <BUG>differentiator.differentiate(componentJ); final DerivativeStructure[] c = differentiatedJ.value(new DerivativeStructure(1, 1, 0, 0.0));</BUG> for (int i = 0; i < dimension; ++i) { jacobian[i][j] = c[i].getPartialDerivative(1);
final DerivativeStructure[] c = differentiatedJ.value(FACTORY.variable(0, 0.0));
14,786
import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.security.DigestOutputStream; import java.security.MessageDigest; <BUG>import java.security.NoSuchAlgorithmException; import java.util.ArrayList; import java.util.Collections; import java.util.List;</BUG> public final class PatchUtils {
import java.text.DateFormat; import java.util.Date; import java.util.List;
14,787
package org.jboss.as.patching.runner; <BUG>import org.jboss.as.boot.DirectoryStructure; import org.jboss.as.patching.LocalPatchInfo;</BUG> import org.jboss.as.patching.PatchInfo; import org.jboss.as.patching.PatchLogger; import org.jboss.as.patching.PatchMessages;
import static org.jboss.as.patching.runner.PatchUtils.generateTimestamp; import org.jboss.as.patching.CommonAttributes; import org.jboss.as.patching.LocalPatchInfo;
14,788
private static final String PATH_DELIMITER = "/"; public static final byte[] NO_CONTENT = PatchingTask.NO_CONTENT; enum Element { ADDED_BUNDLE("added-bundle"), ADDED_MISC_CONTENT("added-misc-content"), <BUG>ADDED_MODULE("added-module"), BUNDLES("bundles"),</BUG> CUMULATIVE("cumulative"), DESCRIPTION("description"), MISC_FILES("misc-files"),
APPLIES_TO_VERSION("applies-to-version"), BUNDLES("bundles"),
14,789
final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { <BUG>case APPLIES_TO_VERSION: builder.addAppliesTo(value); break;</BUG> case RESULTING_VERSION: if(type == Patch.PatchType.CUMULATIVE) {
[DELETED]
14,790
final StringBuilder path = new StringBuilder(); for(final String p : item.getPath()) { path.append(p).append(PATH_DELIMITER); } path.append(item.getName()); <BUG>writer.writeAttribute(Attribute.PATH.name, path.toString()); if(type != ModificationType.REMOVE) {</BUG> writer.writeAttribute(Attribute.HASH.name, bytesToHexString(item.getContentHash())); } if(type != ModificationType.ADD) {
if (item.isDirectory()) { writer.writeAttribute(Attribute.DIRECTORY.name, "true"); if(type != ModificationType.REMOVE) {
14,791
package org.jboss.as.patching; import org.jboss.as.controller.OperationFailedException; import org.jboss.as.patching.runner.PatchingException; import org.jboss.logging.Messages; import org.jboss.logging.annotations.Message; <BUG>import org.jboss.logging.annotations.MessageBundle; import java.io.IOException;</BUG> import java.util.List; @MessageBundle(projectCode = "JBAS") public interface PatchMessages {
import org.jboss.logging.annotations.Cause; import java.io.IOException;
14,792
final Expression miExpr = mi.getExpression(); if (isMethod(mi, "java.io.Closeable", "close") && isSameVariable(previousDeclFragment, miExpr)) { final Refactorings r = ctx.getRefactorings(); final ASTBuilder b = ctx.getASTBuilder(); <BUG>r.remove(previousStmt); </BUG> r.insertFirst(node, TryStatement.RESOURCES_PROPERTY, b.toDeclareExpr(previousDeclStmt)); r.remove(finallyStmts.size() == 1 ? node.getFinally() : finallyStmt); return DO_NOT_VISIT_SUBTREE;
r.remove(previousDeclStmt);
14,793
final VariableDeclarationStatement vds, final Expression expr) { if (vds == null) { return null; } for (VariableDeclarationFragment vdf : fragments(vds)) { <BUG>if (isSameVariable(expr, vdf.getName())) { return vdf;</BUG> } } return null;
if (isSameVariable(expr, vdf)) { return vdf;
14,794
return outerBl.booleanValue(); } return null; } private Pair<Name, Expression> getInitializer(Statement stmt) { <BUG>if (stmt instanceof VariableDeclarationStatement) { VariableDeclarationStatement vds = (VariableDeclarationStatement) stmt; List<VariableDeclarationFragment> fragments = fragments(vds); if (fragments.size() == 1) { VariableDeclarationFragment fragment = fragments.get(0); return Pair.of((Name) fragment.getName(), fragment.getInitializer()); }</BUG> } else if (stmt instanceof ExpressionStatement) {
return uniqueVariableDeclarationFragmentName(stmt);
14,795
b.copySubtree(loopContent.getContainerVariable()), "get", b.copySubtree(loopContent.getLoopVariable())); } private Pair<Name, Expression> uniqueVariableDeclarationFragmentName(Statement stmt) { <BUG>VariableDeclarationStatement vds = as(stmt, VariableDeclarationStatement.class); if (vds != null) { List<VariableDeclarationFragment> fragments = fragments(vds); if (fragments.size() == 1) { VariableDeclarationFragment vdf = fragments.get(0);</BUG> return Pair.of((Name) vdf.getName(), vdf.getInitializer());
[DELETED]
14,796
private void addBuffer() { try { if (!isClosed && bufferQueue.size() <= BUFFER_QUEUE_SIZE) bufferQueue.put(new byte[size]); } catch (InterruptedException e) { <BUG>LOGGER.log(LogLevel.INFO, "Unable to add buffer to buffer queue", e); }</BUG> } } public AsyncBufferWriter(OutputStream outputStream, int size, ThreadFactory threadFactory, byte[] newline) {
LOGGER.log(LogLevel.INFO, Messages.getString("HDFS_ASYNC_UNABLE_ADD_TO_QUEUE"), e);
14,797
isClosed = true; exService.shutdown(); try { exService.awaitTermination(Integer.MAX_VALUE, TimeUnit.SECONDS); } catch (InterruptedException e) { <BUG>LOGGER.log(LogLevel.WARN, "Execution Service shutdown is interrupted.", e); }finally {</BUG> flushNow(); out.close(); bufferQueue.clear();
LOGGER.log(LogLevel.WARN, Messages.getString("HDFS_ASYNC_SERVICE_SHUTDOWN_INTERRUPTED"), e); }finally {
14,798
new RuleDto().setId(2).setRepositoryKey("checkstyle").setLanguage("java2") .setCharacteristicId(3).setRemediationFunction("LINEAR").setRemediationCoefficient("2h") .setCreatedAt(oldDate).setUpdatedAt(oldDate) )); debtModelBackup.restoreFromXml("<xml/>", "java"); <BUG>verify(characteristicsXMLImporter, never()).importXML(anyString()); verify(dao, never()).update(any(CharacteristicDto.class), eq(session));</BUG> verify(ruleDao).selectEnablesAndNonManual(session); verify(ruleDao).update(ruleArgument.capture(), eq(session)); verifyNoMoreInteractions(ruleDao);
.setCharacteristicId(2).setRemediationFunction("LINEAR").setRemediationCoefficient("2h") debtModelBackup.restore("java"); verify(dao, never()).update(any(CharacteristicDto.class), eq(session));
14,799
.setDefaultCharacteristicId(3).setDefaultRemediationFunction("LINEAR").setDefaultRemediationCoefficient("2h") .setCharacteristicId(2).setRemediationFunction("LINEAR_OFFSET").setRemediationCoefficient("2h").setRemediationOffset("15min") .setCreatedAt(oldDate).setUpdatedAt(oldDate) )); debtModelBackup.restoreFromXml("<xml/>", "java"); <BUG>verify(characteristicsXMLImporter, never()).importXML(anyString()); verify(dao, never()).update(any(CharacteristicDto.class), eq(session));</BUG> verify(ruleDao).selectEnablesAndNonManual(session); verify(ruleDao).update(ruleArgument.capture(), eq(session)); verifyNoMoreInteractions(ruleDao);
debtModelBackup.restore("java");
14,800
.setCreatedAt(oldDate).setUpdatedAt(oldDate) )); when(rulesXMLImporter.importXML(anyString(), any(ValidationMessages.class))).thenReturn(newArrayList(new RuleDebt() .setRuleKey(RuleKey.of("squid", "UselessImportCheck")).setCharacteristicKey("HARDWARE").setFunction(DebtRemediationFunction.Type.LINEAR).setCoefficient("2h"))); debtModelBackup.restoreFromXml("<xml/>", "java"); <BUG>verify(characteristicsXMLImporter, never()).importXML(anyString()); verify(dao, never()).update(any(CharacteristicDto.class), eq(session));</BUG> verify(ruleDao).selectEnablesAndNonManual(session); verify(ruleDao).update(ruleArgument.capture(), eq(session)); verifyNoMoreInteractions(ruleDao);
debtModelBackup.restoreFromXml("<xml/>");