id
int64
1
60k
buggy
stringlengths
34
37.5k
fixed
stringlengths
6
37.4k
59,801
import javax.annotation.Nullable; import org.apache.jackrabbit.oak.api.PropertyState; import org.apache.jackrabbit.oak.api.Tree; public interface PermissionProvider { @Nonnull <BUG>Set<String> getPrivilegeNames(@Nullable Tree tree); boolean hasPrivileges(@Nullable Tree tree, String... privilegeNames);</BUG> boolean canRead(@Nonnull Tree tree); boolean canRead(@Nonnull Tree tree, @Nonnull PropertyState property); boolean isGranted(long permissions);
import javax.annotation.Nullable; import org.apache.jackrabbit.oak.api.PropertyState; import org.apache.jackrabbit.oak.api.Tree; public interface PermissionProvider { @Nonnull Set<String> getPrivileges(@Nullable Tree tree); boolean hasPrivileges(@Nullable Tree tree, String... privilegeNames); boolean canRead(@Nonnull Tree tree); boolean canRead(@Nonnull Tree tree, @Nonnull PropertyState property); boolean isGranted(long permissions);
59,802
package org.apache.jackrabbit.oak.security.authorization.permission; <BUG>import javax.annotation.Nonnull; import org.apache.jackrabbit.oak.api.PropertyState;</BUG> import org.apache.jackrabbit.oak.api.Tree; public interface CompiledPermissions { boolean canRead(@Nonnull Tree tree);
package org.apache.jackrabbit.oak.security.authorization.permission; import java.util.Set; import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.apache.jackrabbit.oak.api.PropertyState; import org.apache.jackrabbit.oak.api.Tree; public interface CompiledPermissions { boolean canRead(@Nonnull Tree tree);
59,803
public static PermissionProvider getInstance() { return INSTANCE; } @Nonnull @Override <BUG>public Set<String> getPrivilegeNames(@Nullable Tree tree) { return Collections.singleton(PrivilegeConstants.JCR_ALL);</BUG> } @Override public boolean hasPrivileges(@Nullable Tree tree, String... privilegeNames) {
public static PermissionProvider getInstance() { return INSTANCE; } @Nonnull @Override public Set<String> getPrivileges(@Nullable Tree tree) { return Collections.singleton(PrivilegeConstants.JCR_ALL); } @Override public boolean hasPrivileges(@Nullable Tree tree, String... privilegeNames) {
59,804
<BUG>package org.apache.jackrabbit.oak.security.authorization.permission; import javax.annotation.Nonnull; import org.apache.jackrabbit.oak.api.PropertyState;</BUG> import org.apache.jackrabbit.oak.api.Tree; public final class NoPermissions implements CompiledPermissions {
package org.apache.jackrabbit.oak.security.authorization.permission; import java.util.Collections; import java.util.Set; import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.apache.jackrabbit.oak.api.PropertyState; import org.apache.jackrabbit.oak.api.Tree; public final class NoPermissions implements CompiledPermissions {
59,805
package org.apache.jackrabbit.oak.security.authorization.permission; <BUG>import javax.annotation.Nonnull; import org.apache.jackrabbit.oak.api.PropertyState; import org.apache.jackrabbit.oak.api.Tree; public final class AllPermissions implements CompiledPermissions {</BUG> private static final CompiledPermissions INSTANCE = new AllPermissions();
package org.apache.jackrabbit.oak.security.authorization.permission; import java.util.Collections; import java.util.Set; import org.apache.jackrabbit.oak.api.PropertyState; import org.apache.jackrabbit.oak.api.Tree; import org.apache.jackrabbit.oak.security.privilege.PrivilegeConstants; public final class AllPermissions implements CompiledPermissions { private static final CompiledPermissions INSTANCE = new AllPermissions();
59,806
import org.apache.jackrabbit.util.Text; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class PermissionProviderImpl implements PermissionProvider, AccessControlConstants { private static final Logger log = LoggerFactory.getLogger(PermissionProviderImpl.class); <BUG>private final Root root; </BUG> private final Context acContext; private final String workspaceName = "default"; // FIXME: use proper workspace as associated with the root private final CompiledPermissions compiledPermissions;
import org.apache.jackrabbit.util.Text; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class PermissionProviderImpl implements PermissionProvider, AccessControlConstants { private static final Logger log = LoggerFactory.getLogger(PermissionProviderImpl.class); private final ReadOnlyRoot root; private final Context acContext; private final String workspaceName = "default"; // FIXME: use proper workspace as associated with the root private final CompiledPermissions compiledPermissions;
59,807
this.acContext = securityProvider.getAccessControlConfiguration().getContext(); if (principals.contains(SystemPrincipal.INSTANCE) || isAdmin(principals)) { compiledPermissions = AllPermissions.getInstance(); } else { String relativePath = PERMISSIONS_STORE_PATH + '/' + workspaceName; <BUG>ReadOnlyTree rootTree = ReadOnlyTree.createFromRoot(root); ReadOnlyTree permissionsTree = getPermissionsRoot(rootTree, relativePath);</BUG> if (permissionsTree == null) { compiledPermissions = NoPermissions.getInstance(); <BUG>} else { compiledPermissions = new CompiledPermissionImpl(permissionsTree, principals); </BUG> }
this.acContext = securityProvider.getAccessControlConfiguration().getContext(); if (principals.contains(SystemPrincipal.INSTANCE) || isAdmin(principals)) { compiledPermissions = AllPermissions.getInstance(); } else { String relativePath = PERMISSIONS_STORE_PATH + '/' + workspaceName; ReadOnlyTree rootTree = this.root.getTree("/"); ReadOnlyTree permissionsTree = getPermissionsRoot(rootTree, relativePath); if (permissionsTree == null) { compiledPermissions = NoPermissions.getInstance(); } else { PrivilegeDefinitionStore privilegeStore = new PrivilegeDefinitionStore(this.root); compiledPermissions = new CompiledPermissionImpl(principals, privilegeStore, permissionsTree);
59,808
customTokens.put("%%mlFinalForestsPerHost%%", hubConfig.finalForestsPerHost.toString()); customTokens.put("%%mlTraceAppserverName%%", hubConfig.traceHttpName); customTokens.put("%%mlTracePort%%", hubConfig.tracePort.toString()); customTokens.put("%%mlTraceDbName%%", hubConfig.traceDbName); customTokens.put("%%mlTraceForestsPerHost%%", hubConfig.traceForestsPerHost.toString()); <BUG>customTokens.put("%%mlModulesDbName%%", hubConfig.modulesDbName); }</BUG> public void init() { try { LOGGER.error("PLUGINS DIR: " + pluginsDir.toString());
customTokens.put("%%mlFinalForestsPerHost%%", hubConfig.finalForestsPerHost.toString()); customTokens.put("%%mlTraceAppserverName%%", hubConfig.traceHttpName); customTokens.put("%%mlTracePort%%", hubConfig.tracePort.toString()); customTokens.put("%%mlTraceDbName%%", hubConfig.traceDbName); customTokens.put("%%mlTraceForestsPerHost%%", hubConfig.traceForestsPerHost.toString()); customTokens.put("%%mlModulesDbName%%", hubConfig.modulesDbName); customTokens.put("%%mlTriggersDbName%%", hubConfig.triggersDbName); customTokens.put("%%mlSchemasDbName%%", hubConfig.schemasDbName); } public void init() { try { LOGGER.error("PLUGINS DIR: " + pluginsDir.toString());
59,809
import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.LocalFileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.util.Progressable; <BUG>import static org.apache.hadoop.fs.s3a.S3AConstants.*; public class S3AFileSystem extends FileSystem {</BUG> private URI uri; private Path workingDir; private AmazonS3Client s3;
import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.LocalFileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.util.Progressable; import static org.apache.hadoop.fs.s3a.Constants.*; public class S3AFileSystem extends FileSystem { private URI uri; private Path workingDir; private AmazonS3Client s3;
59,810
public void initialize(URI name, Configuration conf) throws IOException { super.initialize(name, conf); uri = URI.create(name.getScheme() + "://" + name.getAuthority()); workingDir = new Path("/user", System.getProperty("user.name")).makeQualified(this.uri, this.getWorkingDirectory()); <BUG>String accessKey = conf.get(ACCESS_KEY, null); String secretKey = conf.get(SECRET_KEY, null); </BUG> String userInfo = name.getUserInfo();
public void initialize(URI name, Configuration conf) throws IOException { super.initialize(name, conf); uri = URI.create(name.getScheme() + "://" + name.getAuthority()); workingDir = new Path("/user", System.getProperty("user.name")).makeQualified(this.uri, this.getWorkingDirectory()); String accessKey = conf.get(NEW_ACCESS_KEY, conf.get(OLD_ACCESS_KEY, null)); String secretKey = conf.get(NEW_SECRET_KEY, conf.get(OLD_SECRET_KEY, null)); String userInfo = name.getUserInfo();
59,811
} else { accessKey = userInfo; } } AWSCredentialsProviderChain credentials = new AWSCredentialsProviderChain( <BUG>new S3ABasicAWSCredentialsProvider(accessKey, secretKey), new InstanceProfileCredentialsProvider(), new S3AAnonymousAWSCredentialsProvider() );</BUG> bucket = name.getHost();
} else { accessKey = userInfo; } } AWSCredentialsProviderChain credentials = new AWSCredentialsProviderChain( new BasicAWSCredentialsProvider(accessKey, secretKey), new InstanceProfileCredentialsProvider(), new AnonymousAWSCredentialsProvider() ); bucket = name.getHost();
59,812
awsConf.setSocketTimeout(conf.getInt(SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT)); </BUG> s3 = new AmazonS3Client(credentials, awsConf); <BUG>maxKeys = conf.getInt(MAX_PAGING_KEYS, DEFAULT_MAX_PAGING_KEYS); partSize = conf.getLong(MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE); partSizeThreshold = conf.getInt(MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD); </BUG> if (partSize < 5 * 1024 * 1024) {
new InstanceProfileCredentialsProvider(), new AnonymousAWSCredentialsProvider() ); bucket = name.getHost(); ClientConfiguration awsConf = new ClientConfiguration(); awsConf.setMaxConnections(conf.getInt(NEW_MAXIMUM_CONNECTIONS, conf.getInt(OLD_MAXIMUM_CONNECTIONS, DEFAULT_MAXIMUM_CONNECTIONS))); awsConf.setProtocol(conf.getBoolean(NEW_SECURE_CONNECTIONS, conf.getBoolean(OLD_SECURE_CONNECTIONS, DEFAULT_SECURE_CONNECTIONS)) ? Protocol.HTTPS : Protocol.HTTP); awsConf.setMaxErrorRetry(conf.getInt(NEW_MAX_ERROR_RETRIES, conf.getInt(OLD_MAX_ERROR_RETRIES, DEFAULT_MAX_ERROR_RETRIES))); awsConf.setSocketTimeout(conf.getInt(NEW_SOCKET_TIMEOUT, conf.getInt(OLD_SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT))); s3 = new AmazonS3Client(credentials, awsConf); maxKeys = conf.getInt(NEW_MAX_PAGING_KEYS, conf.getInt(OLD_MAX_PAGING_KEYS, DEFAULT_MAX_PAGING_KEYS)); partSize = conf.getLong(NEW_MULTIPART_SIZE, conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE)); partSizeThreshold = conf.getInt(NEW_MIN_MULTIPART_THRESHOLD, conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD));
59,813
if (partSizeThreshold < 5 * 1024 * 1024) { <BUG>LOG.error(MIN_MULTIPART_THRESHOLD + " must be at least 5 MB"); </BUG> partSizeThreshold = 5 * 1024 * 1024; } <BUG>String cannedACLName = conf.get(CANNED_ACL, DEFAULT_CANNED_ACL); </BUG> if (!cannedACLName.isEmpty()) { cannedACL = CannedAccessControlList.valueOf(cannedACLName); } else {
if (partSizeThreshold < 5 * 1024 * 1024) { LOG.error(NEW_MIN_MULTIPART_THRESHOLD + " must be at least 5 MB"); partSizeThreshold = 5 * 1024 * 1024; } String cannedACLName = conf.get(NEW_CANNED_ACL, conf.get(OLD_CANNED_ACL, DEFAULT_CANNED_ACL)); if (!cannedACLName.isEmpty()) { cannedACL = CannedAccessControlList.valueOf(cannedACLName); } else {
59,814
cannedACL = null; } if (!s3.doesBucketExist(bucket)) { throw new IOException("Bucket " + bucket + " does not exist"); } <BUG>boolean purgeExistingMultipart = conf.getBoolean(PURGE_EXISTING_MULTIPART, DEFAULT_PURGE_EXISTING_MULTIPART); long purgeExistingMultipartAge = conf.getLong(PURGE_EXISTING_MULTIPART_AGE, DEFAULT_PURGE_EXISTING_MULTIPART_AGE); </BUG> if (purgeExistingMultipart) {
cannedACL = null; } if (!s3.doesBucketExist(bucket)) { throw new IOException("Bucket " + bucket + " does not exist"); } boolean purgeExistingMultipart = conf.getBoolean(NEW_PURGE_EXISTING_MULTIPART, conf.getBoolean(OLD_PURGE_EXISTING_MULTIPART, DEFAULT_PURGE_EXISTING_MULTIPART)); long purgeExistingMultipartAge = conf.getLong(NEW_PURGE_EXISTING_MULTIPART_AGE, conf.getLong(OLD_PURGE_EXISTING_MULTIPART_AGE, DEFAULT_PURGE_EXISTING_MULTIPART_AGE)); if (purgeExistingMultipart) {
59,815
import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; <BUG>import static org.apache.hadoop.fs.s3a.S3AConstants.*; public class S3AOutputStream extends OutputStream {</BUG> private OutputStream backupStream; private File backupFile; private boolean closed;
import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import static org.apache.hadoop.fs.s3a.Constants.*; public class S3AOutputStream extends OutputStream { private OutputStream backupStream; private File backupFile; private boolean closed;
59,816
this.client = client; this.progress = progress; this.fs = fs; this.cannedACL = cannedACL; this.statistics = statistics; <BUG>partSize = conf.getLong(MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE); partSizeThreshold = conf.getInt(MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD); </BUG> if (conf.get(BUFFER_DIR, null) != null) {
this.client = client; this.progress = progress; this.fs = fs; this.cannedACL = cannedACL; this.statistics = statistics; partSize = conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE); partSizeThreshold = conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD); if (conf.get(BUFFER_DIR, null) != null) {
59,817
import org.rajawali3d.materials.Material; import org.rajawali3d.materials.methods.DiffuseMethod; import org.rajawali3d.materials.textures.ATexture; import org.rajawali3d.materials.textures.StreamingTexture; import org.rajawali3d.materials.textures.Texture; <BUG>import org.rajawali3d.math.Matrix4; import org.rajawali3d.math.vector.Vector3;</BUG> import org.rajawali3d.primitives.ScreenQuad; import org.rajawali3d.primitives.Sphere; import org.rajawali3d.renderer.RajawaliRenderer;
import org.rajawali3d.materials.Material; import org.rajawali3d.materials.methods.DiffuseMethod; import org.rajawali3d.materials.textures.ATexture; import org.rajawali3d.materials.textures.StreamingTexture; import org.rajawali3d.materials.textures.Texture; import org.rajawali3d.math.Matrix4; import org.rajawali3d.math.Quaternion; import org.rajawali3d.math.vector.Vector3; import org.rajawali3d.primitives.ScreenQuad; import org.rajawali3d.primitives.Sphere; import org.rajawali3d.renderer.RajawaliRenderer;
59,818
translationMoon.setRepeatMode(Animation.RepeatMode.INFINITE); translationMoon.setTransformable3D(moon); getCurrentScene().registerAnimation(translationMoon); translationMoon.play(); } <BUG>public void updateRenderCameraPose(TangoPoseData devicePose, DeviceExtrinsics extrinsics) { Pose cameraPose = ScenePoseCalculator.toOpenGlCameraPose(devicePose, extrinsics); getCurrentCamera().setRotation(cameraPose.getOrientation()); getCurrentCamera().setPosition(cameraPose.getPosition()); }</BUG> public int getTextureId() {
translationMoon.setRepeatMode(Animation.RepeatMode.INFINITE); translationMoon.setTransformable3D(moon); getCurrentScene().registerAnimation(translationMoon); translationMoon.play(); } public void updateRenderCameraPose(TangoPoseData cameraPose) { float[] rotation = cameraPose.getRotationAsFloats(); float[] translation = cameraPose.getTranslationAsFloats(); Quaternion quaternion = new Quaternion(rotation[3], rotation[0], rotation[1], rotation[2]); getCurrentCamera().setRotation(quaternion.conjugate()); getCurrentCamera().setPosition(translation[0], translation[1], translation[2]); } public int getTextureId() {
59,819
package com.projecttango.examples.java.helloareadescription; import com.google.atap.tangoservice.Tango; <BUG>import com.google.atap.tangoservice.Tango.OnTangoUpdateListener; import com.google.atap.tangoservice.TangoConfig;</BUG> import com.google.atap.tangoservice.TangoCoordinateFramePair; import com.google.atap.tangoservice.TangoErrorException; import com.google.atap.tangoservice.TangoEvent;
package com.projecttango.examples.java.helloareadescription; import com.google.atap.tangoservice.Tango; import com.google.atap.tangoservice.Tango.OnTangoUpdateListener; import com.google.atap.tangoservice.TangoAreaDescriptionMetaData; import com.google.atap.tangoservice.TangoConfig; import com.google.atap.tangoservice.TangoCoordinateFramePair; import com.google.atap.tangoservice.TangoErrorException; import com.google.atap.tangoservice.TangoEvent;
59,820
Toast.makeText(this, R.string.tango_not_ready, Toast.LENGTH_SHORT).show(); return; } Bundle bundle = new Bundle(); TangoAreaDescriptionMetaData metaData = mTango.loadAreaDescriptionMetaData(mCurrentUuid); <BUG>byte[] adfNameBytes = metaData.get("name"); if (adfNameBytes != null) {</BUG> String fillDialogName = new String(adfNameBytes); <BUG>bundle.putString("name", fillDialogName); } bundle.putString("id", mCurrentUuid); FragmentManager manager = getFragmentManager();</BUG> SetAdfNameDialog setAdfNameDialog = new SetAdfNameDialog();
Toast.makeText(this, R.string.tango_not_ready, Toast.LENGTH_SHORT).show(); return; } Bundle bundle = new Bundle(); TangoAreaDescriptionMetaData metaData = mTango.loadAreaDescriptionMetaData(mCurrentUuid); byte[] adfNameBytes = metaData.get(TangoAreaDescriptionMetaData.KEY_NAME); if (adfNameBytes != null) { String fillDialogName = new String(adfNameBytes); bundle.putString(TangoAreaDescriptionMetaData.KEY_NAME, fillDialogName); } bundle.putString(TangoAreaDescriptionMetaData.KEY_UUID, mCurrentUuid); FragmentManager manager = getFragmentManager(); SetAdfNameDialog setAdfNameDialog = new SetAdfNameDialog();
59,821
package com.projecttango.examples.java.augmentedreality; import com.google.atap.tangoservice.Tango; import com.google.atap.tangoservice.Tango.OnTangoUpdateListener; import com.google.atap.tangoservice.TangoCameraIntrinsics; import com.google.atap.tangoservice.TangoConfig; <BUG>import com.google.atap.tangoservice.TangoCoordinateFramePair; import com.google.atap.tangoservice.TangoEvent;</BUG> import com.google.atap.tangoservice.TangoOutOfDateException; import com.google.atap.tangoservice.TangoPoseData; import com.google.atap.tangoservice.TangoXyzIjData;
package com.projecttango.examples.java.augmentedreality; import com.google.atap.tangoservice.Tango; import com.google.atap.tangoservice.Tango.OnTangoUpdateListener; import com.google.atap.tangoservice.TangoCameraIntrinsics; import com.google.atap.tangoservice.TangoConfig; import com.google.atap.tangoservice.TangoCoordinateFramePair; import com.google.atap.tangoservice.TangoErrorException; import com.google.atap.tangoservice.TangoEvent; import com.google.atap.tangoservice.TangoOutOfDateException; import com.google.atap.tangoservice.TangoPoseData; import com.google.atap.tangoservice.TangoXyzIjData;
59,822
super.onResume(); if (!mIsConnected) { mTango = new Tango(AugmentedRealityActivity.this, new Runnable() { @Override public void run() { <BUG>try { connectTango();</BUG> setupRenderer(); mIsConnected = true; } catch (TangoOutOfDateException e) {
super.onResume(); if (!mIsConnected) { mTango = new Tango(AugmentedRealityActivity.this, new Runnable() { @Override public void run() { try { TangoSupport.initialize(); connectTango(); setupRenderer(); mIsConnected = true; } catch (TangoOutOfDateException e) {
59,823
if (lastFramePose.statusCode == TangoPoseData.POSE_VALID) { mRenderer.updateRenderCameraPose(lastFramePose, mExtrinsics); mCameraPoseTimestamp = lastFramePose.timestamp;</BUG> } else { <BUG>Log.w(TAG, "Can't get device pose at time: " + mRgbTimestampGlThread); }</BUG> } } } @Override
if (lastFramePose.statusCode == TangoPoseData.POSE_VALID) { mRenderer.updateRenderCameraPose(lastFramePose); mCameraPoseTimestamp = lastFramePose.timestamp; } else { Log.w(TAG, "Can't get device pose at time: " + mRgbTimestampGlThread); } } } } @Override
59,824
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.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.security.DigestOutputStream; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.text.DateFormat; import java.util.ArrayList; import java.util.Collections; import java.util.Date; import java.util.List; public final class PatchUtils {
59,825
package org.jboss.as.patching; import org.jboss.as.controller.AttributeDefinition; <BUG>import org.jboss.as.controller.SimpleAttributeDefinition;</BUG> import org.jboss.as.controller.SimpleAttributeDefinitionBuilder; import org.jboss.dmr.ModelType; <BUG>class Constants { </BUG> static final AttributeDefinition PATCH_ID = SimpleAttributeDefinitionBuilder.create("patch-id", ModelType.STRING).build();
package org.jboss.as.patching; import org.jboss.as.controller.AttributeDefinition; import org.jboss.as.controller.SimpleAttributeDefinitionBuilder; import org.jboss.dmr.ModelType; public class Constants {
59,826
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 {
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; import org.jboss.logging.annotations.MessageBundle; import org.jboss.logging.annotations.Cause; import java.io.IOException; import java.util.List; @MessageBundle(projectCode = "JBAS") public interface PatchMessages {
59,827
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;
package org.jboss.as.patching.runner; import static org.jboss.as.patching.runner.PatchUtils.generateTimestamp; import org.jboss.as.boot.DirectoryStructure; import org.jboss.as.patching.CommonAttributes; import org.jboss.as.patching.LocalPatchInfo; import org.jboss.as.patching.PatchInfo; import org.jboss.as.patching.PatchLogger; import org.jboss.as.patching.PatchMessages;
59,828
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"),
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"), ADDED_MODULE("added-module"), APPLIES_TO_VERSION("applies-to-version"), BUNDLES("bundles"), CUMULATIVE("cumulative"), DESCRIPTION("description"), MISC_FILES("misc-files"),
59,829
writer.writeEndElement(); final Patch.PatchType type = patch.getPatchType(); <BUG>final List<String> appliesTo = patch.getAppliesTo();</BUG> if(type == Patch.PatchType.ONE_OFF) { <BUG>writer.writeEmptyElement(Element.ONE_OFF.name); </BUG> } else { <BUG>writer.writeEmptyElement(Element.CUMULATIVE.name); </BUG> writer.writeAttribute(Attribute.RESULTING_VERSION.name, patch.getResultingVersion());
writer.writeEndElement(); writer.writeStartElement(Element.DESCRIPTION.name); writer.writeCharacters(patch.getDescription()); writer.writeEndElement(); final Patch.PatchType type = patch.getPatchType(); if(type == Patch.PatchType.ONE_OFF) { writer.writeStartElement(Element.ONE_OFF.name); } else { writer.writeStartElement(Element.CUMULATIVE.name); writer.writeAttribute(Attribute.RESULTING_VERSION.name, patch.getResultingVersion());
59,830
} else { <BUG>writer.writeEmptyElement(Element.CUMULATIVE.name); </BUG> writer.writeAttribute(Attribute.RESULTING_VERSION.name, patch.getResultingVersion()); } <BUG>writer.writeAttribute(Attribute.APPLIES_TO_VERSION.name, appliesTo); final List<ContentModification> bundlesAdd = new ArrayList<ContentModification>();</BUG> final List<ContentModification> bundlesUpdate = new ArrayList<ContentModification>(); final List<ContentModification> bundlesRemove = new ArrayList<ContentModification>(); final List<ContentModification> miscAdd = new ArrayList<ContentModification>();
} else { writer.writeStartElement(Element.CUMULATIVE.name); writer.writeAttribute(Attribute.RESULTING_VERSION.name, patch.getResultingVersion()); } writeAppliesToVersions(writer, patch.getAppliesTo()); writer.writeEndElement(); // </one-off> or </cumulative> final List<ContentModification> bundlesAdd = new ArrayList<ContentModification>(); final List<ContentModification> bundlesUpdate = new ArrayList<ContentModification>(); final List<ContentModification> bundlesRemove = new ArrayList<ContentModification>(); final List<ContentModification> miscAdd = new ArrayList<ContentModification>();
59,831
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) {
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) { case RESULTING_VERSION: if(type == Patch.PatchType.CUMULATIVE) {
59,832
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) {
final StringBuilder path = new StringBuilder(); for(final String p : item.getPath()) { path.append(p).append(PATH_DELIMITER); } path.append(item.getName()); writer.writeAttribute(Attribute.PATH.name, path.toString()); if (item.isDirectory()) { writer.writeAttribute(Attribute.DIRECTORY.name, "true"); } if(type != ModificationType.REMOVE) { writer.writeAttribute(Attribute.HASH.name, bytesToHexString(item.getContentHash())); } if(type != ModificationType.ADD) {
59,833
queuePacket(new ControllerPacket(buttonFlags, leftTrigger, rightTrigger, leftStickX, leftStickY, rightStickX, rightStickY)); } else { <BUG>queuePacket(new MultiControllerPacket((short) 0, buttonFlags, leftTrigger, </BUG> rightTrigger, leftStickX, leftStickY, rightStickX, rightStickY)); }
queuePacket(new ControllerPacket(buttonFlags, leftTrigger, rightTrigger, leftStickX, leftStickY, rightStickX, rightStickY));
59,834
queuePacket(new ControllerPacket(buttonFlags, leftTrigger, rightTrigger, leftStickX, leftStickY, rightStickX, rightStickY)); } else { <BUG>queuePacket(new MultiControllerPacket(controllerNumber, buttonFlags, leftTrigger, </BUG> rightTrigger, leftStickX, leftStickY, rightStickX, rightStickY)); }
queuePacket(new ControllerPacket(buttonFlags, leftTrigger, rightTrigger, leftStickX, leftStickY, rightStickX, rightStickY));
59,835
int majorVersion = Integer.parseInt(serverVersion.substring(0, serverVersion.indexOf('.'))); if (majorVersion < 3) { context.connListener.displayMessage("This app requires GeForce Experience 2.2.2 or later. Please upgrade GFE on your PC and try again."); return false; } <BUG>else if (majorVersion > 4) { </BUG> context.connListener.displayTransientMessage("This version of GFE is not currently supported. You may experience issues until this app is updated."); } switch (majorVersion) {
int majorVersion = Integer.parseInt(serverVersion.substring(0, serverVersion.indexOf('.'))); if (majorVersion < 3) { context.connListener.displayMessage("This app requires GeForce Experience 2.2.2 or later. Please upgrade GFE on your PC and try again."); return false; } else if (majorVersion > 5) { context.connListener.displayTransientMessage("This version of GFE is not currently supported. You may experience issues until this app is updated."); } switch (majorVersion) {
59,836
(short) preconstructedPayloads[IDX_START_A].length, preconstructedPayloads[IDX_START_A])); } private ControlStream.NvCtlResponse doStartB() throws IOException { <BUG>if (context.serverGeneration == ConnectionContext.SERVER_GENERATION_3) { </BUG> ByteBuffer payload = ByteBuffer.wrap(new byte[payloadLengths[IDX_START_B]]).order(ByteOrder.LITTLE_ENDIAN); payload.putInt(0); payload.putInt(0);
(short) preconstructedPayloads[IDX_START_A].length, preconstructedPayloads[IDX_START_A])); } private ControlStream.NvCtlResponse doStartB() throws IOException { if (context.serverGeneration != ConnectionContext.SERVER_GENERATION_4) { ByteBuffer payload = ByteBuffer.wrap(new byte[payloadLengths[IDX_START_B]]).order(ByteOrder.LITTLE_ENDIAN);
59,837
private void resyncConnection(int firstLostFrame, int nextSuccessfulFrame) { invalidReferenceFrameTuples.add(new int[]{firstLostFrame, nextSuccessfulFrame}); } public void connectionDetectedFrameLoss(int firstLostFrame, int nextSuccessfulFrame) { resyncConnection(firstLostFrame, nextSuccessfulFrame); <BUG>if (currentFrame < 150) { </BUG> return; } if (TimeHelper.getMonotonicMillis() > LOSS_PERIOD_MS + lossTimestamp) {
private void resyncConnection(int firstLostFrame, int nextSuccessfulFrame) { invalidReferenceFrameTuples.add(new int[]{firstLostFrame, nextSuccessfulFrame}); } public void connectionDetectedFrameLoss(int firstLostFrame, int nextSuccessfulFrame) { resyncConnection(firstLostFrame, nextSuccessfulFrame); if (lastGoodFrame < 150) { return; } if (TimeHelper.getMonotonicMillis() > LOSS_PERIOD_MS + lossTimestamp) {
59,838
lossTimestamp = 0; } } public void connectionSinkTooSlow(int firstLostFrame, int nextSuccessfulFrame) { resyncConnection(firstLostFrame, nextSuccessfulFrame); <BUG>if (currentFrame < 150) { </BUG> return; } if (++slowSinkCount == MAX_SLOW_SINK_COUNT) {
lossTimestamp = 0; } } public void connectionSinkTooSlow(int firstLostFrame, int nextSuccessfulFrame) { resyncConnection(firstLostFrame, nextSuccessfulFrame); if (lastGoodFrame < 150) { return; } if (++slowSinkCount == MAX_SLOW_SINK_COUNT) {
59,839
if (++slowSinkCount == MAX_SLOW_SINK_COUNT) { context.connListener.displayTransientMessage("Your device is processing the A/V data too slowly. Try lowering stream resolution and/or frame rate."); slowSinkCount = -MAX_SLOW_SINK_COUNT * MESSAGE_DELAY_FACTOR; } } <BUG>public void connectionReceivedFrame(int frameIndex) { currentFrame = frameIndex; </BUG> }
if (++slowSinkCount == MAX_SLOW_SINK_COUNT) { context.connListener.displayTransientMessage("Your device is processing the A/V data too slowly. Try lowering stream resolution and/or frame rate."); slowSinkCount = -MAX_SLOW_SINK_COUNT * MESSAGE_DELAY_FACTOR; } } public void connectionReceivedCompleteFrame(int frameIndex) { lastGoodFrame = frameIndex; } public void connectionSawFrame(int frameIndex) { lastSeenFrame = frameIndex; }
59,840
public static final byte KEY_DOWN = 0x03; public static final byte KEY_UP = 0x04; public static final byte MODIFIER_SHIFT = 0x01; public static final byte MODIFIER_CTRL = 0x02; public static final byte MODIFIER_ALT = 0x04; <BUG>short keyCode; byte keyDirection; byte modifier; </BUG> public KeyboardPacket(short keyCode, byte keyDirection, byte modifier) {
public static final byte KEY_DOWN = 0x03; public static final byte KEY_UP = 0x04; public static final byte MODIFIER_SHIFT = 0x01; public static final byte MODIFIER_CTRL = 0x02; public static final byte MODIFIER_ALT = 0x04; private short keyCode; private byte keyDirection; private byte modifier; public KeyboardPacket(short keyCode, byte keyDirection, byte modifier) {
59,841
return; } du.initialize(frameDataChainHead, frameDataLength, frameNumber, frameStartTime, flags, backingPacketHead); backingPacketTail = backingPacketHead = null; <BUG>controlListener.connectionReceivedFrame(frameNumber); </BUG> decodedUnits.addPopulatedObject(du); cleanupFrameState(); consecutiveFrameDrops = 0;
return; } du.initialize(frameDataChainHead, frameDataLength, frameNumber, frameStartTime, flags, backingPacketHead); backingPacketTail = backingPacketHead = null; controlListener.connectionReceivedCompleteFrame(frameNumber); decodedUnits.addPopulatedObject(du); cleanupFrameState(); consecutiveFrameDrops = 0;
59,842
if (SequenceHelper.isBeforeSigned((short)streamPacketIndex, (short)(lastPacketInStream + 1), false)) { return; } if (SequenceHelper.isBeforeSigned(frameIndex, nextFrameNumber, false)) { return; <BUG>} if (firstPacket && decodingFrame)</BUG> { LimeLog.warning("Network dropped end of a frame"); nextFrameNumber = frameIndex;
if (SequenceHelper.isBeforeSigned((short)streamPacketIndex, (short)(lastPacketInStream + 1), false)) { return; } if (SequenceHelper.isBeforeSigned(frameIndex, nextFrameNumber, false)) { return; } controlListener.connectionSawFrame(frameIndex); if (firstPacket && decodingFrame) { LimeLog.warning("Network dropped end of a frame"); nextFrameNumber = frameIndex;
59,843
import javax.crypto.SecretKey; import com.limelight.nvstream.av.video.VideoDecoderRenderer; import com.limelight.nvstream.av.video.VideoDecoderRenderer.VideoFormat; public class ConnectionContext { public static final int SERVER_GENERATION_3 = 3; <BUG>public static final int SERVER_GENERATION_4 = 4; public InetAddress serverAddress;</BUG> public StreamConfiguration streamConfig; public VideoDecoderRenderer videoDecoderRenderer; public NvConnectionListener connListener;
import javax.crypto.SecretKey; import com.limelight.nvstream.av.video.VideoDecoderRenderer; import com.limelight.nvstream.av.video.VideoDecoderRenderer.VideoFormat; public class ConnectionContext { public static final int SERVER_GENERATION_3 = 3; public static final int SERVER_GENERATION_4 = 4; public static final int SERVER_GENERATION_5 = 5; public InetAddress serverAddress; public StreamConfiguration streamConfig; public VideoDecoderRenderer videoDecoderRenderer; public NvConnectionListener connListener;
59,844
package com.limelight.nvstream.input; import java.nio.ByteBuffer; <BUG>import java.nio.ByteOrder; public class MouseButtonPacket extends InputPacket {</BUG> byte buttonEventType; byte mouseButton; private static final int PACKET_TYPE = 0x5;
package com.limelight.nvstream.input; import java.nio.ByteBuffer; import java.nio.ByteOrder; import com.limelight.nvstream.ConnectionContext; public class MouseButtonPacket extends InputPacket { byte buttonEventType; byte mouseButton; private static final int PACKET_TYPE = 0x5;
59,845
private static final byte PRESS_EVENT = 0x07; private static final byte RELEASE_EVENT = 0x08; public static final byte BUTTON_LEFT = 0x01; public static final byte BUTTON_MIDDLE = 0x02; public static final byte BUTTON_RIGHT = 0x03; <BUG>public MouseButtonPacket(boolean buttonDown, byte mouseButton) </BUG> { super(PACKET_TYPE); this.mouseButton = mouseButton;
private static final byte PRESS_EVENT = 0x07; private static final byte RELEASE_EVENT = 0x08; public static final byte BUTTON_LEFT = 0x01; public static final byte BUTTON_MIDDLE = 0x02; public static final byte BUTTON_RIGHT = 0x03; public MouseButtonPacket(ConnectionContext context, boolean buttonDown, byte mouseButton) { super(PACKET_TYPE); this.mouseButton = mouseButton;
59,846
String category = null; Collection<String> categories = null; String triggerId = null; Collection<String> triggerIds = null; Map<String, String> tags = null; <BUG>boolean thin = false; public EventsCriteria() {</BUG> super(); } public Long getStartTime() {
String category = null; Collection<String> categories = null; String triggerId = null; Collection<String> triggerIds = null; Map<String, String> tags = null; boolean thin = false; Integer criteriaNoQuerySize = null; public EventsCriteria() { super(); } public Long getStartTime() {
59,847
} @Override public String toString() { return "EventsCriteria [startTime=" + startTime + ", endTime=" + endTime + ", eventId=" + eventId + ", eventIds=" + eventIds + ", category=" + category + ", categories=" + categories + ", triggerId=" <BUG>+ triggerId + ", triggerIds=" + triggerIds + ", tags=" + tags + ", thin=" + thin + "]"; }</BUG> }
} public void addTag(String name, String value) { if (null == tags) { tags = new HashMap<>(); }
59,848
public static final String DELETE_ACTION_HISTORY_RESULT; public static final String DELETE_ACTION_PLUGIN; public static final String DELETE_ALERT; public static final String DELETE_ALERT_CTIME; public static final String DELETE_ALERT_LIFECYCLE; <BUG>public static final String DELETE_ALERT_SEVERITY; public static final String DELETE_ALERT_STATUS;</BUG> public static final String DELETE_ALERT_TRIGGER; public static final String DELETE_CONDITIONS; public static final String DELETE_CONDITIONS_MODE;
public static final String DELETE_ACTION_HISTORY_RESULT; public static final String DELETE_ACTION_PLUGIN; public static final String DELETE_ALERT; public static final String DELETE_ALERT_CTIME; public static final String DELETE_ALERT_LIFECYCLE; public static final String DELETE_ALERT_TRIGGER; public static final String DELETE_CONDITIONS; public static final String DELETE_CONDITIONS_MODE;
59,849
public static final String INSERT_ACTION_PLUGIN; public static final String INSERT_ACTION_PLUGIN_DEFAULT_PROPERTIES; public static final String INSERT_ALERT; public static final String INSERT_ALERT_CTIME; public static final String INSERT_ALERT_LIFECYCLE; <BUG>public static final String INSERT_ALERT_SEVERITY; public static final String INSERT_ALERT_STATUS;</BUG> public static final String INSERT_ALERT_TRIGGER; public static final String INSERT_CONDITION_AVAILABILITY; public static final String INSERT_CONDITION_COMPARE;
public static final String INSERT_ACTION_PLUGIN; public static final String INSERT_ACTION_PLUGIN_DEFAULT_PROPERTIES; public static final String INSERT_ALERT; public static final String INSERT_ALERT_CTIME; public static final String INSERT_ALERT_LIFECYCLE; public static final String INSERT_ALERT_TRIGGER; public static final String INSERT_CONDITION_AVAILABILITY; public static final String INSERT_CONDITION_COMPARE;
59,850
public static final String SELECT_ALERT_CTIME_START; public static final String SELECT_ALERT_CTIME_START_END; public static final String SELECT_ALERT_LIFECYCLE_END; public static final String SELECT_ALERT_LIFECYCLE_START; public static final String SELECT_ALERT_LIFECYCLE_START_END; <BUG>public static final String SELECT_ALERT_STATUS; public static final String SELECT_ALERT_SEVERITY;</BUG> public static final String SELECT_ALERT_TRIGGER; public static final String SELECT_ALERTS_BY_TENANT; public static final String SELECT_CONDITION_ID;
public static final String SELECT_ALERT_CTIME_START; public static final String SELECT_ALERT_CTIME_START_END; public static final String SELECT_ALERT_LIFECYCLE_END; public static final String SELECT_ALERT_LIFECYCLE_START; public static final String SELECT_ALERT_LIFECYCLE_START_END; public static final String SELECT_ALERT_TRIGGER; public static final String SELECT_ALERTS_BY_TENANT; public static final String SELECT_CONDITION_ID;
59,851
DELETE_ALERT = "DELETE FROM " + keyspace + ".alerts " + "WHERE tenantId = ? AND alertId = ? "; DELETE_ALERT_CTIME = "DELETE FROM " + keyspace + ".alerts_ctimes " + "WHERE tenantId = ? AND ctime = ? AND alertId = ? "; DELETE_ALERT_LIFECYCLE = "DELETE FROM " + keyspace + ".alerts_lifecycle " + "WHERE tenantId = ? AND status = ? AND stime = ? AND alertId = ? "; <BUG>DELETE_ALERT_SEVERITY = "DELETE FROM " + keyspace + ".alerts_severities " + "WHERE tenantId = ? AND severity = ? AND alertId = ? "; DELETE_ALERT_STATUS = "DELETE FROM " + keyspace + ".alerts_statuses " + "WHERE tenantId = ? AND status = ? AND alertId = ? ";</BUG> DELETE_ALERT_TRIGGER = "DELETE FROM " + keyspace + ".alerts_triggers "
DELETE_ALERT = "DELETE FROM " + keyspace + ".alerts " + "WHERE tenantId = ? AND alertId = ? "; DELETE_ALERT_CTIME = "DELETE FROM " + keyspace + ".alerts_ctimes " + "WHERE tenantId = ? AND ctime = ? AND alertId = ? "; DELETE_ALERT_LIFECYCLE = "DELETE FROM " + keyspace + ".alerts_lifecycle " + "WHERE tenantId = ? AND status = ? AND stime = ? AND alertId = ? "; DELETE_ALERT_TRIGGER = "DELETE FROM " + keyspace + ".alerts_triggers "
59,852
INSERT_ALERT = "INSERT INTO " + keyspace + ".alerts " + "(tenantId, alertId, payload) VALUES (?, ?, ?) "; INSERT_ALERT_CTIME = "INSERT INTO " + keyspace + ".alerts_ctimes " + "(tenantId, alertId, ctime) VALUES (?, ?, ?) "; INSERT_ALERT_LIFECYCLE = "INSERT INTO " + keyspace + ".alerts_lifecycle " + "(tenantId, alertId, status, stime) VALUES (?, ?, ?, ?) "; <BUG>INSERT_ALERT_SEVERITY = "INSERT INTO " + keyspace + ".alerts_severities " + "(tenantId, alertId, severity) VALUES (?, ?, ?) "; INSERT_ALERT_STATUS = "INSERT INTO " + keyspace + ".alerts_statuses " + "(tenantId, alertId, status) VALUES (?, ?, ?) ";</BUG> INSERT_ALERT_TRIGGER = "INSERT INTO " + keyspace + ".alerts_triggers "
INSERT_ALERT = "INSERT INTO " + keyspace + ".alerts " + "(tenantId, alertId, payload) VALUES (?, ?, ?) "; INSERT_ALERT_CTIME = "INSERT INTO " + keyspace + ".alerts_ctimes " + "(tenantId, alertId, ctime) VALUES (?, ?, ?) "; INSERT_ALERT_LIFECYCLE = "INSERT INTO " + keyspace + ".alerts_lifecycle " + "(tenantId, alertId, status, stime) VALUES (?, ?, ?, ?) "; INSERT_ALERT_TRIGGER = "INSERT INTO " + keyspace + ".alerts_triggers "
59,853
+ "WHERE tenantId = ? AND status = ? AND stime <= ? "; SELECT_ALERT_LIFECYCLE_START = "SELECT alertId FROM " + keyspace + ".alerts_lifecycle " + "WHERE tenantId = ? AND status = ? AND stime >= ? "; SELECT_ALERT_LIFECYCLE_START_END = "SELECT alertId FROM " + keyspace + ".alerts_lifecycle " + "WHERE tenantId = ? AND status = ? AND stime >= ? AND stime <= ? "; <BUG>SELECT_ALERT_SEVERITY = "SELECT alertId FROM " + keyspace + ".alerts_severities " + "WHERE tenantId = ? AND severity = ? "; SELECT_ALERT_STATUS = "SELECT alertId FROM " + keyspace + ".alerts_statuses " + "WHERE tenantId = ? AND status = ? ";</BUG> SELECT_ALERTS_BY_TENANT = "SELECT payload FROM " + keyspace + ".alerts " + "WHERE tenantId = ? ";
+ "WHERE tenantId = ? AND status = ? AND stime <= ? "; SELECT_ALERT_LIFECYCLE_START = "SELECT alertId FROM " + keyspace + ".alerts_lifecycle " + "WHERE tenantId = ? AND status = ? AND stime >= ? "; SELECT_ALERT_LIFECYCLE_START_END = "SELECT alertId FROM " + keyspace + ".alerts_lifecycle " + "WHERE tenantId = ? AND status = ? AND stime >= ? AND stime <= ? "; SELECT_ALERTS_BY_TENANT = "SELECT payload FROM " + keyspace + ".alerts " + "WHERE tenantId = ? ";
59,854
import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; <BUG>import java.util.stream.Collectors; import javax.ejb.EJB;</BUG> import javax.ejb.Local; import javax.ejb.Stateless; import javax.ejb.TransactionAttribute;
import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import java.util.stream.Collectors; import javax.annotation.PostConstruct; import javax.ejb.EJB; import javax.ejb.Local; import javax.ejb.Stateless; import javax.ejb.TransactionAttribute;
59,855
import org.hawkular.alerts.api.model.trigger.Trigger; import org.hawkular.alerts.api.services.ActionsService; import org.hawkular.alerts.api.services.AlertsCriteria; import org.hawkular.alerts.api.services.AlertsService; import org.hawkular.alerts.api.services.DefinitionsService; <BUG>import org.hawkular.alerts.api.services.EventsCriteria; import org.hawkular.alerts.engine.impl.IncomingDataManagerImpl.IncomingData;</BUG> import org.hawkular.alerts.engine.impl.IncomingDataManagerImpl.IncomingEvents; import org.hawkular.alerts.engine.log.MsgLogger; import org.hawkular.alerts.engine.service.AlertsEngine;
import org.hawkular.alerts.api.model.trigger.Trigger; import org.hawkular.alerts.api.services.ActionsService; import org.hawkular.alerts.api.services.AlertsCriteria; import org.hawkular.alerts.api.services.AlertsService; import org.hawkular.alerts.api.services.DefinitionsService; import org.hawkular.alerts.api.services.EventsCriteria; import org.hawkular.alerts.api.services.PropertiesService; import org.hawkular.alerts.engine.impl.IncomingDataManagerImpl.IncomingData; import org.hawkular.alerts.engine.impl.IncomingDataManagerImpl.IncomingEvents; import org.hawkular.alerts.engine.log.MsgLogger; import org.hawkular.alerts.engine.service.AlertsEngine;
59,856
import com.datastax.driver.core.Session; import com.google.common.util.concurrent.Futures; @Local(AlertsService.class) @Stateless @TransactionAttribute(value = TransactionAttributeType.NOT_SUPPORTED) <BUG>public class CassAlertsServiceImpl implements AlertsService { private final MsgLogger msgLog = MsgLogger.LOGGER; private final Logger log = Logger.getLogger(CassAlertsServiceImpl.class); @EJB</BUG> AlertsEngine alertsEngine;
import com.datastax.driver.core.Session; import com.google.common.util.concurrent.Futures; @Local(AlertsService.class) @Stateless @TransactionAttribute(value = TransactionAttributeType.NOT_SUPPORTED) public class CassAlertsServiceImpl implements AlertsService { private static final String CRITERIA_NO_QUERY_SIZE = "hawkular-alerts.criteria-no-query-size"; private static final String CRITERIA_NO_QUERY_SIZE_ENV = "CRITERIA_NO_QUERY_SIZE"; private static final String CRITERIA_NO_QUERY_SIZE_DEFAULT = "200"; private final MsgLogger msgLog = MsgLogger.LOGGER; private final Logger log = Logger.getLogger(CassAlertsServiceImpl.class); private int criteriaNoQuerySize;
59,857
log.debug("Adding " + alerts.size() + " alerts"); } PreparedStatement insertAlert = CassStatement.get(session, CassStatement.INSERT_ALERT); PreparedStatement insertAlertTrigger = CassStatement.get(session, CassStatement.INSERT_ALERT_TRIGGER); PreparedStatement insertAlertCtime = CassStatement.get(session, CassStatement.INSERT_ALERT_CTIME); <BUG>PreparedStatement insertAlertStatus = CassStatement.get(session, CassStatement.INSERT_ALERT_STATUS); PreparedStatement insertAlertSeverity = CassStatement.get(session, CassStatement.INSERT_ALERT_SEVERITY);</BUG> PreparedStatement insertTag = CassStatement.get(session, CassStatement.INSERT_TAG); try { List<ResultSetFuture> futures = new ArrayList<>();
log.debug("Adding " + alerts.size() + " alerts"); } PreparedStatement insertAlert = CassStatement.get(session, CassStatement.INSERT_ALERT); PreparedStatement insertAlertTrigger = CassStatement.get(session, CassStatement.INSERT_ALERT_TRIGGER); PreparedStatement insertAlertCtime = CassStatement.get(session, CassStatement.INSERT_ALERT_CTIME); PreparedStatement insertTag = CassStatement.get(session, CassStatement.INSERT_TAG); try { List<ResultSetFuture> futures = new ArrayList<>();
59,858
futures.add(session.executeAsync(insertAlertTrigger.bind(a.getTenantId(), a.getAlertId(), a.getTriggerId()))); futures.add(session.executeAsync(insertAlertCtime.bind(a.getTenantId(), a.getAlertId(), a.getCtime()))); <BUG>futures.add(session.executeAsync(insertAlertStatus.bind(a.getTenantId(), a.getAlertId(), a.getStatus().name()))); futures.add(session.executeAsync(insertAlertSeverity.bind(a.getTenantId(), a.getAlertId(), a.getSeverity().name())));</BUG> a.getTags().entrySet().stream().forEach(tag -> {
futures.add(session.executeAsync(insertAlertTrigger.bind(a.getTenantId(), a.getAlertId(), a.getTriggerId()))); futures.add(session.executeAsync(insertAlertCtime.bind(a.getTenantId(), a.getAlertId(), a.getCtime()))); a.getTags().entrySet().stream().forEach(tag -> {
59,859
for (Row row : rsAlerts) { String payload = row.getString("payload"); Alert alert = JsonUtil.fromJson(payload, Alert.class, thin); alerts.add(alert); } <BUG>} } catch (Exception e) { msgLog.errorDatabaseException(e.getMessage()); throw e; } return preparePage(alerts, pager);</BUG> }
for (Row row : rsAlerts) { String payload = row.getString("payload"); Alert alert = JsonUtil.fromJson(payload, Alert.class, thin); alerts.add(alert); } }
59,860
try { if (filter) { if (criteria.hasEventIdCriteria()) { Set<String> idsFilteredByEvents = filterByEvents(criteria); if (activeFilter) { <BUG>eventIds.retainAll(idsFilteredByEvents); if (eventIds.isEmpty()) {</BUG> return new Page<>(events, pager, 0); <BUG>} } else { eventIds.addAll(idsFilteredByEvents);</BUG> }
try { if (filter) { if (criteria.hasEventIdCriteria()) { Set<String> idsFilteredByEvents = filterByEvents(criteria); if (activeFilter) { eventIds.retainAll(idsFilteredByEvents); } else { eventIds.addAll(idsFilteredByEvents); } if (eventIds.isEmpty()) { return new Page<>(events, pager, 0); }
59,861
eventIds.addAll(idsFilteredByTime); }</BUG> activeFilter = true; <BUG>} if (criteria.hasCategoryCriteria()) { Set<String> idsFilteredByCategory = filterByCategories(tenantId, criteria);</BUG> if (activeFilter) { <BUG>eventIds.retainAll(idsFilteredByCategory); if (eventIds.isEmpty()) {</BUG> return new Page<>(events, pager, 0);
eventIds.addAll(idsFilteredByTime); } if (eventIds.isEmpty()) { return new Page<>(events, pager, 0); } activeFilter = true;
59,862
if (alertsToDelete.isEmpty()) { return 0; } PreparedStatement deleteAlert = CassStatement.get(session, CassStatement.DELETE_ALERT); PreparedStatement deleteAlertCtime = CassStatement.get(session, CassStatement.DELETE_ALERT_CTIME); <BUG>PreparedStatement deleteAlertSeverity = CassStatement.get(session, CassStatement.DELETE_ALERT_SEVERITY); PreparedStatement deleteAlertStatus = CassStatement.get(session, CassStatement.DELETE_ALERT_STATUS);</BUG> PreparedStatement deleteAlertTrigger = CassStatement.get(session, CassStatement.DELETE_ALERT_TRIGGER); PreparedStatement deleteAlertLifecycle = CassStatement.get(session, CassStatement.DELETE_ALERT_LIFECYCLE); <BUG>if (deleteAlert == null || deleteAlertCtime == null || deleteAlertSeverity == null || deleteAlertStatus == null || deleteAlertTrigger == null || deleteAlertLifecycle == null) { throw new RuntimeException("delete*Alerts PreparedStatement is null");</BUG> }
if (alertsToDelete.isEmpty()) { return 0; } PreparedStatement deleteAlert = CassStatement.get(session, CassStatement.DELETE_ALERT); PreparedStatement deleteAlertCtime = CassStatement.get(session, CassStatement.DELETE_ALERT_CTIME); PreparedStatement deleteAlertTrigger = CassStatement.get(session, CassStatement.DELETE_ALERT_TRIGGER); PreparedStatement deleteAlertLifecycle = CassStatement.get(session, CassStatement.DELETE_ALERT_LIFECYCLE); if (deleteAlert == null || deleteAlertCtime == null || deleteAlertTrigger == null || deleteAlertLifecycle == null) { throw new RuntimeException("delete*Alerts PreparedStatement is null"); }
59,863
for (Alert a : alertsToDelete) { String id = a.getAlertId(); List<ResultSetFuture> futures = new ArrayList<>(); futures.add(session.executeAsync(deleteAlert.bind(tenantId, id))); futures.add(session.executeAsync(deleteAlertCtime.bind(tenantId, a.getCtime(), id))); <BUG>futures.add(session.executeAsync(deleteAlertSeverity.bind(tenantId, a.getSeverity().name(), id))); futures.add(session.executeAsync(deleteAlertStatus.bind(tenantId, a.getStatus().name(), id)));</BUG> futures.add(session.executeAsync(deleteAlertTrigger.bind(tenantId, a.getTriggerId(), id))); a.getLifecycle().stream().forEach(l -> { futures.add(
for (Alert a : alertsToDelete) { String id = a.getAlertId(); List<ResultSetFuture> futures = new ArrayList<>(); futures.add(session.executeAsync(deleteAlert.bind(tenantId, id))); futures.add(session.executeAsync(deleteAlertCtime.bind(tenantId, a.getCtime(), id))); futures.add(session.executeAsync(deleteAlertTrigger.bind(tenantId, a.getTriggerId(), id))); a.getLifecycle().stream().forEach(l -> { futures.add(
59,864
private Alert updateAlertStatus(Alert alert) throws Exception { if (alert == null || alert.getAlertId() == null || alert.getAlertId().isEmpty()) { throw new IllegalArgumentException("AlertId must be not null"); } try { <BUG>PreparedStatement deleteAlertStatus = CassStatement.get(session, CassStatement.DELETE_ALERT_STATUS); PreparedStatement insertAlertStatus = CassStatement.get(session, CassStatement.INSERT_ALERT_STATUS);</BUG> PreparedStatement insertAlertLifecycle = CassStatement.get(session,
private Alert updateAlertStatus(Alert alert) throws Exception { if (alert == null || alert.getAlertId() == null || alert.getAlertId().isEmpty()) { throw new IllegalArgumentException("AlertId must be not null"); } try { PreparedStatement insertAlertLifecycle = CassStatement.get(session,
59,865
PreparedStatement insertAlertLifecycle = CassStatement.get(session, CassStatement.INSERT_ALERT_LIFECYCLE); PreparedStatement updateAlert = CassStatement.get(session, CassStatement.UPDATE_ALERT); List<ResultSetFuture> futures = new ArrayList<>(); <BUG>for (Status statusToDelete : EnumSet.complementOf(EnumSet.of(alert.getStatus()))) { futures.add(session.executeAsync(deleteAlertStatus.bind(alert.getTenantId(), statusToDelete.name(), alert.getAlertId()))); } futures.add(session.executeAsync(insertAlertStatus.bind(alert.getTenantId(), alert.getAlertId(), alert .getStatus().name())));</BUG> Alert.LifeCycle lifecycle = alert.getCurrentLifecycle();
PreparedStatement insertAlertLifecycle = CassStatement.get(session, CassStatement.INSERT_ALERT_LIFECYCLE); PreparedStatement updateAlert = CassStatement.get(session, CassStatement.UPDATE_ALERT); List<ResultSetFuture> futures = new ArrayList<>(); Alert.LifeCycle lifecycle = alert.getCurrentLifecycle();
59,866
customTokens.put("%%mlFinalForestsPerHost%%", hubConfig.finalForestsPerHost.toString()); customTokens.put("%%mlTraceAppserverName%%", hubConfig.traceHttpName); customTokens.put("%%mlTracePort%%", hubConfig.tracePort.toString()); customTokens.put("%%mlTraceDbName%%", hubConfig.traceDbName); customTokens.put("%%mlTraceForestsPerHost%%", hubConfig.traceForestsPerHost.toString()); <BUG>customTokens.put("%%mlModulesDbName%%", hubConfig.modulesDbName); }</BUG> public void init() { try { LOGGER.error("PLUGINS DIR: " + pluginsDir.toString());
customTokens.put("%%mlFinalForestsPerHost%%", hubConfig.finalForestsPerHost.toString()); customTokens.put("%%mlTraceAppserverName%%", hubConfig.traceHttpName); customTokens.put("%%mlTracePort%%", hubConfig.tracePort.toString()); customTokens.put("%%mlTraceDbName%%", hubConfig.traceDbName); customTokens.put("%%mlTraceForestsPerHost%%", hubConfig.traceForestsPerHost.toString()); customTokens.put("%%mlModulesDbName%%", hubConfig.modulesDbName); customTokens.put("%%mlTriggersDbName%%", hubConfig.triggersDbName); customTokens.put("%%mlSchemasDbName%%", hubConfig.schemasDbName); } public void init() { try { LOGGER.error("PLUGINS DIR: " + pluginsDir.toString());
59,867
}); directoryScanner.scan(); String[] fileNames = directoryScanner.getIncludedFiles(); for (String fileName : fileNames) { fileName = _normalizeFileName(fileName); <BUG>if (fileName.endsWith(".action")) { _actionFileNames.add(fileName); _actionNames.add(_getName(fileName)); </BUG> _actionRootElements.put(fileName, _getRootElement(fileName));
}); directoryScanner.scan(); String[] fileNames = directoryScanner.getIncludedFiles(); for (String fileName : fileNames) { fileName = _normalizeFileName(fileName); if (fileName.endsWith(".action")) { String actionName = _getName(fileName); if (_actionNames.contains(actionName)) { throw new Exception( "Duplicate name " + actionName + " at " + fileName);
59,868
_actionFileNames.add(fileName); _actionNames.add(_getName(fileName)); </BUG> _actionRootElements.put(fileName, _getRootElement(fileName)); } <BUG>else if (fileName.endsWith(".function")) { _functionClassNames.add(_getClassName(fileName));</BUG> _functionFileNames.add(fileName); <BUG>_functionNames.add(_getName(fileName)); </BUG> _functionRootElements.put(fileName, _getRootElement(fileName));
_actionFileNames.add(fileName); _actionNames.add(actionName); _actionRootElements.put(fileName, _getRootElement(fileName)); } else if (fileName.endsWith(".function")) { String functionName = _getName(fileName); if (_functionNames.contains(functionName)) { throw new Exception( "Duplicate name " + functionName + " at " + fileName); } _functionClassNames.add(_getClassName(fileName)); _functionFileNames.add(fileName); _functionNames.add(functionName);
59,869
_functionFileNames.add(fileName); <BUG>_functionNames.add(_getName(fileName)); </BUG> _functionRootElements.put(fileName, _getRootElement(fileName)); } <BUG>else if (fileName.endsWith(".macro")) { _macroClassNames.add(_getClassName(fileName));</BUG> _macroFileNames.add(fileName); <BUG>_macroNames.add(_getName(fileName)); _macroRootElements.put(fileName, _getRootElement(fileName));</BUG> }
_functionFileNames.add(fileName); _functionNames.add(functionName); _functionRootElements.put(fileName, _getRootElement(fileName));
59,870
_pathFileNames.add(fileName); <BUG>_pathNames.add(_getName(fileName)); _pathRootElements.put(fileName, _getRootElement(fileName));</BUG> } <BUG>else if (fileName.endsWith(".testcase")) { _testCaseClassNames.add(_getClassName(fileName));</BUG> _testCaseFileNames.add(fileName); <BUG>_testCaseNames.add(_getName(fileName)); </BUG> _testCaseRootElements.put(fileName, _getRootElement(fileName));
_pathFileNames.add(fileName); _pathNames.add(pathName); _pathRootElements.put(fileName, _getRootElement(fileName));
59,871
_testCaseFileNames.add(fileName); <BUG>_testCaseNames.add(_getName(fileName)); </BUG> _testCaseRootElements.put(fileName, _getRootElement(fileName)); } <BUG>else if (fileName.endsWith(".testsuite")) { _testSuiteClassNames.add(_getClassName(fileName));</BUG> _testSuiteFileNames.add(fileName); <BUG>_testSuiteNames.add(_getName(fileName)); </BUG> _testSuiteRootElements.put(fileName, _getRootElement(fileName));
_testCaseFileNames.add(fileName); _testCaseNames.add(testCaseName); _testCaseRootElements.put(fileName, _getRootElement(fileName)); } else if (fileName.endsWith(".testsuite")) { String testSuiteName = _getName(fileName); if (_testSuiteNames.contains(testSuiteName)) { throw new Exception( "Duplicate name " + testSuiteName + " at " + fileName); } _testSuiteClassNames.add(_getClassName(fileName)); _testSuiteFileNames.add(fileName); _testSuiteNames.add(testSuiteName);
59,872
package org.mule.impl.model.direct; <BUG>import org.mule.MuleManager; import org.mule.config.i18n.Message; import org.mule.config.i18n.Messages;</BUG> import org.mule.impl.MuleDescriptor; import org.mule.impl.MuleMessage;
package org.mule.impl.model.direct; import org.mule.impl.MuleDescriptor; import org.mule.impl.MuleMessage;
59,873
import org.mule.impl.model.MuleProxy; import org.mule.umo.UMOEvent; import org.mule.umo.UMOException; import org.mule.umo.UMOMessage; import org.mule.umo.lifecycle.InitialisationException; <BUG>import org.mule.umo.manager.UMOManager;</BUG> import org.mule.umo.model.UMOModel; <BUG>import org.mule.util.ClassHelper; import org.apache.commons.beanutils.BeanUtils;</BUG> import java.util.List;
import org.mule.impl.model.MuleProxy; import org.mule.umo.UMOEvent; import org.mule.umo.UMOException; import org.mule.umo.UMOMessage; import org.mule.umo.lifecycle.InitialisationException; import org.mule.umo.model.UMOModel; import java.util.List;
59,874
public DirectComponent(MuleDescriptor descriptor, UMOModel model) { super(descriptor, model); } protected void doInitialise() throws InitialisationException { try { <BUG>Object component = create(); </BUG> proxy = new DefaultMuleProxy(component, descriptor, null); proxy.setStatistics(getStatistics()); } catch (UMOException e) {
public DirectComponent(MuleDescriptor descriptor, UMOModel model) { super(descriptor, model); } protected void doInitialise() throws InitialisationException { try { Object component = createComponent(); proxy = new DefaultMuleProxy(component, descriptor, null); proxy.setStatistics(getStatistics()); } catch (UMOException e) {
59,875
import org.mule.config.i18n.Message; import org.mule.config.i18n.Messages; import org.mule.impl.FailedToQueueEventException; import org.mule.impl.MuleDescriptor; import org.mule.impl.MuleEvent; <BUG>import org.mule.impl.model.AbstractComponent; import org.mule.impl.model.MuleProxy;</BUG> import org.mule.umo.ComponentException; import org.mule.umo.UMOEvent; import org.mule.umo.UMOException;
import org.mule.config.i18n.Message; import org.mule.config.i18n.Messages; import org.mule.impl.FailedToQueueEventException; import org.mule.impl.MuleDescriptor; import org.mule.impl.MuleEvent; import org.mule.impl.model.AbstractComponent; import org.mule.impl.model.DefaultMuleProxy; import org.mule.impl.model.MuleProxy; import org.mule.umo.ComponentException; import org.mule.umo.UMOEvent; import org.mule.umo.UMOException;
59,876
import javax.resource.spi.work.Work; import javax.resource.spi.work.WorkException; import javax.resource.spi.work.WorkManager; import java.util.NoSuchElementException; public class SedaComponent extends AbstractComponent implements Work { <BUG>protected ObjectPool proxyPool = null; protected UMOWorkManager workManager;</BUG> protected String descriptorQueueName; <BUG>protected int queueTimeout = 0; public SedaComponent(MuleDescriptor descriptor, SedaModel model) {</BUG> super(descriptor, model);
import javax.resource.spi.work.Work; import javax.resource.spi.work.WorkException; import javax.resource.spi.work.WorkManager; import java.util.NoSuchElementException; public class SedaComponent extends AbstractComponent implements Work { protected ObjectPool proxyPool = null; protected MuleProxy componentProxy = null; protected UMOWorkManager workManager; protected String descriptorQueueName; protected int queueTimeout = 0; protected boolean enablePooling = true; protected boolean componentPerRequest = false; public SedaComponent(MuleDescriptor descriptor, SedaModel model) { super(descriptor, model);
59,877
protected String descriptorQueueName; <BUG>protected int queueTimeout = 0; public SedaComponent(MuleDescriptor descriptor, SedaModel model) {</BUG> super(descriptor, model); descriptorQueueName = descriptor.getName() + ".component"; <BUG>queueTimeout = model.getQueueTimeout(); }</BUG> public synchronized void doInitialise() throws InitialisationException { ThreadingProfile tp = descriptor.getThreadingProfile(); workManager = tp.createWorkManager(descriptor.getName());
protected String descriptorQueueName; protected int queueTimeout = 0; protected boolean enablePooling = true; protected boolean componentPerRequest = false; public SedaComponent(MuleDescriptor descriptor, SedaModel model) { super(descriptor, model); descriptorQueueName = descriptor.getName() + ".component"; queueTimeout = model.getQueueTimeout(); enablePooling = model.isEnablePooling(); componentPerRequest = model.isComponentPerRequest(); } public synchronized void doInitialise() throws InitialisationException { ThreadingProfile tp = descriptor.getThreadingProfile(); workManager = tp.createWorkManager(descriptor.getName());
59,878
proxy.start(); proxy.onEvent(queueSession, event); workManager.scheduleWork(proxy, WorkManager.INDEFINITE, null, null); } } catch (Exception e) { <BUG>if (proxy != null) { try {</BUG> proxyPool.returnObject(proxy); } catch (Exception e2) { logger.info("Failed to return proxy to pool", e2);
proxy.start(); proxy.onEvent(queueSession, event); workManager.scheduleWork(proxy, WorkManager.INDEFINITE, null, null); } } catch (Exception e) { if (proxy != null && proxyPool!=null) { try { proxyPool.returnObject(proxy); } catch (Exception e2) { logger.info("Failed to return proxy to pool", e2);
59,879
package org.mule.impl.model; <BUG>import edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean; import org.apache.commons.logging.Log;</BUG> import org.apache.commons.logging.LogFactory; import org.mule.MuleManager; import org.mule.config.i18n.Message;
package org.mule.impl.model; import edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean; import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.mule.MuleManager; import org.mule.config.i18n.Message;
59,880
} public void doInitialise() throws InitialisationException { super.doInitialise(); Object component = null; try { <BUG>component = create(); </BUG> } catch (UMOException e) { throw new InitialisationException(e, this); }
} public void doInitialise() throws InitialisationException { super.doInitialise(); Object component = null; try { component = createComponent(); } catch (UMOException e) { throw new InitialisationException(e, this); }
59,881
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.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.security.DigestOutputStream; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.text.DateFormat; import java.util.ArrayList; import java.util.Collections; import java.util.Date; import java.util.List; public final class PatchUtils {
59,882
package org.jboss.as.patching; import org.jboss.as.controller.AttributeDefinition; <BUG>import org.jboss.as.controller.SimpleAttributeDefinition;</BUG> import org.jboss.as.controller.SimpleAttributeDefinitionBuilder; import org.jboss.dmr.ModelType; <BUG>class Constants { </BUG> static final AttributeDefinition PATCH_ID = SimpleAttributeDefinitionBuilder.create("patch-id", ModelType.STRING).build();
package org.jboss.as.patching; import org.jboss.as.controller.AttributeDefinition; import org.jboss.as.controller.SimpleAttributeDefinitionBuilder; import org.jboss.dmr.ModelType; public class Constants {
59,883
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 {
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; import org.jboss.logging.annotations.MessageBundle; import org.jboss.logging.annotations.Cause; import java.io.IOException; import java.util.List; @MessageBundle(projectCode = "JBAS") public interface PatchMessages {
59,884
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;
package org.jboss.as.patching.runner; import static org.jboss.as.patching.runner.PatchUtils.generateTimestamp; import org.jboss.as.boot.DirectoryStructure; import org.jboss.as.patching.CommonAttributes; import org.jboss.as.patching.LocalPatchInfo; import org.jboss.as.patching.PatchInfo; import org.jboss.as.patching.PatchLogger; import org.jboss.as.patching.PatchMessages;
59,885
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"),
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"), ADDED_MODULE("added-module"), APPLIES_TO_VERSION("applies-to-version"), BUNDLES("bundles"), CUMULATIVE("cumulative"), DESCRIPTION("description"), MISC_FILES("misc-files"),
59,886
writer.writeEndElement(); final Patch.PatchType type = patch.getPatchType(); <BUG>final List<String> appliesTo = patch.getAppliesTo();</BUG> if(type == Patch.PatchType.ONE_OFF) { <BUG>writer.writeEmptyElement(Element.ONE_OFF.name); </BUG> } else { <BUG>writer.writeEmptyElement(Element.CUMULATIVE.name); </BUG> writer.writeAttribute(Attribute.RESULTING_VERSION.name, patch.getResultingVersion());
writer.writeEndElement(); writer.writeStartElement(Element.DESCRIPTION.name); writer.writeCharacters(patch.getDescription()); writer.writeEndElement(); final Patch.PatchType type = patch.getPatchType(); if(type == Patch.PatchType.ONE_OFF) { writer.writeStartElement(Element.ONE_OFF.name); } else { writer.writeStartElement(Element.CUMULATIVE.name); writer.writeAttribute(Attribute.RESULTING_VERSION.name, patch.getResultingVersion());
59,887
} else { <BUG>writer.writeEmptyElement(Element.CUMULATIVE.name); </BUG> writer.writeAttribute(Attribute.RESULTING_VERSION.name, patch.getResultingVersion()); } <BUG>writer.writeAttribute(Attribute.APPLIES_TO_VERSION.name, appliesTo); final List<ContentModification> bundlesAdd = new ArrayList<ContentModification>();</BUG> final List<ContentModification> bundlesUpdate = new ArrayList<ContentModification>(); final List<ContentModification> bundlesRemove = new ArrayList<ContentModification>(); final List<ContentModification> miscAdd = new ArrayList<ContentModification>();
} else { writer.writeStartElement(Element.CUMULATIVE.name); writer.writeAttribute(Attribute.RESULTING_VERSION.name, patch.getResultingVersion()); } writeAppliesToVersions(writer, patch.getAppliesTo()); writer.writeEndElement(); // </one-off> or </cumulative> final List<ContentModification> bundlesAdd = new ArrayList<ContentModification>(); final List<ContentModification> bundlesUpdate = new ArrayList<ContentModification>(); final List<ContentModification> bundlesRemove = new ArrayList<ContentModification>(); final List<ContentModification> miscAdd = new ArrayList<ContentModification>();
59,888
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) {
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) { case RESULTING_VERSION: if(type == Patch.PatchType.CUMULATIVE) {
59,889
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) {
final StringBuilder path = new StringBuilder(); for(final String p : item.getPath()) { path.append(p).append(PATH_DELIMITER); } path.append(item.getName()); writer.writeAttribute(Attribute.PATH.name, path.toString()); if (item.isDirectory()) { writer.writeAttribute(Attribute.DIRECTORY.name, "true"); } if(type != ModificationType.REMOVE) { writer.writeAttribute(Attribute.HASH.name, bytesToHexString(item.getContentHash())); } if(type != ModificationType.ADD) {
59,890
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.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.security.DigestOutputStream; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.text.DateFormat; import java.util.ArrayList; import java.util.Collections; import java.util.Date; import java.util.List; public final class PatchUtils {
59,891
package org.jboss.as.patching; import org.jboss.as.controller.AttributeDefinition; <BUG>import org.jboss.as.controller.SimpleAttributeDefinition;</BUG> import org.jboss.as.controller.SimpleAttributeDefinitionBuilder; import org.jboss.dmr.ModelType; <BUG>class Constants { </BUG> static final AttributeDefinition PATCH_ID = SimpleAttributeDefinitionBuilder.create("patch-id", ModelType.STRING).build();
package org.jboss.as.patching; import org.jboss.as.controller.AttributeDefinition; import org.jboss.as.controller.SimpleAttributeDefinitionBuilder; import org.jboss.dmr.ModelType; public class Constants {
59,892
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 {
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; import org.jboss.logging.annotations.MessageBundle; import org.jboss.logging.annotations.Cause; import java.io.IOException; import java.util.List; @MessageBundle(projectCode = "JBAS") public interface PatchMessages {
59,893
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;
package org.jboss.as.patching.runner; import static org.jboss.as.patching.runner.PatchUtils.generateTimestamp; import org.jboss.as.boot.DirectoryStructure; import org.jboss.as.patching.CommonAttributes; import org.jboss.as.patching.LocalPatchInfo; import org.jboss.as.patching.PatchInfo; import org.jboss.as.patching.PatchLogger; import org.jboss.as.patching.PatchMessages;
59,894
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"),
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"), ADDED_MODULE("added-module"), APPLIES_TO_VERSION("applies-to-version"), BUNDLES("bundles"), CUMULATIVE("cumulative"), DESCRIPTION("description"), MISC_FILES("misc-files"),
59,895
writer.writeEndElement(); final Patch.PatchType type = patch.getPatchType(); <BUG>final List<String> appliesTo = patch.getAppliesTo();</BUG> if(type == Patch.PatchType.ONE_OFF) { <BUG>writer.writeEmptyElement(Element.ONE_OFF.name); </BUG> } else { <BUG>writer.writeEmptyElement(Element.CUMULATIVE.name); </BUG> writer.writeAttribute(Attribute.RESULTING_VERSION.name, patch.getResultingVersion());
writer.writeEndElement(); writer.writeStartElement(Element.DESCRIPTION.name); writer.writeCharacters(patch.getDescription()); writer.writeEndElement(); final Patch.PatchType type = patch.getPatchType(); if(type == Patch.PatchType.ONE_OFF) { writer.writeStartElement(Element.ONE_OFF.name); } else { writer.writeStartElement(Element.CUMULATIVE.name); writer.writeAttribute(Attribute.RESULTING_VERSION.name, patch.getResultingVersion());
59,896
} else { <BUG>writer.writeEmptyElement(Element.CUMULATIVE.name); </BUG> writer.writeAttribute(Attribute.RESULTING_VERSION.name, patch.getResultingVersion()); } <BUG>writer.writeAttribute(Attribute.APPLIES_TO_VERSION.name, appliesTo); final List<ContentModification> bundlesAdd = new ArrayList<ContentModification>();</BUG> final List<ContentModification> bundlesUpdate = new ArrayList<ContentModification>(); final List<ContentModification> bundlesRemove = new ArrayList<ContentModification>(); final List<ContentModification> miscAdd = new ArrayList<ContentModification>();
} else { writer.writeStartElement(Element.CUMULATIVE.name); writer.writeAttribute(Attribute.RESULTING_VERSION.name, patch.getResultingVersion()); } writeAppliesToVersions(writer, patch.getAppliesTo()); writer.writeEndElement(); // </one-off> or </cumulative> final List<ContentModification> bundlesAdd = new ArrayList<ContentModification>(); final List<ContentModification> bundlesUpdate = new ArrayList<ContentModification>(); final List<ContentModification> bundlesRemove = new ArrayList<ContentModification>(); final List<ContentModification> miscAdd = new ArrayList<ContentModification>();
59,897
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) {
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) { case RESULTING_VERSION: if(type == Patch.PatchType.CUMULATIVE) {
59,898
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) {
final StringBuilder path = new StringBuilder(); for(final String p : item.getPath()) { path.append(p).append(PATH_DELIMITER); } path.append(item.getName()); writer.writeAttribute(Attribute.PATH.name, path.toString()); if (item.isDirectory()) { writer.writeAttribute(Attribute.DIRECTORY.name, "true"); } if(type != ModificationType.REMOVE) { writer.writeAttribute(Attribute.HASH.name, bytesToHexString(item.getContentHash())); } if(type != ModificationType.ADD) {
59,899
private static FGStorageManager instance; private final Logger logger = FoxGuardMain.instance().getLogger();</BUG> private final Set<LoadEntry> loaded = new HashSet<>(); private final Path directory = getDirectory(); private final Map<String, Path> worldDirectories; <BUG>private FGStorageManager() { defaultModifiedMap = new CacheMap<>((k, m) -> {</BUG> if (k instanceof IFGObject) { m.put((IFGObject) k, true); return true;
private static FGStorageManager instance; public final HashMap<IFGObject, Boolean> defaultModifiedMap; private final UserStorageService userStorageService; private final Logger logger = FoxGuardMain.instance().getLogger(); private final Set<LoadEntry> loaded = new HashSet<>(); private final Path directory = getDirectory(); private final Map<String, Path> worldDirectories; private FGStorageManager() { userStorageService = FoxGuardMain.instance().getUserStorage(); defaultModifiedMap = new CacheMap<>((k, m) -> { if (k instanceof IFGObject) { m.put((IFGObject) k, true); return true;
59,900
constructDirectory(singleDir); try { fgObject.save(singleDir); } catch (Exception e) { <BUG>logger.error("There was an error while saving region \"" + name + "\"!", e); </BUG> } <BUG>logger.info("Saving metadata for region \"" + name + "\""); </BUG> try (DB metaDB = DBMaker.fileDB(singleDir.resolve("metadata.foxdb").normalize().toString()).make()) {
constructDirectory(singleDir); try { fgObject.save(singleDir); } catch (Exception e) { logger.error("There was an error while saving region " + logName + "!", e); } logger.info("Saving metadata for region " + logName); try (DB metaDB = DBMaker.fileDB(singleDir.resolve("metadata.foxdb").normalize().toString()).make()) {