id
int64
1
60k
buggy
stringlengths
34
37.5k
fixed
stringlengths
6
37.4k
59,401
private synchronized void createConnectionNoRetry() throws ConnectionException { if (!isConnectValid()) { try { connect(isProducer); } catch (JMSException e) { <BUG>logger.log(LogLevel.ERROR, "Connection to JMS failed", new Object[] { e.toString() }); throw new ConnectionException( "Connection to JMS failed. Did not try to reconnect as the policy is reconnection policy does not apply here."); }</BUG> }
private synchronized void createConnectionNoRetry() throws ConnectionException { if (!isConnectValid()) { try { connect(isProducer); } catch (JMSException e) { logger.log(LogLevel.ERROR, "CONNECTION_TO_JMS_FAILED", new Object[] { e.toString() }); //$NON-NLS-1$ throw new ConnectionException( Messages.getString("CONNECTION_TO_JMS_FAILED_NO_RECONNECT_AS_RECONNECT_POLICY_DOES_NOT_APPLY")); //$NON-NLS-1$
59,402
boolean res = false; int count = 0; do { try { if(count > 0) { <BUG>logger.log(LogLevel.INFO, "ATTEMPT_TO_RESEND_MESSAGE", new Object[] { count }); </BUG> Thread.sleep(messageRetryDelay); } synchronized (getSession()) {
boolean res = false; int count = 0; do { try { if(count > 0) { logger.log(LogLevel.INFO, "ATTEMPT_TO_RESEND_MESSAGE", new Object[] { count }); //$NON-NLS-1$ Thread.sleep(messageRetryDelay); } synchronized (getSession()) {
59,403
getProducer().send(message); res = true; } } catch (JMSException e) { <BUG>logger.log(LogLevel.WARN, "ERROR_DURING_SEND", new Object[] { e.toString() }); logger.log(LogLevel.INFO, "ATTEMPT_TO_RECONNECT"); </BUG> setConnect(null);
getProducer().send(message); res = true; } } catch (JMSException e) { logger.log(LogLevel.WARN, "ERROR_DURING_SEND", new Object[] { e.toString() }); //$NON-NLS-1$ logger.log(LogLevel.INFO, "ATTEMPT_TO_RECONNECT"); //$NON-NLS-1$ setConnect(null);
59,404
package com.ibm.streamsx.messaging.i18n; import java.text.MessageFormat; import java.util.MissingResourceException; import java.util.ResourceBundle; public class Messages { <BUG>private static final String BUNDLE_NAME = "com.ibm.streamsx.messaging.mqtt.MQTTMessages"; //$NON-NLS-1$ </BUG> private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle .getBundle(BUNDLE_NAME); private Messages() {
package com.ibm.streamsx.messaging.i18n; import java.text.MessageFormat; import java.util.MissingResourceException; import java.util.ResourceBundle; public class Messages { private static final String BUNDLE_NAME = "com.ibm.streamsx.messaging.i18n.CommonMessages"; //$NON-NLS-1$ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle .getBundle(BUNDLE_NAME); private Messages() {
59,405
import org.w3c.dom.NodeList; import org.xml.sax.SAXException; import com.ibm.streams.operator.Attribute; import com.ibm.streams.operator.StreamSchema; import com.ibm.streams.operator.Type; <BUG>import com.ibm.streams.operator.Type.MetaType; class ConnectionDocumentParser {</BUG> private static final Set<String> supportedSPLTypes = new HashSet<String>(Arrays.asList("int8", "uint8", "int16", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ "uint16", "int32", "uint32", "int64", "float32", "float64", "boolean", "blob", "rstring", "uint64", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ "decimal32", "decimal64", "decimal128", "ustring", "timestamp", "xml")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
import org.w3c.dom.NodeList; import org.xml.sax.SAXException; import com.ibm.streams.operator.Attribute; import com.ibm.streams.operator.StreamSchema; import com.ibm.streams.operator.Type; import com.ibm.streams.operator.Type.MetaType; import com.ibm.streamsx.messaging.jms.Messages; class ConnectionDocumentParser { private static final Set<String> supportedSPLTypes = new HashSet<String>(Arrays.asList("int8", "uint8", "int16", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ "uint16", "int32", "uint32", "int64", "float32", "float64", "boolean", "blob", "rstring", "uint64", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ "decimal32", "decimal64", "decimal128", "ustring", "timestamp", "xml")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
59,406
return msgClass; } private void convertProviderURLPath(File applicationDir) throws ParseConnectionDocumentException { if(!isAMQ()) { if(this.providerURL == null || this.providerURL.trim().length() == 0) { <BUG>throw new ParseConnectionDocumentException("A value must be specified for provider_url attribute in connection document"); }</BUG> try { URL url = new URL(providerURL); if("file".equalsIgnoreCase(url.getProtocol())) { //$NON-NLS-1$
return msgClass; } private void convertProviderURLPath(File applicationDir) throws ParseConnectionDocumentException { if(!isAMQ()) { if(this.providerURL == null || this.providerURL.trim().length() == 0) { throw new ParseConnectionDocumentException(Messages.getString("PROVIDER_URL_MUST_BE_SPECIFIED_IN_CONN_DOC")); //$NON-NLS-1$ } try { URL url = new URL(providerURL); if("file".equalsIgnoreCase(url.getProtocol())) { //$NON-NLS-1$
59,407
URL absProviderURL = new URL(url.getProtocol(), url.getHost(), applicationDir.getAbsolutePath() + File.separator + path); this.providerURL = absProviderURL.toExternalForm(); } } } catch (MalformedURLException e) { <BUG>throw new ParseConnectionDocumentException("Invalid provider_url value detected: " + e.getMessage()); }</BUG> } } public void parseAndValidateConnectionDocument(String connectionDocument, String connection, String access,
URL absProviderURL = new URL(url.getProtocol(), url.getHost(), applicationDir.getAbsolutePath() + File.separator + path); this.providerURL = absProviderURL.toExternalForm(); } } } catch (MalformedURLException e) { throw new ParseConnectionDocumentException(Messages.getString("INVALID_PROVIDER_URL", e.getMessage())); //$NON-NLS-1$ } } } public void parseAndValidateConnectionDocument(String connectionDocument, String connection, String access,
59,408
for (int j = 0; j < accessSpecChildNodes.getLength(); j++) { if (accessSpecChildNodes.item(j).getNodeName().equals("destination")) { //$NON-NLS-1$ destIndex = j; } else if (accessSpecChildNodes.item(j).getNodeName().equals("uses_connection")) { //$NON-NLS-1$ if (!connection.equals(accessSpecChildNodes.item(j).getAttributes().getNamedItem("connection") //$NON-NLS-1$ <BUG>.getNodeValue())) { throw new ParseConnectionDocumentException("The value of the connection parameter " + connection + " is not the same as the connection used by access element " + access + " as mentioned in the uses_connection element in connections document");</BUG> }
for (int j = 0; j < accessSpecChildNodes.getLength(); j++) { if (accessSpecChildNodes.item(j).getNodeName().equals("destination")) { //$NON-NLS-1$ destIndex = j; } else if (accessSpecChildNodes.item(j).getNodeName().equals("uses_connection")) { //$NON-NLS-1$ if (!connection.equals(accessSpecChildNodes.item(j).getAttributes().getNamedItem("connection") //$NON-NLS-1$ .getNodeValue())) { throw new ParseConnectionDocumentException(Messages.getString("VALUE_OF_CONNECTION_PARAM_NOT_THE_SAME_AS_CONN_USED_BY_ACCESS_ELEMENT", connection, access )); //$NON-NLS-1$ }
59,409
nativeSchema = access_specification.item(i).getChildNodes().item(nativeSchemaIndex); } break; } } <BUG>if (!accessFound) { throw new ParseConnectionDocumentException("The value of the access parameter " + access + " is not found in the connections document");</BUG> } return nativeSchema;
nativeSchema = access_specification.item(i).getChildNodes().item(nativeSchemaIndex); } break; } } if (!accessFound) { throw new ParseConnectionDocumentException(Messages.getString("VALUE_OF_ACCESS_PARAM_NOT_FOUND_IN_CONN_DOC", access )); //$NON-NLS-1$ } return nativeSchema;
59,410
nativeAttrLength = Integer.parseInt((attrList.item(i).getAttributes().getNamedItem("length") //$NON-NLS-1$ .getNodeValue())); } if ((msgClass == MessageClass.wbe || msgClass == MessageClass.wbe22) && ((streamSchema.getAttribute(nativeAttrName) != null) && (streamSchema <BUG>.getAttribute(nativeAttrName).getType().getMetaType() == Type.MetaType.BLOB))) { throw new ParseConnectionDocumentException(" Blob data type is not supported for message class " + msgClass);</BUG> } Iterator<NativeSchema> it = nativeSchemaObjects.iterator();
nativeAttrLength = Integer.parseInt((attrList.item(i).getAttributes().getNamedItem("length") //$NON-NLS-1$ .getNodeValue())); } if ((msgClass == MessageClass.wbe || msgClass == MessageClass.wbe22) && ((streamSchema.getAttribute(nativeAttrName) != null) && (streamSchema .getAttribute(nativeAttrName).getType().getMetaType() == Type.MetaType.BLOB))) { throw new ParseConnectionDocumentException(Messages.getString("BLOB_NOT_SUPPORTED_FOR_MSG_CLASS", msgClass)); //$NON-NLS-1$ } Iterator<NativeSchema> it = nativeSchemaObjects.iterator();
59,411
throw new ParseConnectionDocumentException(" Blob data type is not supported for message class " + msgClass);</BUG> } Iterator<NativeSchema> it = nativeSchemaObjects.iterator(); while (it.hasNext()) { <BUG>if (it.next().getName().equals(nativeAttrName)) { throw new ParseConnectionDocumentException("Parameter name: " + nativeAttrName + " is appearing more than once In native schema file");</BUG> } }
nativeAttrLength = Integer.parseInt((attrList.item(i).getAttributes().getNamedItem("length") //$NON-NLS-1$ .getNodeValue())); } if ((msgClass == MessageClass.wbe || msgClass == MessageClass.wbe22) && ((streamSchema.getAttribute(nativeAttrName) != null) && (streamSchema .getAttribute(nativeAttrName).getType().getMetaType() == Type.MetaType.BLOB))) { throw new ParseConnectionDocumentException(Messages.getString("BLOB_NOT_SUPPORTED_FOR_MSG_CLASS", msgClass)); //$NON-NLS-1$ } Iterator<NativeSchema> it = nativeSchemaObjects.iterator(); while (it.hasNext()) { if (it.next().getName().equals(nativeAttrName)) { throw new ParseConnectionDocumentException(Messages.getString("PARAMETER_NOT_UNIQUE_IN_NATIVE_SCHEMA", nativeAttrName )); //$NON-NLS-1$ } }
59,412
if (msgClass == MessageClass.text) { typesWithLength = new HashSet<String>(Arrays.asList("Bytes")); //$NON-NLS-1$ } Set<String> typesWithoutLength = new HashSet<String>(Arrays.asList("Byte", "Short", "Int", "Long", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ "Float", "Double", "Boolean")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ <BUG>if (typesWithoutLength.contains(nativeAttrType) && nativeAttrLength != LENGTH_ABSENT_IN_NATIVE_SCHEMA) { throw new ParseConnectionDocumentException("Length attribute should not be present for parameter: " + nativeAttrName + " In native schema file");</BUG> } if ((nativeAttrLength != LENGTH_ABSENT_IN_NATIVE_SCHEMA)
if (msgClass == MessageClass.text) { typesWithLength = new HashSet<String>(Arrays.asList("Bytes")); //$NON-NLS-1$ } Set<String> typesWithoutLength = new HashSet<String>(Arrays.asList("Byte", "Short", "Int", "Long", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ "Float", "Double", "Boolean")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ if (typesWithoutLength.contains(nativeAttrType) && nativeAttrLength != LENGTH_ABSENT_IN_NATIVE_SCHEMA) { throw new ParseConnectionDocumentException(Messages.getString("LENGTH_ATTRIB_SHOULD_NOT_BE_PRESENT_FOR_PARAM_IN_NATIVE_SCHEMA", nativeAttrName )); //$NON-NLS-1$ } if ((nativeAttrLength != LENGTH_ABSENT_IN_NATIVE_SCHEMA)
59,413
if ((nativeAttrLength != LENGTH_ABSENT_IN_NATIVE_SCHEMA) && (msgClass == MessageClass.wbe || msgClass == MessageClass.wbe22 || msgClass == MessageClass.xml) && (streamSchema.getAttribute(nativeAttrName) != null) && (streamSchema.getAttribute(nativeAttrName).getType().getMetaType() != Type.MetaType.RSTRING) && (streamSchema.getAttribute(nativeAttrName).getType().getMetaType() != Type.MetaType.USTRING) <BUG>&& (streamSchema.getAttribute(nativeAttrName).getType().getMetaType() != Type.MetaType.BLOB)) { throw new ParseConnectionDocumentException("Length attribute should not be present for parameter: " + nativeAttrName + " In native schema file");</BUG> } if (streamSchema.getAttribute(nativeAttrName) != null) {
if ((nativeAttrLength != LENGTH_ABSENT_IN_NATIVE_SCHEMA) && (msgClass == MessageClass.wbe || msgClass == MessageClass.wbe22 || msgClass == MessageClass.xml) && (streamSchema.getAttribute(nativeAttrName) != null) && (streamSchema.getAttribute(nativeAttrName).getType().getMetaType() != Type.MetaType.RSTRING) && (streamSchema.getAttribute(nativeAttrName).getType().getMetaType() != Type.MetaType.USTRING) && (streamSchema.getAttribute(nativeAttrName).getType().getMetaType() != Type.MetaType.BLOB)) { throw new ParseConnectionDocumentException(Messages.getString("LENGTH_ATTRIB_SHOULD_NOT_BE_PRESENT_FOR_PARAM_IN_NATIVE_SCHEMA", nativeAttrName )); //$NON-NLS-1$ } if (streamSchema.getAttribute(nativeAttrName) != null) {
59,414
if (streamSchema.getAttribute(nativeAttrName) != null) { MetaType metaType = streamSchema.getAttribute(nativeAttrName).getType().getMetaType(); if (metaType == Type.MetaType.DECIMAL32 || metaType == Type.MetaType.DECIMAL64 || metaType == Type.MetaType.DECIMAL128 || metaType == Type.MetaType.TIMESTAMP) { if (nativeAttrLength != LENGTH_ABSENT_IN_NATIVE_SCHEMA) { <BUG>throw new ParseConnectionDocumentException( "Length attribute should not be present for parameter: " + nativeAttrName + " with type " + metaType + " in native schema file.");</BUG> } if (msgClass == MessageClass.bytes) {
if (streamSchema.getAttribute(nativeAttrName) != null) { MetaType metaType = streamSchema.getAttribute(nativeAttrName).getType().getMetaType(); if (metaType == Type.MetaType.DECIMAL32 || metaType == Type.MetaType.DECIMAL64 || metaType == Type.MetaType.DECIMAL128 || metaType == Type.MetaType.TIMESTAMP) { if (nativeAttrLength != LENGTH_ABSENT_IN_NATIVE_SCHEMA) { throw new ParseConnectionDocumentException( Messages.getString("LENGTH_ATTRIB_SHOULD_NOT_BE_PRESENT_FOR_PARAM_WITH_TYPE_IN_NATIVE_SCHEMA", nativeAttrName, metaType )); //$NON-NLS-1$ } if (msgClass == MessageClass.bytes) {
59,415
nativeAttrLength = -4; } } } if (typesWithLength.contains(nativeAttrType)) { <BUG>if (nativeAttrLength == LENGTH_ABSENT_IN_NATIVE_SCHEMA && msgClass == MessageClass.bytes) { throw new ParseConnectionDocumentException("Length attribute should be present for parameter: " + nativeAttrName + " In native schema file for message class bytes");</BUG> } if ((nativeAttrLength < 0) && nativeAttrLength != LENGTH_ABSENT_IN_NATIVE_SCHEMA) {
nativeAttrLength = -4; } } } if (typesWithLength.contains(nativeAttrType)) { if (nativeAttrLength == LENGTH_ABSENT_IN_NATIVE_SCHEMA && msgClass == MessageClass.bytes) { throw new ParseConnectionDocumentException(Messages.getString("LENGTH_ATTRIB_SHOULD_NOT_BE_PRESENT_FOR_PARAM_IN_NATIVE_SCHEMA_FOR_MSG_CLASS_BYTES", nativeAttrName )); //$NON-NLS-1$ } if ((nativeAttrLength < 0) && nativeAttrLength != LENGTH_ABSENT_IN_NATIVE_SCHEMA) {
59,416
if (streamSchema.getAttribute(nativeAttrName) != null) { streamAttrName = streamSchema.getAttribute(nativeAttrName).getName(); streamAttrMetaType = streamSchema.getAttribute(nativeAttrName).getType().getMetaType(); if ((msgClass == MessageClass.stream || msgClass == MessageClass.map) && !mapSPLToNativeSchemaDataTypesForOtherMsgClass.get(streamAttrMetaType.getLanguageType()) <BUG>.equals(nativeAttrType)) { throw new ParseConnectionDocumentException("Attribute Name: " + nativeAttrName + " with type:" + nativeAttrType + " in the native schema cannot be mapped with attribute: " + streamAttrName + " with type : " + streamAttrMetaType.getLanguageType());</BUG> }
if (streamSchema.getAttribute(nativeAttrName) != null) { streamAttrName = streamSchema.getAttribute(nativeAttrName).getName(); streamAttrMetaType = streamSchema.getAttribute(nativeAttrName).getType().getMetaType(); if ((msgClass == MessageClass.stream || msgClass == MessageClass.map) && !mapSPLToNativeSchemaDataTypesForOtherMsgClass.get(streamAttrMetaType.getLanguageType()) .equals(nativeAttrType)) { throw new ParseConnectionDocumentException(Messages.getString("ATTRIB_WITH_TYPE_IN_NATIVE_SCHEMA_CANNOT_BE_MAPPED_TO_ATTRIB_WITH_TYPE", nativeAttrName, nativeAttrType, streamAttrName, streamAttrMetaType.getLanguageType())); //$NON-NLS-1$ }
59,417
+ nativeAttrType + " in the native schema cannot be mapped with attribute: " + streamAttrName + " with type : " + streamAttrMetaType.getLanguageType());</BUG> } else if (msgClass == MessageClass.bytes && !mapSPLToNativeSchemaDataTypesForBytes.get(streamAttrMetaType.getLanguageType()).equals( <BUG>nativeAttrType)) { throw new ParseConnectionDocumentException("Attribute Name: " + nativeAttrName + " with type:" + nativeAttrType + " in the native schema cannot be mapped with attribute: " + streamAttrName + " with type : " + streamAttrMetaType.getLanguageType());</BUG> }
if (streamSchema.getAttribute(nativeAttrName) != null) { streamAttrName = streamSchema.getAttribute(nativeAttrName).getName(); streamAttrMetaType = streamSchema.getAttribute(nativeAttrName).getType().getMetaType(); if ((msgClass == MessageClass.stream || msgClass == MessageClass.map) && !mapSPLToNativeSchemaDataTypesForOtherMsgClass.get(streamAttrMetaType.getLanguageType()) .equals(nativeAttrType)) { throw new ParseConnectionDocumentException(Messages.getString("ATTRIB_WITH_TYPE_IN_NATIVE_SCHEMA_CANNOT_BE_MAPPED_TO_ATTRIB_WITH_TYPE", nativeAttrName, nativeAttrType, streamAttrName, streamAttrMetaType.getLanguageType())); //$NON-NLS-1$ } else if (msgClass == MessageClass.bytes && !mapSPLToNativeSchemaDataTypesForBytes.get(streamAttrMetaType.getLanguageType()).equals( nativeAttrType)) { throw new ParseConnectionDocumentException(Messages.getString("ATTRIB_WITH_TYPE_IN_NATIVE_SCHEMA_CANNOT_BE_MAPPED_TO_ATTRIB_WITH_TYPE", nativeAttrName, nativeAttrType, streamAttrName, streamAttrMetaType.getLanguageType())); //$NON-NLS-1$ }
59,418
package org.apache.lens.api.scheduler; <BUG>import java.util.List; import lombok.AllArgsConstructor; import lombok.Data; @Data @AllArgsConstructor public class SchedulerJobInstanceInfo {</BUG> private SchedulerJobInstanceHandle id;
package org.apache.lens.api.scheduler; import java.util.List; import javax.xml.bind.annotation.XmlRootElement; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @Data @AllArgsConstructor @NoArgsConstructor @XmlRootElement public class SchedulerJobInstanceInfo { private SchedulerJobInstanceHandle id;
59,419
package org.apache.lens.server.scheduler; import java.util.Collection; import java.util.List; import javax.ws.rs.*; <BUG>import javax.ws.rs.core.MediaType; import org.apache.lens.api.APIResult;</BUG> import org.apache.lens.api.LensSessionHandle; import org.apache.lens.api.scheduler.*; import org.apache.lens.server.LensServices;
package org.apache.lens.server.scheduler; import java.util.Collection; import java.util.List; import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.xml.bind.JAXBElement; import org.apache.lens.api.APIResult; import org.apache.lens.api.LensSessionHandle; import org.apache.lens.api.scheduler.*; import org.apache.lens.server.LensServices;
59,420
import org.apache.lens.server.api.error.LensException; import org.apache.lens.server.api.scheduler.SchedulerService; import org.apache.commons.lang3.StringUtils; @Path("scheduler") @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) <BUG>public class ScheduleResource { public enum INSTANCE_ACTIONS {</BUG> KILL, RERUN; public static INSTANCE_ACTIONS fromString(String name) { return valueOf(name.toUpperCase());
import org.apache.lens.server.api.error.LensException; import org.apache.lens.server.api.scheduler.SchedulerService; import org.apache.commons.lang3.StringUtils; @Path("scheduler") @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) public class ScheduleResource { private static final ObjectFactory OBJECT_FACTORY = new ObjectFactory(); public enum INSTANCE_ACTIONS { KILL, RERUN; public static INSTANCE_ACTIONS fromString(String name) { return valueOf(name.toUpperCase());
59,421
@Path("jobs/{jobHandle}/instances/") public List<SchedulerJobInstanceInfo> getJobInstances(@QueryParam("sessionid") LensSessionHandle sessionId, @PathParam("jobHandle") SchedulerJobHandle jobHandle, @QueryParam("numResults") Long numResults) throws LensException { validateSession(sessionId); <BUG>return getSchedulerService().getJobInstances(sessionId, jobHandle, numResults); }</BUG> @GET @Path("instances/{instanceHandle}") public SchedulerJobInstanceInfo getInstanceDetails(@QueryParam("sessionid") LensSessionHandle sessionId,
@Path("jobs/{jobHandle}/instances/") public List<SchedulerJobInstanceInfo> getJobInstances(@QueryParam("sessionid") LensSessionHandle sessionId, @PathParam("jobHandle") SchedulerJobHandle jobHandle, @QueryParam("numResults") Long numResults) throws LensException { validateSession(sessionId); return getSchedulerService().getJobInstances(jobHandle, numResults); } @GET @Path("instances/{instanceHandle}") public SchedulerJobInstanceInfo getInstanceDetails(@QueryParam("sessionid") LensSessionHandle sessionId,
59,422
@Path("instances/{instanceHandle}") public SchedulerJobInstanceInfo getInstanceDetails(@QueryParam("sessionid") LensSessionHandle sessionId, @PathParam("instanceHandle") SchedulerJobInstanceHandle instanceHandle) throws LensException { validateSession(sessionId); <BUG>return getSchedulerService().getInstanceDetails(sessionId, instanceHandle); }</BUG> @POST @Path("instances/{instanceHandle}") public APIResult updateInstance(@QueryParam("sessionid") LensSessionHandle sessionId,
@Path("instances/{instanceHandle}") public SchedulerJobInstanceInfo getInstanceDetails(@QueryParam("sessionid") LensSessionHandle sessionId, @PathParam("instanceHandle") SchedulerJobInstanceHandle instanceHandle) throws LensException { validateSession(sessionId); return getSchedulerService().getInstanceDetails(instanceHandle); } @POST @Path("instances/{instanceHandle}") public APIResult updateInstance(@QueryParam("sessionid") LensSessionHandle sessionId,
59,423
package org.apache.lens.api.scheduler; <BUG>import org.apache.lens.api.error.InvalidStateTransitionException; public enum SchedulerJobState implements StateTransitioner<SchedulerJobState, SchedulerJobEvent> {</BUG> NEW { @Override public SchedulerJobState nextTransition(SchedulerJobEvent event) throws InvalidStateTransitionException {
package org.apache.lens.api.scheduler; import javax.xml.bind.annotation.*; import org.apache.lens.api.error.InvalidStateTransitionException; @XmlRootElement public enum SchedulerJobState implements StateTransitioner<SchedulerJobState, SchedulerJobEvent> { NEW { @Override public SchedulerJobState nextTransition(SchedulerJobEvent event) throws InvalidStateTransitionException {
59,424
package org.apache.lens.api.scheduler; import lombok.AllArgsConstructor; <BUG>import lombok.Data; @Data @AllArgsConstructor public class SchedulerJobInfo {</BUG> private SchedulerJobHandle id;
package org.apache.lens.api.scheduler; import javax.xml.bind.annotation.XmlRootElement; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @Data @AllArgsConstructor @NoArgsConstructor @XmlRootElement public class SchedulerJobInfo { private SchedulerJobHandle id;
59,425
public interface SchedulerService extends LensService, SessionValidator { String NAME = "scheduler"; SchedulerJobHandle submitJob(LensSessionHandle sessionHandle, XJob job) throws LensException; boolean scheduleJob(LensSessionHandle sessionHandle, SchedulerJobHandle jobHandle) throws LensException; SchedulerJobHandle submitAndScheduleJob(LensSessionHandle sessionHandle, XJob job) throws LensException; <BUG>XJob getJobDefinition(LensSessionHandle sessionHandle, SchedulerJobHandle jobHandle) throws LensException; SchedulerJobInfo getJobDetails(LensSessionHandle sessionHandle, SchedulerJobHandle jobHandle) throws LensException; boolean updateJob(LensSessionHandle sessionHandle, SchedulerJobHandle jobHandle, XJob newJobDefinition)</BUG> throws LensException; boolean expireJob(LensSessionHandle sessionHandle, SchedulerJobHandle jobHandle) throws LensException;
public interface SchedulerService extends LensService, SessionValidator { String NAME = "scheduler"; SchedulerJobHandle submitJob(LensSessionHandle sessionHandle, XJob job) throws LensException; boolean scheduleJob(LensSessionHandle sessionHandle, SchedulerJobHandle jobHandle) throws LensException; SchedulerJobHandle submitAndScheduleJob(LensSessionHandle sessionHandle, XJob job) throws LensException; XJob getJobDefinition(SchedulerJobHandle jobHandle) throws LensException; SchedulerJobInfo getJobDetails(SchedulerJobHandle jobHandle) throws LensException; boolean updateJob(LensSessionHandle sessionHandle, SchedulerJobHandle jobHandle, XJob newJobDefinition) throws LensException; boolean expireJob(LensSessionHandle sessionHandle, SchedulerJobHandle jobHandle) throws LensException;
59,426
throws LensException; boolean expireJob(LensSessionHandle sessionHandle, SchedulerJobHandle jobHandle) throws LensException; boolean suspendJob(LensSessionHandle sessionHandle, SchedulerJobHandle jobHandle) throws LensException; boolean resumeJob(LensSessionHandle sessionHandle, SchedulerJobHandle jobHandle) throws LensException; boolean deleteJob(LensSessionHandle sessionHandle, SchedulerJobHandle jobHandle) throws LensException; <BUG>Collection<SchedulerJobStats> getAllJobStats(LensSessionHandle sessionHandle, String state, String user, String jobName, long startTime, long endTime) throws LensException; SchedulerJobStats getJobStats(LensSessionHandle sessionHandle, SchedulerJobHandle handle, String state, long startTime, long endTime) throws LensException; List<SchedulerJobInstanceInfo> getJobInstances(LensSessionHandle sessionHandle, SchedulerJobHandle jobHandle, Long numResults) throws LensException;</BUG> boolean killInstance(LensSessionHandle sessionHandle, SchedulerJobInstanceHandle instanceHandle) throws LensException;
throws LensException; boolean expireJob(LensSessionHandle sessionHandle, SchedulerJobHandle jobHandle) throws LensException; boolean suspendJob(LensSessionHandle sessionHandle, SchedulerJobHandle jobHandle) throws LensException; boolean resumeJob(LensSessionHandle sessionHandle, SchedulerJobHandle jobHandle) throws LensException; boolean deleteJob(LensSessionHandle sessionHandle, SchedulerJobHandle jobHandle) throws LensException; Collection<SchedulerJobStats> getAllJobStats(String state, String user, String jobName, long startTime, long endTime) throws LensException; SchedulerJobStats getJobStats(SchedulerJobHandle handle, String state, long startTime, long endTime) throws LensException; List<SchedulerJobInstanceInfo> getJobInstances(SchedulerJobHandle jobHandle, Long numResults) throws LensException; boolean killInstance(LensSessionHandle sessionHandle, SchedulerJobInstanceHandle instanceHandle) throws LensException;
59,427
.withMisfireHandlingInstructionIgnoreMisfires(); trigger = TriggerBuilder.newTrigger().withIdentity(jobHandle, ALARM_SERVICE).startAt(start.toDate()) .endAt(end.toDate()).withSchedule(scheduleBuilder).build(); } else { // for cron expression create a cron trigger trigger = TriggerBuilder.newTrigger().withIdentity(jobHandle, ALARM_SERVICE).startAt(start.toDate()) <BUG>.endAt(end.toDate()).withSchedule(CronScheduleBuilder.cronSchedule(frequency.getCronExpression())).build(); }</BUG> try { scheduler.scheduleJob(job, trigger); } catch (SchedulerException e) {
.withMisfireHandlingInstructionIgnoreMisfires(); trigger = TriggerBuilder.newTrigger().withIdentity(jobHandle, ALARM_SERVICE).startAt(start.toDate()) .endAt(end.toDate()).withSchedule(scheduleBuilder).build(); } else { // for cron expression create a cron trigger trigger = TriggerBuilder.newTrigger().withIdentity(jobHandle, ALARM_SERVICE).startAt(start.toDate()) .endAt(end.toDate()).withSchedule(CronScheduleBuilder.cronSchedule(frequency.getCronExpression()) .withMisfireHandlingInstructionIgnoreMisfires()).build(); } try { scheduler.scheduleJob(job, trigger); } catch (SchedulerException e) {
59,428
package org.apache.lens.api.scheduler; <BUG>import org.apache.lens.api.error.InvalidStateTransitionException; public enum SchedulerJobInstanceState</BUG> implements StateTransitioner<SchedulerJobInstanceState, SchedulerJobInstanceEvent> { WAITING { @Override
package org.apache.lens.api.scheduler; import javax.xml.bind.annotation.*; import org.apache.lens.api.error.InvalidStateTransitionException; @XmlRootElement public enum SchedulerJobInstanceState implements StateTransitioner<SchedulerJobInstanceState, SchedulerJobInstanceEvent> { WAITING { @Override
59,429
import javax.jms.MessageListener; import javax.jms.MessageProducer; import javax.jms.Session; import javax.jms.TextMessage; @MessageDriven(activationConfig = { <BUG>@ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/test") </BUG> }) public class ReplyingMDB implements MessageListener { @Resource(lookup = "java:/JmsXA")
import javax.jms.MessageListener; import javax.jms.MessageProducer; import javax.jms.Session; import javax.jms.TextMessage; @MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName = "destination", propertyValue = "java:jboss/queue/test") }) public class ReplyingMDB implements MessageListener { @Resource(lookup = "java:/JmsXA")
59,430
import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.as.testsuite.integration.common.JMSAdminOperations; import org.jboss.as.testsuite.integration.mdb.DDBasedMDB; import org.jboss.as.testsuite.integration.mdb.JMSMessagingUtil; <BUG>import org.jboss.as.testsuite.integration.mdb.MessageReceipt;</BUG> import org.jboss.logging.Logger; import org.jboss.shrinkwrap.api.Archive; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.asset.StringAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; <BUG>import org.junit.After;</BUG> import org.junit.AfterClass;
import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.as.testsuite.integration.common.JMSAdminOperations; import org.jboss.as.testsuite.integration.mdb.DDBasedMDB; import org.jboss.as.testsuite.integration.mdb.JMSMessagingUtil; import org.jboss.logging.Logger; import org.jboss.shrinkwrap.api.Archive; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.asset.StringAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.junit.AfterClass;
59,431
import org.junit.runner.RunWith; import javax.annotation.Resource; import javax.ejb.EJB; import javax.jms.Message; import javax.jms.Queue; <BUG>import javax.naming.InitialContext;</BUG> @RunWith(Arquillian.class) public class MDBTestCase { private static final Logger logger = Logger.getLogger(MDBTestCase.class); @EJB (mappedName = "java:module/JMSMessagingUtil") private JMSMessagingUtil jmsUtil; <BUG>@Resource (mappedName = "java:/mdbtest/queue") </BUG> private Queue queue;
import org.junit.runner.RunWith; import javax.annotation.Resource; import javax.ejb.EJB; import javax.jms.Message; import javax.jms.Queue; @RunWith(Arquillian.class) public class MDBTestCase { private static final Logger logger = Logger.getLogger(MDBTestCase.class); @EJB (mappedName = "java:module/JMSMessagingUtil")
59,432
private JMSMessagingUtil jmsUtil; <BUG>@Resource (mappedName = "java:/mdbtest/queue") </BUG> private Queue queue; <BUG>@Resource (mappedName = "java:/mdbtest/replyQueue") </BUG> private Queue replyQueue; @Deployment public static Archive getDeployment() { createJmsDestinations();
private JMSMessagingUtil jmsUtil; @Resource (mappedName = "java:jboss/mdbtest/queue") private Queue queue; @Resource (mappedName = "java:jboss/mdbtest/replyQueue") private Queue replyQueue; @Deployment public static Archive getDeployment() { createJmsDestinations();
59,433
logger.info(ejbJar.toString(true)); return ejbJar; } public static void createJmsDestinations() { final JMSAdminOperations jmsAdminOperations = new JMSAdminOperations(); <BUG>jmsAdminOperations.createJmsQueue("mdbtest/queue", "mdbtest/queue"); jmsAdminOperations.createJmsQueue("mdbtest/replyQueue", "mdbtest/replyQueue"); </BUG> }
logger.info(ejbJar.toString(true)); return ejbJar; } public static void createJmsDestinations() { final JMSAdminOperations jmsAdminOperations = new JMSAdminOperations(); jmsAdminOperations.createJmsQueue("mdbtest/queue", "java:jboss/mdbtest/queue"); jmsAdminOperations.createJmsQueue("mdbtest/replyQueue", "java:jboss/mdbtest/replyQueue"); }
59,434
final QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); final Queue replyDestination = session.createTemporaryQueue(); final QueueReceiver receiver = session.createReceiver(replyDestination); final Message message = session.createTextMessage("Test"); message.setJMSReplyTo(replyDestination); <BUG>final Destination destination = (Destination) ctx.lookup("queue/test"); </BUG> final MessageProducer producer = session.createProducer(destination); producer.send(message); producer.close();
final QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); final Queue replyDestination = session.createTemporaryQueue(); final QueueReceiver receiver = session.createReceiver(replyDestination); final Message message = session.createTextMessage("Test"); message.setJMSReplyTo(replyDestination); final Destination destination = (Destination) ctx.lookup("java:jboss/queue/test"); final MessageProducer producer = session.createProducer(destination); producer.send(message); producer.close();
59,435
protected void postConstruct() throws JMSException { connection = this.connectionFactory.createConnection(); connection.start(); session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); } <BUG>@Resource(mappedName = "java:/JmsXA") </BUG> public void setConnectionFactory(final ConnectionFactory connectionFactory) { this.connectionFactory = connectionFactory; }
protected void postConstruct() throws JMSException { connection = this.connectionFactory.createConnection(); connection.start(); session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); } @Resource(mappedName = "java:/ConnectionFactory") public void setConnectionFactory(final ConnectionFactory connectionFactory) { this.connectionFactory = connectionFactory; }
59,436
package uk.co.eelpieconsulting.osm.nominatim.controllers; <BUG>import java.sql.SQLException; import java.util.Map;</BUG> import org.joda.time.format.DateTimeFormatter; import org.joda.time.format.ISODateTimeFormat; import org.springframework.beans.factory.annotation.Autowired;
package uk.co.eelpieconsulting.osm.nominatim.controllers; import com.google.common.collect.Maps; import org.joda.time.format.DateTimeFormatter; import org.joda.time.format.ISODateTimeFormat; import org.springframework.beans.factory.annotation.Autowired;
59,437
import uk.co.eelpieconsulting.common.views.ViewFactory; import uk.co.eelpieconsulting.osm.nominatim.elasticsearch.ElasticSearchAutoCompleteService; import uk.co.eelpieconsulting.osm.nominatim.indexing.PartialIndexWatermarkService; import uk.co.eelpieconsulting.osm.nominatim.psql.OSMDAOFactory; import uk.co.eelpieconsulting.osm.nominatim.psql.OsmDAO; <BUG>import com.google.common.collect.Maps; @Controller</BUG> public class AutoCompleteController { private static final DateTimeFormatter BASIC_DATE_TIME = ISODateTimeFormat.basicDateTime(); private final ElasticSearchAutoCompleteService autoCompleteService;
import uk.co.eelpieconsulting.common.views.ViewFactory; import uk.co.eelpieconsulting.osm.nominatim.elasticsearch.ElasticSearchAutoCompleteService; import uk.co.eelpieconsulting.osm.nominatim.indexing.PartialIndexWatermarkService; import uk.co.eelpieconsulting.osm.nominatim.psql.OSMDAOFactory; import uk.co.eelpieconsulting.osm.nominatim.psql.OsmDAO; import java.sql.SQLException; import java.util.Map; @Controller public class AutoCompleteController { private static final DateTimeFormatter BASIC_DATE_TIME = ISODateTimeFormat.basicDateTime(); private final ElasticSearchAutoCompleteService autoCompleteService;
59,438
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.node.Node; import org.springframework.beans.factory.annotation.Autowired;</BUG> import org.springframework.beans.factory.annotation.Value; <BUG>import org.springframework.stereotype.Component; @Component</BUG> public class ElasticSearchClientFactory { private static Logger log = Logger.getLogger(ElasticSearchClientFactory.class); private String clusterName; <BUG>private String unicastHosts; private Client client;</BUG> @Autowired
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.InetSocketTransportAddress; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import java.net.InetAddress; import java.net.UnknownHostException; @Component public class ElasticSearchClientFactory { private static Logger log = Logger.getLogger(ElasticSearchClientFactory.class); private String clusterName; private String unicastHost; private Client client; @Autowired
59,439
import java.util.Map;</BUG> import org.apache.log4j.Logger; import org.elasticsearch.action.search.SearchRequestBuilder; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.client.Client; <BUG>import org.elasticsearch.common.base.Strings; import org.elasticsearch.index.query.BoolFilterBuilder;</BUG> import org.elasticsearch.index.query.BoolQueryBuilder; <BUG>import org.elasticsearch.index.query.FilterBuilder; import org.elasticsearch.index.query.FilterBuilders;</BUG> import org.elasticsearch.index.query.PrefixQueryBuilder;
package uk.co.eelpieconsulting.osm.nominatim.elasticsearch; import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.base.Strings; import com.google.common.collect.Lists; import org.apache.log4j.Logger; import org.elasticsearch.action.search.SearchRequestBuilder; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.client.Client; import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.GeoDistanceQueryBuilder; import org.elasticsearch.index.query.PrefixQueryBuilder;
59,440
query = query.must(boolQuery().must(termQuery(TAGS, tag))); } if (rank != null) { query = query.must(boolQuery().must(termQuery("rank", rank))); } <BUG>BoolFilterBuilder filter = FilterBuilders.boolFilter();</BUG> if (!Strings.isNullOrEmpty(country)) { <BUG>filter = filter.must(termFilter("country", country)); </BUG> }
query = query.must(boolQuery().must(termQuery(TAGS, tag))); } if (rank != null) { query = query.must(boolQuery().must(termQuery("rank", rank))); } if (!Strings.isNullOrEmpty(country)) { query = query.must(termQuery("country", country)); }
59,441
setTypes(SEARCH_TYPE). setQuery(all). setSize(0); return request.get().getHits().getTotalHits(); } <BUG>private List<Place> executeAndParse(QueryBuilder query, BoolFilterBuilder filter) { Client client = elasticSearchClientFactory.getClient(); TermsFacetBuilder tagsFacet = FacetBuilders.termsFacet(TAGS).fields(TAGS).order(ComparatorType.COUNT).size(Integer.MAX_VALUE);</BUG> SearchRequestBuilder request = client.prepareSearch(readIndex). setTypes(SEARCH_TYPE).
setTypes(SEARCH_TYPE). setQuery(all). setSize(0); return request.get().getHits().getTotalHits(); } private List<Place> executeAndParse(QueryBuilder query) { Client client = elasticSearchClientFactory.getClient(); SearchRequestBuilder request = client.prepareSearch(readIndex). setTypes(SEARCH_TYPE).
59,442
Client client = elasticSearchClientFactory.getClient(); TermsFacetBuilder tagsFacet = FacetBuilders.termsFacet(TAGS).fields(TAGS).order(ComparatorType.COUNT).size(Integer.MAX_VALUE);</BUG> SearchRequestBuilder request = client.prepareSearch(readIndex). setTypes(SEARCH_TYPE). setQuery(query). <BUG>addFacet(tagsFacet).</BUG> setSize(20); <BUG>if (filter != null && filter.hasClauses()) { request = request.setPostFilter(filter); }</BUG> SearchResponse response = request.execute().actionGet();
Client client = elasticSearchClientFactory.getClient(); SearchRequestBuilder request = client.prepareSearch(readIndex). setTypes(SEARCH_TYPE). setQuery(query). setSize(20); SearchResponse response = request.execute().actionGet();
59,443
private PrefixQueryBuilder startsWith(String q) { return prefixQuery(ADDRESS, q.toLowerCase()); } private BoolQueryBuilder taggedAsCountry() { QueryBuilder isCountry = termQuery(TAGS, "place|country"); <BUG>BoolQueryBuilder isRequiredType = boolQuery().minimumNumberShouldMatch(1).should(isCountry); return isRequiredType;</BUG> } private BoolQueryBuilder taggedAsCountryCityTownSuburb() {
private PrefixQueryBuilder startsWith(String q) { return prefixQuery(ADDRESS, q.toLowerCase()); } private BoolQueryBuilder taggedAsCountry() { QueryBuilder isCountry = termQuery(TAGS, "place|country"); return boolQuery().minimumNumberShouldMatch(1).should(isCountry); } private BoolQueryBuilder taggedAsCountryCityTownSuburb() {
59,444
QueryBuilder isTown = termQuery(TAGS, "place|town"); QueryBuilder isSuburb = termQuery(TAGS, "place|suburb"); QueryBuilder isBoundary = termQuery(TAGS, "boundary|administrative"); QueryBuilder isAdminLevelSix = termQuery("adminLevel", "6"); QueryBuilder isAdminLevelSixBoundary = boolQuery().must(isBoundary).must(isAdminLevelSix); <BUG>BoolQueryBuilder isRequiredType = boolQuery().minimumNumberShouldMatch(1). should(isCountry).boost(10).</BUG> should(isCity).boost(5). should(isAdminLevelSixBoundary).boost(5). should(isCounty).boost(4).
QueryBuilder isTown = termQuery(TAGS, "place|town"); QueryBuilder isSuburb = termQuery(TAGS, "place|suburb"); QueryBuilder isBoundary = termQuery(TAGS, "boundary|administrative"); QueryBuilder isAdminLevelSix = termQuery("adminLevel", "6"); QueryBuilder isAdminLevelSixBoundary = boolQuery().must(isBoundary).must(isAdminLevelSix); return boolQuery().minimumNumberShouldMatch(1). should(isCountry).boost(10). should(isCity).boost(5). should(isAdminLevelSixBoundary).boost(5). should(isCounty).boost(4).
59,445
package uk.co.eelpieconsulting.osm.nominatim.controllers; <BUG>import java.io.FileNotFoundException; import java.io.IOException; import java.sql.SQLException;</BUG> import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller;
package uk.co.eelpieconsulting.osm.nominatim.controllers; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller;
59,446
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; import uk.co.eelpieconsulting.common.views.ViewFactory; <BUG>import uk.co.eelpieconsulting.osm.nominatim.indexing.FullIndexBuilder; @Controller</BUG> public class ImportController { private final FullIndexBuilder fullIndexBuilder; private final ViewFactory viewFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; import uk.co.eelpieconsulting.common.views.ViewFactory; import uk.co.eelpieconsulting.osm.nominatim.indexing.FullIndexBuilder; import java.io.FileNotFoundException; import java.io.IOException; import java.sql.SQLException; @Controller public class ImportController { private final FullIndexBuilder fullIndexBuilder; private final ViewFactory viewFactory;
59,447
this.relTypeCreator = relTypeCreator; } void addRawRelationshipTypes( RelationshipTypeData[] types ) { for ( int i = 0; i < types.length; i++ ) <BUG>{ relTypes.put( types[i].getName(), types[i].getId() ); relTranslation.put( types[i].getId(), types[i].getName() );</BUG> } }
this.relTypeCreator = relTypeCreator; } void addRawRelationshipTypes( RelationshipTypeData[] types ) { for ( int i = 0; i < types.length; i++ ) { addRawRelationshipType( types[i] ); } }
59,448
if ( !create ) { return null; } int id = createRelationshipType( name ); <BUG>relTranslation.put( id, name ); }</BUG> else { <BUG>relTranslation.put( relTypes.get( name ), name ); }</BUG> return new RelationshipTypeImpl( name );
if ( !create ) { return null;
59,449
Integer id = relTypes.get( name ); if ( id != null ) { return id; } <BUG>id = relTypeCreator.getOrCreate( transactionManager, idGenerator, persistenceManager, name ); addRelType( name, id );</BUG> return id; } void addRelType( String name, Integer id )
Integer id = relTypes.get( name ); if ( id != null ) { return id; } id = relTypeCreator.getOrCreate( transactionManager, idGenerator, persistenceManager, this, name ); addRelType( name, id ); return id; } void addRelType( String name, Integer id )
59,450
package org.neo4j.kernel.impl.core; import javax.transaction.TransactionManager; import org.neo4j.graphdb.RelationshipType; <BUG>import org.neo4j.graphdb.TransactionFailureException; import org.neo4j.kernel.impl.persistence.EntityIdGenerator;</BUG> import org.neo4j.kernel.impl.persistence.PersistenceManager; public class DefaultRelationshipTypeCreator implements RelationshipTypeCreator {
package org.neo4j.kernel.impl.core; import javax.transaction.TransactionManager; import org.neo4j.graphdb.RelationshipType; import org.neo4j.graphdb.TransactionFailureException; import org.neo4j.kernel.impl.nioneo.store.RelationshipTypeData; import org.neo4j.kernel.impl.persistence.EntityIdGenerator; import org.neo4j.kernel.impl.persistence.PersistenceManager; public class DefaultRelationshipTypeCreator implements RelationshipTypeCreator {
59,451
public static final RelationshipTypeCreator INSTANCE = new DefaultRelationshipTypeCreator(); private DefaultRelationshipTypeCreator() { } public int getOrCreate( TransactionManager txManager, EntityIdGenerator idGenerator, <BUG>PersistenceManager persistence, String name ) {</BUG> RelTypeCreater createrThread = new RelTypeCreater( name, txManager, idGenerator, persistence ); synchronized ( createrThread )
public static final RelationshipTypeCreator INSTANCE = new DefaultRelationshipTypeCreator(); private DefaultRelationshipTypeCreator() { } public int getOrCreate( TransactionManager txManager, EntityIdGenerator idGenerator, PersistenceManager persistence, RelationshipTypeHolder relTypeHolder, String name ) { RelTypeCreater createrThread = new RelTypeCreater( name, txManager, idGenerator, persistence ); synchronized ( createrThread )
59,452
final CircuitBreaker circuitBreaker; final ListenerConfig<?, Object> listeners; long attemptStartTime; volatile Object lastResult; volatile Throwable lastFailure; <BUG>volatile boolean completed; volatile boolean success;</BUG> volatile long waitNanos; AbstractExecution(RetryPolicy retryPolicy, CircuitBreaker circuitBreaker, ListenerConfig<?, Object> listeners) { super(new Duration(System.nanoTime(), TimeUnit.NANOSECONDS));
final CircuitBreaker circuitBreaker; final ListenerConfig<?, Object> listeners; long attemptStartTime; volatile Object lastResult; volatile Throwable lastFailure; volatile boolean completed; volatile boolean retriesExceeded; volatile boolean success; volatile long waitNanos; AbstractExecution(RetryPolicy retryPolicy, CircuitBreaker circuitBreaker, ListenerConfig<?, Object> listeners) { super(new Duration(System.nanoTime(), TimeUnit.NANOSECONDS));
59,453
void before() { if (circuitBreaker != null && !circuitBreaker.allowsExecution()) { completed = true; Exception failure = new CircuitBreakerOpenException(); if (listeners != null) <BUG>listeners.complete(null, failure, this, false); </BUG> future.complete(null, failure); return; }
void before() { if (circuitBreaker != null && !circuitBreaker.allowsExecution()) { completed = true; Exception failure = new CircuitBreakerOpenException(); if (listeners != null) listeners.handleComplete(null, failure, this, false); future.complete(null, failure); return; }
59,454
future.setFuture((Future) scheduler.schedule(callable, waitNanos, TimeUnit.NANOSECONDS)); return true; } catch (Throwable t) { failure = t; if (listeners != null) <BUG>listeners.complete(null, t, this, false); </BUG> future.complete(null, failure); } }
future.setFuture((Future) scheduler.schedule(callable, waitNanos, TimeUnit.NANOSECONDS)); return true; } catch (Throwable t) { failure = t; if (listeners != null) listeners.handleComplete(null, t, this, false); future.complete(null, failure); } }
59,455
private Duration timeout; private Integer failureThreshold; private Ratio failureThresholdRatio; private Integer successThreshold; private Ratio successThresholdRatio; <BUG>private boolean failureConditionChecked; private List<BiPredicate<Object, Throwable>> failurePredicates; </BUG> CheckedRunnable onOpen;
private Duration timeout; private Integer failureThreshold; private Ratio failureThresholdRatio; private Integer successThreshold; private Ratio successThresholdRatio; private boolean failuresChecked; private List<BiPredicate<Object, Throwable>> failureConditions; CheckedRunnable onOpen;
59,456
</BUG> return this; } public CircuitBreaker failOn(Predicate<? extends Throwable> failurePredicate) { Assert.notNull(failurePredicate, "failurePredicate"); <BUG>failureConditionChecked = true; failurePredicates.add(Predicates.failurePredicateFor(failurePredicate)); </BUG> return this;
return failOn(Arrays.asList(failures)); } public CircuitBreaker failOn(List<Class<? extends Throwable>> failures) { Assert.notNull(failures, "failures"); Assert.isTrue(!failures.isEmpty(), "failures cannot be empty"); failuresChecked = true; failureConditions.add(Predicates.failurePredicateFor(failures)); return this; } public CircuitBreaker failOn(Predicate<? extends Throwable> failurePredicate) { Assert.notNull(failurePredicate, "failurePredicate"); failuresChecked = true; failureConditions.add(Predicates.failurePredicateFor(failurePredicate)); return this;
59,457
} public boolean isClosed() { return State.CLOSED.equals(getState()); } public boolean isFailure(Object result, Throwable failure) { <BUG>for (BiPredicate<Object, Throwable> predicate : failurePredicates) { </BUG> if (predicate.test(result, failure)) return true; }
} public <T> CircuitBreaker failIf(Predicate<T> resultPredicate) { Assert.notNull(resultPredicate, "resultPredicate"); failureConditions.add(Predicates.resultPredicateFor(resultPredicate)); return this; }
59,458
(ListenerConfig<?, Object>) this); callable.inject(execution); try { future.setFuture((Future<T>) scheduler.schedule(callable, 0, TimeUnit.MILLISECONDS)); } catch (Throwable t) { <BUG>complete(null, t, execution, false); </BUG> future.complete(null, t); } return future;
(ListenerConfig<?, Object>) this); callable.inject(execution); try { future.setFuture((Future<T>) scheduler.schedule(callable, 0, TimeUnit.MILLISECONDS)); } catch (Throwable t) { handleComplete(null, t, execution, false); future.complete(null, t); } return future;
59,459
debMaker.setChangesSave(changesSaveFile); debMaker.setCompression(compression); debMaker.setKeyring(keyringFile); debMaker.setKey(key); debMaker.setPassphrase(passphrase); <BUG>debMaker.setSignPackage(signPackage); debMaker.setResolver(resolver);</BUG> debMaker.setOpenReplaceToken(openReplaceToken); debMaker.setCloseReplaceToken(closeReplaceToken); debMaker.validate();
debMaker.setChangesSave(changesSaveFile); debMaker.setCompression(compression); debMaker.setKeyring(keyringFile); debMaker.setKey(key); debMaker.setPassphrase(passphrase); debMaker.setSignPackage(signPackage); debMaker.setSignMethod(signMethod); debMaker.setResolver(resolver); debMaker.setOpenReplaceToken(openReplaceToken); debMaker.setCloseReplaceToken(closeReplaceToken); debMaker.validate();
59,460
private String passphrase; private File changesIn; private File changesOut; private File changesSave; private String compression = "gzip"; <BUG>private boolean signPackage; private VariableResolver variableResolver;</BUG> private String openReplaceToken; private String closeReplaceToken; private final Collection<DataProducer> dataProducers = new ArrayList<DataProducer>();
private String passphrase; private File changesIn; private File changesOut; private File changesSave; private String compression = "gzip"; private boolean signPackage; private String signMethod; private VariableResolver variableResolver; private String openReplaceToken; private String closeReplaceToken; private final Collection<DataProducer> dataProducers = new ArrayList<DataProducer>();
59,461
if (dataProducers != null) { this.dataProducers.addAll(dataProducers); } if (conffileProducers != null) { this.conffilesProducers.addAll(conffileProducers); <BUG>} }</BUG> public void setDeb(File deb) { this.deb = deb; }
if (dataProducers != null) { this.dataProducers.addAll(dataProducers); } if (conffileProducers != null) { this.conffilesProducers.addAll(conffileProducers); } Security.addProvider(new BouncyCastleProvider()); } public void setDeb(File deb) { this.deb = deb; }
59,462
". The following fields are mandatory: " + packageControlFile.getMandatoryFields() + ". Please check your pom.xml/build.xml and your control file."); } deb.getParentFile().mkdirs(); ArArchiveOutputStream ar = new ArArchiveOutputStream(new FileOutputStream(deb)); <BUG>addTo(ar, "debian-binary", "2.0\n"); addTo(ar, "control.tar.gz", tempControl); addTo(ar, "data.tar" + compression.getExtension(), tempData); if (signatureGenerator != null) { console.info("Signing package with key " + key); PGPSignatureOutputStream sigStream = new PGPSignatureOutputStream(signatureGenerator); addTo(sigStream, "2.0\n"); addTo(sigStream, tempControl);</BUG> addTo(sigStream, tempData);
". The following fields are mandatory: " + packageControlFile.getMandatoryFields() + ". Please check your pom.xml/build.xml and your control file."); } deb.getParentFile().mkdirs(); ArArchiveOutputStream ar = new ArArchiveOutputStream(new FileOutputStream(deb)); String binaryName = "debian-binary"; String binaryContent = "2.0\n"; String controlName = "control.tar.gz"; String dataName = "data.tar" + compression.getExtension(); addTo(ar, binaryName, binaryContent); addTo(ar, controlName, tempControl); addTo(ar, dataName, tempData); if (signatureGenerator != null) {
59,463
PGPSignatureOutputStream sigStream = new PGPSignatureOutputStream(signatureGenerator); addTo(sigStream, "2.0\n"); addTo(sigStream, tempControl);</BUG> addTo(sigStream, tempData); <BUG>addTo(ar, "_gpgorigin", sigStream.generateASCIISignature()); final String outputStr =</BUG> "Version: 4\n" + "Signer: \n" + <BUG>"Date: " + new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy", Locale.ENGLISH).format(new Date()).replaceFirst("0", " ") + "\n" + "Role: builder\n" +</BUG> "Files: \n" +
PGPSignatureOutputStream sigStream = new PGPSignatureOutputStream(signatureGenerator); addTo(sigStream, binaryContent); addTo(sigStream, tempControl); addTo(sigStream, tempData); addTo(ar, "_gpgorigin", sigStream.generateASCIISignature()); } else { final String outputStr = "Version: 4\n" + "Signer: \n" + "Date: " + new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy", Locale.ENGLISH).format(new Date()) + "\n" + "Role: builder\n" +
59,464
"Signer: \n" + <BUG>"Date: " + new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy", Locale.ENGLISH).format(new Date()).replaceFirst("0", " ") + "\n" + "Role: builder\n" +</BUG> "Files: \n" + <BUG>addFile("2.0\n", "debian-binary") + addFile(tempControl, "control.tar.gz") + addFile(tempData, "data.tar" + compression.getExtension()); ByteArrayOutputStream message = new ByteArrayOutputStream();</BUG> signer.clearSign(outputStr, message); <BUG>addTo(ar, "_gpgbuilder", message.toString()); }</BUG> ar.close();
"Signer: \n" + "Date: " + new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy", Locale.ENGLISH).format(new Date()) + "\n" + "Role: builder\n" + "Files: \n" + addFile(binaryName, binaryContent) + addFile(controlName, tempControl) + addFile(dataName, tempData); ByteArrayOutputStream message = new ByteArrayOutputStream(); signer.clearSign(outputStr, message); addTo(ar, "_gpgbuilder", message.toString()); } } ar.close();
59,465
public static final String C_PARAM_NAVLEFT_ELEMENTURI = "navleftelementuri"; public static final String C_PARAM_NAVLEFT_SHOWSELECTED = "navleftselected"; public static final String C_PARAM_NAVLEFT_SHOWTREE = "navleftshowtree"; public static final String C_PARAM_RESPATH = "respath"; public static final String C_PARAM_SHOWMENUS = "showmenus"; <BUG>public static final String C_PARAM_STARTFOLDER = "startfolder"; private String m_headNavFolder;</BUG> private String m_locale; private CmsMessages m_messages; private String m_navLeftElementUri;
public static final String C_PARAM_NAVLEFT_ELEMENTURI = "navleftelementuri"; public static final String C_PARAM_NAVLEFT_SHOWSELECTED = "navleftselected"; public static final String C_PARAM_NAVLEFT_SHOWTREE = "navleftshowtree"; public static final String C_PARAM_RESPATH = "respath"; public static final String C_PARAM_SHOWMENUS = "showmenus"; public static final String C_PARAM_STARTFOLDER = "startfolder"; public static final String C_PROPERTY_HEADNAV_USE = "style_head_nav_showitem"; private String m_headNavFolder; private String m_locale; private CmsMessages m_messages; private String m_navLeftElementUri;
59,466
TodoItemRepository repository = new TodoItemRepository(BEAN_FACTORY); ApplicationElement application = new ApplicationElement(repository, i18n); Element body = Browser.getDocument().getBody(); body.appendChild(application.asElement()); body.appendChild(new FooterElement(i18n).asElement()); <BUG>Element e = new MyBuilder().ahref( "http://www.google.com" ) .img( "https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png" ).end() .end().build(); body.appendChild( e );</BUG> History.addValueChangeHandler(event -> application.filter(event.getValue()));
TodoItemRepository repository = new TodoItemRepository(BEAN_FACTORY); ApplicationElement application = new ApplicationElement(repository, i18n); Element body = Browser.getDocument().getBody(); body.appendChild(application.asElement()); body.appendChild(new FooterElement(i18n).asElement()); History.addValueChangeHandler(event -> application.filter(event.getValue()));
59,467
private final I18n i18n; private Filter filter; ApplicationElement(TodoItemRepository repository, I18n i18n) { this.repository = repository; this.i18n = i18n; <BUG>Elements.Builder builder = new Elements.Builder() .section().css("todoapp")</BUG> .header().css("header") .h(1).innerText(i18n.constants().todos()).end() .input(text)
private final I18n i18n; private Filter filter; ApplicationElement(TodoItemRepository repository, I18n i18n) { this.repository = repository; this.i18n = i18n; TodoBuilder builder = new TodoBuilder() .section().css("todoapp") .header().css("header") .h(1).innerText(i18n.constants().todos()).end() .input(text)
59,468
@Override public String toString() { return (container ? "container" : "simple") + " @ " + level + ": " + element.getTagName(); } } <BUG>public static class Builder extends CoreBuilder<Builder> { public Builder() { super(Browser.getDocument()); } protected Builder(Document document) { super( document );</BUG> }
@Override public String toString() { return (container ? "container" : "simple") + " @ " + level + ": " + element.getTagName();
59,469
return start(document.createElement(tag)); } public B start(Element element) { elements.push(new ElementInfo(element, true, level)); level++; <BUG>return (B) this; }</BUG> public B end() { assertCurrent(); if (level == 0) {
return start(document.createElement(tag)); } public B start(Element element) { elements.push(new ElementInfo(element, true, level)); level++; return that(); } public B end() { assertCurrent(); if (level == 0) {
59,470
Element closingElement = elements.peek().element; for (ElementInfo child : children) { closingElement.appendChild(child.element); } level--; <BUG>return (B) this; }</BUG> private String dumpElements() { return elements.toString(); }
Element closingElement = elements.peek().element; for (ElementInfo child : children) { closingElement.appendChild(child.element); } level--; return that(); } private String dumpElements() { return elements.toString(); }
59,471
} public B on(EventType type, EventListener listener) { assertCurrent(); Element element = elements.peek().element; type.register(element, listener); <BUG>return (B) this; }</BUG> public B rememberAs(String id) { assertCurrent(); references.put(id, elements.peek().element);
} public B attr(String name, String value) { assertCurrent(); elements.peek().element.setAttribute(name, value); return that(); }
59,472
import static org.junit.Assert.assertNotNull; import static org.mockito.Matchers.anyString; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; public class ElementsBuilderTest { <BUG>private Elements.Builder builder; </BUG> @Before public void setUp() { Document document = mock(Document.class);
import static org.junit.Assert.assertNotNull; import static org.mockito.Matchers.anyString; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; public class ElementsBuilderTest { private TestableBuilder builder; @Before public void setUp() { Document document = mock(Document.class);
59,473
when(document.createParagraphElement()).thenAnswer(invocation -> new StandaloneElement("p")); when(document.createSelectElement()).thenAnswer(invocation -> new StandaloneInputElement("select")); when(document.createSpanElement()).thenAnswer(invocation -> new StandaloneElement("span")); when(document.createTextAreaElement()).thenAnswer(invocation -> new StandaloneInputElement("textarea")); when(document.createUListElement()).thenAnswer(invocation -> new StandaloneElement("ul")); <BUG>builder = new Elements.Builder(document); </BUG> } @Test public void headings() {
when(document.createParagraphElement()).thenAnswer(invocation -> new StandaloneElement("p")); when(document.createSelectElement()).thenAnswer(invocation -> new StandaloneInputElement("select")); when(document.createSpanElement()).thenAnswer(invocation -> new StandaloneElement("span")); when(document.createTextAreaElement()).thenAnswer(invocation -> new StandaloneInputElement("textarea")); when(document.createUListElement()).thenAnswer(invocation -> new StandaloneElement("ul")); builder = new TestableBuilder(document); } @Test public void headings() {
59,474
package org.opencms.importexport; import org.opencms.file.CmsResourceTypeFolder; import org.opencms.file.CmsResourceTypePlain; import org.opencms.main.I_CmsConstants; import org.opencms.workplace.I_CmsWpConstants; <BUG>import com.opencms.template.A_CmsXmlContent; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList;</BUG> public class CmsCompatibleCheck {
package org.opencms.importexport; import org.opencms.file.CmsResourceTypeFolder; import org.opencms.file.CmsResourceTypePlain; import org.opencms.main.I_CmsConstants; import org.opencms.workplace.I_CmsWpConstants; import java.util.List; import org.dom4j.Document; import org.dom4j.DocumentHelper; import org.dom4j.Element; import org.dom4j.Node; public class CmsCompatibleCheck {
59,475
if ((nodeValue != null) && (nodeValue.trim().length() > 0)) { return false; } } else if (ntype == Node.ELEMENT_NODE) { <BUG>if (!"element".equalsIgnoreCase(n.getNodeName())) { return false;</BUG> } <BUG>if (!"frametemplate".equals(((Element)n).getAttribute("name"))) { </BUG> return false;
if ((nodeValue != null) && (nodeValue.trim().length() > 0)) { return false; } } else if (ntype == Node.ELEMENT_NODE) { if (!"element".equalsIgnoreCase(n.getName())) { return false;
59,476
if (name.startsWith(I_CmsWpConstants.C_VFS_PATH_BODIES)) { if (!CmsResourceTypePlain.C_RESOURCE_TYPE_NAME.equals(type)) { return false; } try { <BUG>org.w3c.dom.Document xmlDoc = A_CmsXmlContent.getXmlParser().parse(new java.io.StringReader(new String(content))); for (Node n = xmlDoc.getFirstChild(); n != null; n = treeWalker(xmlDoc, n)) { </BUG> short ntype = n.getNodeType(); if (((ntype > Node.CDATA_SECTION_NODE) && ntype < Node.DOCUMENT_TYPE_NODE) || (ntype == Node.ATTRIBUTE_NODE)) {
if (name.startsWith(I_CmsWpConstants.C_VFS_PATH_BODIES)) { if (!CmsResourceTypePlain.C_RESOURCE_TYPE_NAME.equals(type)) { return false; } try { Document xmlDoc = DocumentHelper.parseText(new String(content)); for (Node n = (Node) xmlDoc.content().get(0); n != null; n = treeWalker(xmlDoc, n)) { short ntype = n.getNodeType(); if (((ntype > Node.CDATA_SECTION_NODE) && ntype < Node.DOCUMENT_TYPE_NODE) || (ntype == Node.ATTRIBUTE_NODE)) {
59,477
short ntype = n.getNodeType(); if (((ntype > Node.CDATA_SECTION_NODE) && ntype < Node.DOCUMENT_TYPE_NODE) || (ntype == Node.ATTRIBUTE_NODE)) { return false; } if (n.getNodeType() == Node.ELEMENT_NODE) { <BUG>String tagName = n.getNodeName(); if (!("template".equalsIgnoreCase(tagName) || "xmltemplate".equalsIgnoreCase(tagName))) {</BUG> return false; } }
short ntype = n.getNodeType(); if (((ntype > Node.CDATA_SECTION_NODE) && ntype < Node.DOCUMENT_TYPE_NODE) || (ntype == Node.ATTRIBUTE_NODE)) { return false;
59,478
counterTeplate++; } else { return false; } } else if (nodeType == Node.TEXT_NODE) { <BUG>String nodeValue = n.getNodeValue(); </BUG> if ((nodeValue != null) && (nodeValue.trim().length() > 0)) { return false; }
counterTeplate++; } else { return false; } } else if (nodeType == Node.TEXT_NODE) { String nodeValue = n.getText(); if ((nodeValue != null) && (nodeValue.trim().length() > 0)) { return false; }
59,479
<BUG>package org.opencms.importexport; import org.opencms.i18n.CmsLocaleManager;</BUG> import org.opencms.main.CmsException; import org.opencms.main.I_CmsConstants; import org.opencms.main.OpenCms;
package org.opencms.importexport; import org.opencms.file.CmsGroup; import org.opencms.file.CmsObject; import org.opencms.file.CmsResource; import org.opencms.file.CmsResourceTypePointer; import org.opencms.i18n.CmsLocaleManager; import org.opencms.main.CmsException; import org.opencms.main.I_CmsConstants; import org.opencms.main.OpenCms;
59,480
import org.opencms.main.I_CmsConstants; import org.opencms.main.OpenCms; import org.opencms.report.I_CmsReport; import org.opencms.security.CmsAccessControlEntry; import org.opencms.util.CmsUUID; <BUG>import org.opencms.file.CmsGroup; import org.opencms.file.CmsObject; import org.opencms.file.CmsResource; import org.opencms.file.CmsResourceTypePointer;</BUG> import java.io.File;
import org.opencms.main.I_CmsConstants; import org.opencms.main.OpenCms; import org.opencms.report.I_CmsReport; import org.opencms.security.CmsAccessControlEntry; import org.opencms.util.CmsUUID; import java.io.File;
59,481
import java.util.Map; import java.util.Stack; import java.util.Vector; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; <BUG>import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList;</BUG> public abstract class A_CmsImport implements I_CmsImport {
import java.util.Map; import java.util.Stack; import java.util.Vector; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; import org.dom4j.Document; import org.dom4j.Element; public abstract class A_CmsImport implements I_CmsImport {
59,482
properties.put(name, value); createPropertydefinition(name, resType); } } return properties; <BUG>} protected String getTextNodeValue(Element elem, String tag) { try { return elem.getElementsByTagName(tag).item(0).getFirstChild().getNodeValue(); } catch (Exception exc) { return null; }</BUG> }
properties.put(name, value); createPropertydefinition(name, resType); } } return properties; }
59,483
package org.thymeleaf.spring3.processor; import org.springframework.web.servlet.support.BindStatus; import org.thymeleaf.context.ITemplateContext; <BUG>import org.thymeleaf.engine.AttributeName; import org.thymeleaf.model.IProcessableElementTag;</BUG> import org.thymeleaf.processor.element.IElementTagStructureHandler; <BUG>import org.thymeleaf.spring3.requestdata.RequestDataValueProcessorUtils; public final class SpringInputPasswordFieldTagProcessor extends AbstractSpringFieldTagProcessor {</BUG> public static final String PASSWORD_INPUT_TYPE_ATTR_VALUE = "password";
package org.thymeleaf.spring3.processor; import org.springframework.web.servlet.support.BindStatus; import org.thymeleaf.context.ITemplateContext; import org.thymeleaf.engine.AttributeName; import org.thymeleaf.model.IElementAttributes; import org.thymeleaf.model.IProcessableElementTag; import org.thymeleaf.processor.element.IElementTagStructureHandler; import org.thymeleaf.spring3.requestdata.RequestDataValueProcessorUtils; import org.thymeleaf.standard.util.StandardProcessorUtils; public final class SpringInputPasswordFieldTagProcessor extends AbstractSpringFieldTagProcessor { public static final String PASSWORD_INPUT_TYPE_ATTR_VALUE = "password";
59,484
import org.thymeleaf.processor.element.IElementTagStructureHandler; <BUG>import org.thymeleaf.spring3.requestdata.RequestDataValueProcessorUtils; public final class SpringInputPasswordFieldTagProcessor extends AbstractSpringFieldTagProcessor {</BUG> public static final String PASSWORD_INPUT_TYPE_ATTR_VALUE = "password"; public SpringInputPasswordFieldTagProcessor(final String dialectPrefix) { <BUG>super(dialectPrefix, INPUT_TAG_NAME, INPUT_TYPE_ATTR_NAME, new String[] { PASSWORD_INPUT_TYPE_ATTR_VALUE }, true); }</BUG> @Override protected void doProcess(final ITemplateContext context, final IProcessableElementTag tag,
import org.thymeleaf.processor.element.IElementTagStructureHandler; import org.thymeleaf.spring3.requestdata.RequestDataValueProcessorUtils; import org.thymeleaf.standard.util.StandardProcessorUtils; public final class SpringInputPasswordFieldTagProcessor extends AbstractSpringFieldTagProcessor { public static final String PASSWORD_INPUT_TYPE_ATTR_VALUE = "password"; public SpringInputPasswordFieldTagProcessor(final String dialectPrefix) { super(dialectPrefix, INPUT_TAG_NAME, TYPE_ATTR_NAME, new String[] { PASSWORD_INPUT_TYPE_ATTR_VALUE }, true); } @Override protected void doProcess(final ITemplateContext context, final IProcessableElementTag tag,
59,485
final AttributeName attributeName, final String attributeValue, final BindStatus bindStatus, final IElementTagStructureHandler structureHandler) { String name = bindStatus.getExpression(); name = (name == null? "" : name); final String id = computeId(context, tag, name, false); <BUG>tag.getAttributes().setAttribute("id", id); // No need to escape: this comes from an existing 'id' or from a token tag.getAttributes().setAttribute("name", name); // No need to escape: this is a java-valid token tag.getAttributes().setAttribute( "value", RequestDataValueProcessorUtils.processFormFieldValue(context, name, "", "password")); </BUG> }
final AttributeName attributeName, final String attributeValue, final BindStatus bindStatus, final IElementTagStructureHandler structureHandler) { String name = bindStatus.getExpression(); name = (name == null? "" : name); final String id = computeId(context, tag, name, false); final IElementAttributes attributes = tag.getAttributes(); StandardProcessorUtils.setAttribute(attributes, this.idAttributeDefinition, ID_ATTR_NAME, id); // No need to escape: this comes from an existing 'id' or from a token StandardProcessorUtils.setAttribute(attributes, this.nameAttributeDefinition, NAME_ATTR_NAME, name); // No need to escape: this is a java-valid token StandardProcessorUtils.setAttribute( attributes, this.valueAttributeDefinition, VALUE_ATTR_NAME, RequestDataValueProcessorUtils.processFormFieldValue(context, name, "", "password"));
59,486
import org.springframework.web.bind.WebDataBinder; import org.springframework.web.servlet.support.BindStatus; import org.springframework.web.servlet.tags.form.SelectedValueComparatorWrapper; import org.thymeleaf.context.ITemplateContext; import org.thymeleaf.engine.AttributeName; <BUG>import org.thymeleaf.exceptions.TemplateProcessingException; import org.thymeleaf.model.IModel;</BUG> import org.thymeleaf.model.IModelFactory; import org.thymeleaf.model.IProcessableElementTag; import org.thymeleaf.model.IStandaloneElementTag;
import org.springframework.web.bind.WebDataBinder; import org.springframework.web.servlet.support.BindStatus; import org.springframework.web.servlet.tags.form.SelectedValueComparatorWrapper; import org.thymeleaf.context.ITemplateContext; import org.thymeleaf.engine.AttributeName; import org.thymeleaf.exceptions.TemplateProcessingException; import org.thymeleaf.model.IElementAttributes; import org.thymeleaf.model.IModel; import org.thymeleaf.model.IModelFactory; import org.thymeleaf.model.IProcessableElementTag; import org.thymeleaf.model.IStandaloneElementTag;
59,487
name = (name == null? "" : name); final String id = computeId(context, tag, name, true); String value = null; boolean checked = false; Object boundValue = bindStatus.getValue(); <BUG>final Class<?> valueType = bindStatus.getValueType(); if (Boolean.class.equals(valueType) || boolean.class.equals(valueType)) {</BUG> if (boundValue instanceof String) { boundValue = Boolean.valueOf((String) boundValue); }
name = (name == null? "" : name); final String id = computeId(context, tag, name, true); String value = null; boolean checked = false; Object boundValue = bindStatus.getValue(); final Class<?> valueType = bindStatus.getValueType(); final IElementAttributes attributes = tag.getAttributes(); if (Boolean.class.equals(valueType) || boolean.class.equals(valueType)) { if (boundValue instanceof String) { boundValue = Boolean.valueOf((String) boundValue); }
59,488
} final Boolean booleanValue = (boundValue != null ? (Boolean) boundValue : Boolean.FALSE); value = "true"; checked = booleanValue.booleanValue(); } else { <BUG>value = tag.getAttributes().getValue("value"); if (value == null) {</BUG> throw new TemplateProcessingException( "Attribute \"value\" is required in \"input(checkbox)\" tags " + "when binding to non-boolean values");
} final Boolean booleanValue = (boundValue != null ? (Boolean) boundValue : Boolean.FALSE); value = "true"; checked = booleanValue.booleanValue(); } else { value = attributes.getValue(this.valueAttributeDefinition.getAttributeName()); if (value == null) { throw new TemplateProcessingException( "Attribute \"value\" is required in \"input(checkbox)\" tags " + "when binding to non-boolean values");
59,489
"Attribute \"value\" is required in \"input(checkbox)\" tags " + "when binding to non-boolean values"); } checked = SelectedValueComparatorWrapper.isSelected(bindStatus, HtmlEscape.unescapeHtml(value)); } <BUG>tag.getAttributes().setAttribute("id", id); // No need to escape: this comes from an existing 'id' or from a token tag.getAttributes().setAttribute("name", name); // No need to escape: this is a java-valid token tag.getAttributes().setAttribute( "value", RequestDataValueProcessorUtils.processFormFieldValue(context, name, value, "checkbox")); </BUG> if (checked) {
"Attribute \"value\" is required in \"input(checkbox)\" tags " + "when binding to non-boolean values"); } checked = SelectedValueComparatorWrapper.isSelected(bindStatus, HtmlEscape.unescapeHtml(value)); } StandardProcessorUtils.setAttribute(attributes, this.idAttributeDefinition, ID_ATTR_NAME, id); // No need to escape: this comes from an existing 'id' or from a token StandardProcessorUtils.setAttribute(attributes, this.nameAttributeDefinition, NAME_ATTR_NAME, name); // No need to escape: this is a java-valid token StandardProcessorUtils.setAttribute( attributes, this.valueAttributeDefinition, VALUE_ATTR_NAME, RequestDataValueProcessorUtils.processFormFieldValue(context, name, value, "checkbox"));
59,490
final IModel hiddenTagModel = modelFactory.createModel(); final String hiddenName = WebDataBinder.DEFAULT_FIELD_MARKER_PREFIX + name; final String hiddenValue = "on"; final IStandaloneElementTag hiddenTag = modelFactory.createStandaloneElementTag(INPUT_TAG_NAME, true); <BUG>hiddenTag.getAttributes().setAttribute("type", "hidden"); hiddenTag.getAttributes().setAttribute("name", hiddenName); hiddenTag.getAttributes().setAttribute( "value", RequestDataValueProcessorUtils.processFormFieldValue(context, hiddenName, hiddenValue, "hidden")); </BUG> hiddenTagModel.add(hiddenTag);
final IModel hiddenTagModel = modelFactory.createModel(); final String hiddenName = WebDataBinder.DEFAULT_FIELD_MARKER_PREFIX + name; final String hiddenValue = "on"; final IStandaloneElementTag hiddenTag = modelFactory.createStandaloneElementTag(INPUT_TAG_NAME, true); final IElementAttributes hiddenTagAttributes = hiddenTag.getAttributes(); StandardProcessorUtils.setAttribute(hiddenTagAttributes, this.typeAttributeDefinition, TYPE_ATTR_NAME, "hidden"); StandardProcessorUtils.setAttribute(hiddenTagAttributes, this.nameAttributeDefinition, NAME_ATTR_NAME, hiddenName); StandardProcessorUtils.setAttribute( hiddenTagAttributes, this.valueAttributeDefinition, VALUE_ATTR_NAME, RequestDataValueProcessorUtils.processFormFieldValue(context, hiddenName, hiddenValue, "hidden")); hiddenTagModel.add(hiddenTag);
59,491
package org.thymeleaf.spring3.processor; import org.springframework.util.StringUtils; import org.springframework.web.servlet.support.BindStatus; <BUG>import org.thymeleaf.context.ITemplateContext; import org.thymeleaf.engine.AttributeName; import org.thymeleaf.model.IProcessableElementTag;</BUG> import org.thymeleaf.processor.element.AbstractAttributeTagProcessor; import org.thymeleaf.processor.element.IElementTagStructureHandler;
package org.thymeleaf.spring3.processor; import org.springframework.util.StringUtils; import org.springframework.web.servlet.support.BindStatus; import org.thymeleaf.context.ITemplateContext; import org.thymeleaf.engine.AttributeDefinition; import org.thymeleaf.engine.AttributeDefinitions; import org.thymeleaf.engine.AttributeName; import org.thymeleaf.engine.IAttributeDefinitionsAware; import org.thymeleaf.model.IElementAttributes; import org.thymeleaf.model.IProcessableElementTag; import org.thymeleaf.processor.element.AbstractAttributeTagProcessor; import org.thymeleaf.processor.element.IElementTagStructureHandler;
59,492
import org.thymeleaf.processor.element.AbstractAttributeTagProcessor; import org.thymeleaf.processor.element.IElementTagStructureHandler; import org.thymeleaf.spring3.naming.SpringContextVariableNames; import org.thymeleaf.spring3.util.FieldUtils; import org.thymeleaf.templatemode.TemplateMode; <BUG>public abstract class AbstractSpringFieldTagProcessor extends AbstractAttributeTagProcessor { public static final int ATTR_PRECEDENCE = 1200; public static final String ATTR_NAME = "field"; protected static final String INPUT_TAG_NAME = "input";</BUG> protected static final String SELECT_TAG_NAME = "select";
import org.thymeleaf.processor.element.AbstractAttributeTagProcessor; import org.thymeleaf.processor.element.IElementTagStructureHandler; import org.thymeleaf.spring3.naming.SpringContextVariableNames; import org.thymeleaf.spring3.util.FieldUtils; import org.thymeleaf.templatemode.TemplateMode; import org.thymeleaf.util.Validate; public abstract class AbstractSpringFieldTagProcessor extends AbstractAttributeTagProcessor implements IAttributeDefinitionsAware { public static final int ATTR_PRECEDENCE = 1200; public static final String ATTR_NAME = "field"; private static final TemplateMode TEMPLATE_MODE = TemplateMode.HTML; protected static final String INPUT_TAG_NAME = "input"; protected static final String SELECT_TAG_NAME = "select";
59,493
package org.thymeleaf.spring3.processor; import org.springframework.web.servlet.support.BindStatus; import org.springframework.web.servlet.tags.form.ValueFormatterWrapper; import org.thymeleaf.context.ITemplateContext; <BUG>import org.thymeleaf.engine.AttributeName; import org.thymeleaf.model.IProcessableElementTag;</BUG> import org.thymeleaf.processor.element.IElementTagStructureHandler; <BUG>import org.thymeleaf.spring3.requestdata.RequestDataValueProcessorUtils; public final class SpringInputGeneralFieldTagProcessor</BUG> extends AbstractSpringFieldTagProcessor {
package org.thymeleaf.spring3.processor; import org.springframework.web.servlet.support.BindStatus; import org.springframework.web.servlet.tags.form.ValueFormatterWrapper; import org.thymeleaf.context.ITemplateContext; import org.thymeleaf.engine.AttributeName; import org.thymeleaf.model.IElementAttributes; import org.thymeleaf.model.IProcessableElementTag; import org.thymeleaf.processor.element.IElementTagStructureHandler; import org.thymeleaf.spring3.requestdata.RequestDataValueProcessorUtils; import org.thymeleaf.standard.util.StandardProcessorUtils; public final class SpringInputGeneralFieldTagProcessor extends AbstractSpringFieldTagProcessor {
59,494
SEARCH_INPUT_TYPE_ATTR_VALUE, TEL_INPUT_TYPE_ATTR_VALUE, COLOR_INPUT_TYPE_ATTR_VALUE }; public SpringInputGeneralFieldTagProcessor(final String dialectPrefix) { <BUG>super(dialectPrefix, INPUT_TAG_NAME, INPUT_TYPE_ATTR_NAME, ALL_TYPE_ATTR_VALUES, true); }</BUG> @Override protected void doProcess(final ITemplateContext context, final IProcessableElementTag tag,
SEARCH_INPUT_TYPE_ATTR_VALUE, TEL_INPUT_TYPE_ATTR_VALUE, COLOR_INPUT_TYPE_ATTR_VALUE }; public SpringInputGeneralFieldTagProcessor(final String dialectPrefix) { super(dialectPrefix, INPUT_TAG_NAME, TYPE_ATTR_NAME, ALL_TYPE_ATTR_VALUES, true); } @Override protected void doProcess(final ITemplateContext context, final IProcessableElementTag tag,
59,495
package org.thymeleaf.spring3.processor; import org.springframework.web.servlet.support.BindStatus; import org.thymeleaf.context.ITemplateContext; <BUG>import org.thymeleaf.engine.AttributeName; import org.thymeleaf.model.IProcessableElementTag; import org.thymeleaf.processor.element.IElementTagStructureHandler; public final class SpringInputFileFieldTagProcessor extends AbstractSpringFieldTagProcessor {</BUG> public static final String FILE_INPUT_TYPE_ATTR_VALUE = "file";
package org.thymeleaf.spring3.processor; import org.springframework.web.servlet.support.BindStatus; import org.thymeleaf.context.ITemplateContext; import org.thymeleaf.engine.AttributeName; import org.thymeleaf.model.IElementAttributes; import org.thymeleaf.model.IProcessableElementTag; import org.thymeleaf.processor.element.IElementTagStructureHandler; import org.thymeleaf.standard.util.StandardProcessorUtils; public final class SpringInputFileFieldTagProcessor extends AbstractSpringFieldTagProcessor { public static final String FILE_INPUT_TYPE_ATTR_VALUE = "file";
59,496
import org.thymeleaf.model.IProcessableElementTag; import org.thymeleaf.processor.element.IElementTagStructureHandler; public final class SpringInputFileFieldTagProcessor extends AbstractSpringFieldTagProcessor {</BUG> public static final String FILE_INPUT_TYPE_ATTR_VALUE = "file"; public SpringInputFileFieldTagProcessor(final String dialectPrefix) { <BUG>super(dialectPrefix, INPUT_TAG_NAME, INPUT_TYPE_ATTR_NAME, new String[] { FILE_INPUT_TYPE_ATTR_VALUE }, true); }</BUG> @Override protected void doProcess(final ITemplateContext context, final IProcessableElementTag tag,
import org.thymeleaf.model.IProcessableElementTag; import org.thymeleaf.processor.element.IElementTagStructureHandler; import org.thymeleaf.standard.util.StandardProcessorUtils; public final class SpringInputFileFieldTagProcessor extends AbstractSpringFieldTagProcessor { public static final String FILE_INPUT_TYPE_ATTR_VALUE = "file"; public SpringInputFileFieldTagProcessor(final String dialectPrefix) { super(dialectPrefix, INPUT_TAG_NAME, TYPE_ATTR_NAME, new String[] { FILE_INPUT_TYPE_ATTR_VALUE }, true); } @Override protected void doProcess(final ITemplateContext context, final IProcessableElementTag tag,
59,497
public Collection<ExpandDrill> get_drills(ArtEngine p_art_engine, boolean p_attach_smd) { if ( p_art_engine.get_net_no() == net_no) return drill_list; net_no = p_art_engine.get_net_no(); drill_list.clear(); <BUG>AwtreeShapeSearch search_tree = p_art_engine.art_search_tree; Collection<AwtreeEntry> overlaps = new LinkedList<AwtreeEntry>(); search_tree.calc_overlapping_tree_entries(page_shape, -1, overlaps);</BUG> Collection<ShapeTile> cutout_shapes = new LinkedList<ShapeTile>(); ShapeTile prev_obstacle_shape = ShapeTileBox.EMPTY;
public Collection<ExpandDrill> get_drills(ArtEngine p_art_engine, boolean p_attach_smd) { if ( p_art_engine.get_net_no() == net_no) return drill_list; net_no = p_art_engine.get_net_no(); drill_list.clear(); AwtreeShapeSearch search_tree = p_art_engine.art_search_tree; Collection<AwtreeEntry> overlaps = search_tree.find_overlap_tree_entries(page_shape, -1); Collection<ShapeTile> cutout_shapes = new LinkedList<ShapeTile>(); ShapeTile prev_obstacle_shape = ShapeTileBox.EMPTY;
59,498
PlaSegmentInt curr_segment = polyline.segment_get(index + 1); if (p_clip_shape != null) { if ( ! p_clip_shape.intersects(curr_segment.bounding_box())) continue; } <BUG>ShapeTile curr_shape = get_tree_shape(default_tree, index); LinkedList<AwtreeEntry> over_tree_entries = new LinkedList<AwtreeEntry>(); default_tree.calc_overlapping_tree_entries(curr_shape, get_layer(), over_tree_entries);</BUG> Iterator<AwtreeEntry> over_tree_iter = over_tree_entries.iterator(); while (over_tree_iter.hasNext())
PlaSegmentInt curr_segment = polyline.segment_get(index + 1); if (p_clip_shape != null) { if ( ! p_clip_shape.intersects(curr_segment.bounding_box())) continue; } ShapeTile curr_shape = get_tree_shape(default_tree, index); Collection<AwtreeEntry> over_tree_entries = default_tree.find_overlap_tree_entries(curr_shape, get_layer()); Iterator<AwtreeEntry> over_tree_iter = over_tree_entries.iterator(); while (over_tree_iter.hasNext())
59,499
ArrayList<PlaLineInt> intersecting_lines = found_line_segment.intersection(curr_segment); LinkedList<BrdTracep> split_pieces = new LinkedList<BrdTracep>(); boolean found_trace_split = split_tracep_other (found_trace, split_pieces, intersecting_lines, overlap_tentry); if (found_trace_split) { <BUG>default_tree.calc_overlapping_tree_entries(curr_shape, get_layer(), over_tree_entries); over_tree_iter = over_tree_entries.iterator();</BUG> } intersecting_lines = curr_segment.intersection(found_line_segment); own_trace_split = split_tracep_own (index,result,intersecting_lines, p_clip_shape);
ArrayList<PlaLineInt> intersecting_lines = found_line_segment.intersection(curr_segment); LinkedList<BrdTracep> split_pieces = new LinkedList<BrdTracep>(); boolean found_trace_split = split_tracep_other (found_trace, split_pieces, intersecting_lines, overlap_tentry); if (found_trace_split) { over_tree_entries = default_tree.find_overlap_tree_entries(curr_shape, get_layer()); over_tree_iter = over_tree_entries.iterator(); } intersecting_lines = curr_segment.intersection(found_line_segment); own_trace_split = split_tracep_own (index,result,intersecting_lines, p_clip_shape);
59,500
p_start_piece.set_search_tree_entries(this, start_piece_leaf_arr ); p_end_piece.set_search_tree_entries(this, end_piece_leaf_arr ); } public final TreeSet<AwtreeObject> find_overlap_objects(ShapeConvex p_shape, int p_layer, NetNosList p_ignore_net_nos) { <BUG>TreeSet<AwtreeObject> risul_obstacles = new TreeSet<AwtreeObject>(); Collection<AwtreeEntry> tree_entries = new LinkedList<AwtreeEntry>(); calc_overlapping_tree_entries(p_shape, p_layer, p_ignore_net_nos, tree_entries);</BUG> Iterator<AwtreeEntry> it = tree_entries.iterator(); while (it.hasNext())
p_start_piece.set_search_tree_entries(this, start_piece_leaf_arr ); p_end_piece.set_search_tree_entries(this, end_piece_leaf_arr ); } public final TreeSet<AwtreeObject> find_overlap_objects(ShapeConvex p_shape, int p_layer, NetNosList p_ignore_net_nos) { TreeSet<AwtreeObject> risul_obstacles = new TreeSet<AwtreeObject>(); Collection<AwtreeEntry> tree_entries = find_overlap_tree_entries(p_shape, p_layer, p_ignore_net_nos); Iterator<AwtreeEntry> it = tree_entries.iterator(); while (it.hasNext())