auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void setWidth(String width, boolean isFixedLayout) { table.setWidth("100%", true); tableHeader.setWidth("100%", true); }

Target:
public void setWidth(String width, boolean isFixedLayout) { table.setWidth("100%", isFixedLayout); tableHeader.setWidth("100%", isFixedLayout); }
Source:
public static String getThreadId(final Thread thread) { final Object id = THREAD_ID.get(thread) ; if (id != null) { return (String)id ; } final String newId = getNextId() ; THREAD_ID.put(thread,newId) ; return newId ; }

Target:
public static String getThreadId(final Thread thread) { final String id = THREAD_ID.get(thread) ; if (id != null) { return id ; } final String newId = getNextId() ; THREAD_ID.put(thread,newId) ; return newId ; }
Source:
public ICPPEvaluation[] getAll() { return new ICPPEvaluation[] {this.getEvaluation()}; }

Target:
public ICPPEvaluation[] getAll() { return new ICPPEvaluation[] { getEvaluation() }; }
Source:
public static List<SCMHeadCategory> addUncategorizedIfMissing(List<SCMHeadCategory> categories) { for (SCMHeadCategory category : categories) { if (category.isUncategorized()) { return categories; } } categories.add(new UncategorizedSCMHeadCategory()); return categories; }

Target:
public static List<SCMHeadCategory> addUncategorizedIfMissing(List<SCMHeadCategory> categories) { for (SCMHeadCategory category : categories) { if (category.isUncategorized()) { return categories; } } categories.add(UncategorizedSCMHeadCategory.DEFAULT); return categories; }
Source:
private void verifyHeadersForGetBlobNotModified(MockRestResponseChannel restResponseChannel) throws RestServiceException { Assert.assertNotNull("Date has not been set", restResponseChannel.getHeader(RestUtils.Headers.DATE)); Assert.assertNull("Blob Size should have been null", restResponseChannel.getHeader(RestUtils.Headers.BLOB_SIZE)); Assert.assertNull("Content Type should have been null", restResponseChannel.getHeader(RestUtils.Headers.CONTENT_TYPE)); Assert.assertNull("Expires should have been null", restResponseChannel.getHeader(RestUtils.Headers.EXPIRES)); Assert.assertNull("Cache control should have been null", restResponseChannel.getHeader(RestUtils.Headers.CACHE_CONTROL)); Assert.assertNull("Pragma should have been null", restResponseChannel.getHeader(RestUtils.Headers.PRAGMA)); Assert.assertEquals("Content length should have been 0", "0", restResponseChannel.getHeader(RestUtils.Headers.CONTENT_LENGTH)); }

Target:
private void verifyHeadersForGetBlobNotModified(MockRestResponseChannel restResponseChannel) throws RestServiceException { Assert.assertNotNull("Date has not been set", restResponseChannel.getHeader(RestUtils.Headers.DATE)); Assert.assertEquals("Content length should have been 0", "0", restResponseChannel.getHeader(RestUtils.Headers.CONTENT_LENGTH)); verifyAbsenceOfHeaders(restResponseChannel, RestUtils.Headers.LAST_MODIFIED, RestUtils.Headers.BLOB_SIZE, RestUtils.Headers.CONTENT_TYPE, RestUtils.Headers.EXPIRES, RestUtils.Headers.CACHE_CONTROL, RestUtils.Headers.PRAGMA); }
Source:
protected List<E> getSelectionFromWidget() { if (virtualManager != null) { return getVirtualSelection(); } Widget[] items = doGetSelection(); ArrayList<E> list = new ArrayList<E>(items.length); for (int i = 0; i < items.length; i++) { Widget item = items[i]; E e = (E) item.getData(); if (e != null) { list.add(e); } } return list; }

Target:
protected List<E> getSelectionFromWidget() { if (virtualManager != null) { return getVirtualSelection(); } Widget[] items = doGetSelection(); ArrayList<E> list = new ArrayList<E>(items.length); for (int i = 0; i < items.length; i++) { Widget item = items[i]; @SuppressWarnings("unchecked") E e = (E) item.getData(); if (e != null) { list.add(e); } } return list; }
Source:
protected void fireTrigger(final ReplicationTrigger trigger) { Log.d(Log.TAG_SYNC, "%s [fireTrigger()] => " + trigger, this); if (executor != null) { synchronized (executor) { if (!executor.isShutdown()) { executor.submit(new Runnable() { @Override public void run() { try { Log.d(Log.TAG_SYNC, "firing trigger: %s", trigger); stateMachine.fire(trigger); } catch (Exception e) { Log.i(Log.TAG_SYNC, "Error in StateMachine.fire(trigger): %s", e.getMessage()); throw new RuntimeException(e); } } }); } } } }

Target:
protected void fireTrigger(final ReplicationTrigger trigger) { Log.d(Log.TAG_SYNC, "%s [fireTrigger()] => " + trigger, this); synchronized (executor) { if (!executor.isShutdown()) { executor.submit(new Runnable() { @Override public void run() { try { Log.d(Log.TAG_SYNC, "firing trigger: %s", trigger); stateMachine.fire(trigger); } catch (Exception e) { Log.i(Log.TAG_SYNC, "Error in StateMachine.fire(trigger): %s", e.getMessage()); throw new RuntimeException(e); } } }); } } }
Source:
public void close() throws InterruptedException { close(false, false); }

Target:
public void close() throws InterruptedException { close(false); }
Source:
private SqlTask( TaskId taskId, URI location, String nodeId, QueryContext queryContext, SqlTaskExecutionFactory sqlTaskExecutionFactory, ExchangeClientSupplier exchangeClientSupplier, ExecutorService taskNotificationExecutor, DataSize maxBufferSize) { this.taskId = requireNonNull(taskId, "taskId is null"); this.taskInstanceUUID = UUID.randomUUID(); this.taskInstanceId = taskInstanceUUID.toString(); this.location = requireNonNull(location, "location is null"); this.nodeId = requireNonNull(nodeId, "nodeId is null"); this.queryContext = requireNonNull(queryContext, "queryContext is null"); this.sqlTaskExecutionFactory = requireNonNull(sqlTaskExecutionFactory, "sqlTaskExecutionFactory is null"); requireNonNull(exchangeClientSupplier, "exchangeClientSupplier is null"); requireNonNull(taskNotificationExecutor, "taskNotificationExecutor is null"); requireNonNull(maxBufferSize, "maxBufferSize is null"); this.taskExchangeClientManager = new TaskExchangeClientManager(exchangeClientSupplier); outputBuffer = new LazyOutputBuffer( taskId, taskInstanceId, taskNotificationExecutor, maxBufferSize, () -> queryContext.getTaskContextByTaskId(taskId).localSystemMemoryContext()); taskStateMachine = new TaskStateMachine(taskId, taskNotificationExecutor); }

Target:
private SqlTask( TaskId taskId, URI location, String nodeId, QueryContext queryContext, SqlTaskExecutionFactory sqlTaskExecutionFactory, ExchangeClientSupplier exchangeClientSupplier, ExecutorService taskNotificationExecutor, DataSize maxBufferSize) { this.taskId = requireNonNull(taskId, "taskId is null"); this.taskInstanceId = new TaskInstanceId(UUID.randomUUID()); this.location = requireNonNull(location, "location is null"); this.nodeId = requireNonNull(nodeId, "nodeId is null"); this.queryContext = requireNonNull(queryContext, "queryContext is null"); this.sqlTaskExecutionFactory = requireNonNull(sqlTaskExecutionFactory, "sqlTaskExecutionFactory is null"); requireNonNull(exchangeClientSupplier, "exchangeClientSupplier is null"); requireNonNull(taskNotificationExecutor, "taskNotificationExecutor is null"); requireNonNull(maxBufferSize, "maxBufferSize is null"); this.taskExchangeClientManager = new TaskExchangeClientManager(exchangeClientSupplier); outputBuffer = new LazyOutputBuffer( taskId, taskInstanceId.getUuidString(), taskNotificationExecutor, maxBufferSize, () -> queryContext.getTaskContextByTaskId(taskId).localSystemMemoryContext()); taskStateMachine = new TaskStateMachine(taskId, taskNotificationExecutor); }
Source:
private GraphQLObjectType buildObjectType(BuildContext buildCtx, ObjectTypeDefinition typeDefinition) { GraphQLObjectType.Builder builder = GraphQLObjectType.newObject(); builder.name(typeDefinition.getName()); builder.description(buildDescription(typeDefinition)); Map<String, GraphQLFieldDefinition> fieldDefinitions = new LinkedHashMap<>(); typeDefinition.getFieldDefinitions().forEach(fieldDef -> { GraphQLFieldDefinition newFieldDefinition = buildField(buildCtx, typeDefinition, fieldDef); fieldDefinitions.put(newFieldDefinition.getName(), newFieldDefinition); }); List<TypeExtensionDefinition> typeExtensions = getTypeExtensionsOf(typeDefinition, buildCtx); typeExtensions.forEach(typeExt -> typeExt.getFieldDefinitions().forEach(fieldDef -> { GraphQLFieldDefinition newFieldDefinition = buildField(buildCtx, typeDefinition, fieldDef); if (!fieldDefinitions.containsKey(newFieldDefinition.getName())) { fieldDefinitions.put(newFieldDefinition.getName(), newFieldDefinition); } })); for (GraphQLFieldDefinition fieldDefinition : fieldDefinitions.values()) { builder.field(fieldDefinition); } Map<String, GraphQLInterfaceType> interfaces = new LinkedHashMap<>(); typeDefinition.getImplements().forEach(type -> { GraphQLInterfaceType newInterfaceType = buildOutputType(buildCtx, type); interfaces.put(newInterfaceType.getName(), newInterfaceType); }); typeExtensions.forEach(typeExt -> typeExt.getImplements().forEach(type -> { GraphQLInterfaceType interfaceType = buildOutputType(buildCtx, type); if (!interfaces.containsKey(interfaceType.getName())) { interfaces.put(interfaceType.getName(), interfaceType); } })); for (GraphQLInterfaceType anInterface : interfaces.values()) { builder.withInterface(anInterface); } return builder.build(); }

Target:
private GraphQLObjectType buildObjectType(BuildContext buildCtx, ObjectTypeDefinition typeDefinition) { GraphQLObjectType.Builder builder = GraphQLObjectType.newObject(); builder.name(typeDefinition.getName()); builder.description(buildDescription(typeDefinition)); List<TypeExtensionDefinition> typeExtensions = getTypeExtensionsOf(typeDefinition, buildCtx); buildObjectTypeFields(buildCtx, typeDefinition, builder, typeExtensions); buildObjectTypeInterfaces(buildCtx, typeDefinition, builder, typeExtensions); return builder.build(); }
Source:
public abstract String getText() throws IOException; public abstract boolean readText(Writer writer) throws IOException; public abstract char[] getTextCharacters() throws IOException; public abstract int getTextLength() throws IOException; public abstract int getTextOffset() throws IOException; public abstract boolean hasTextCharacters(); public abstract Number getNumberValue() throws IOException; public abstract NumberType getNumberType() throws IOException; public byte getByteValue() throws IOException { int value = getIntValue(); if (value < MIN_BYTE_I || value > MAX_BYTE_I) { throw _constructError("Numeric value ("+getText()+") out of range of Java byte"); } return (byte) value; }

Target:
public abstract String getText() throws IOException; public abstract int readText(Writer writer) throws IOException, UnsupportedOperationException; public abstract char[] getTextCharacters() throws IOException; public abstract int getTextLength() throws IOException; public abstract int getTextOffset() throws IOException; public abstract boolean hasTextCharacters(); public abstract Number getNumberValue() throws IOException; public abstract NumberType getNumberType() throws IOException; public byte getByteValue() throws IOException { int value = getIntValue(); if (value < MIN_BYTE_I || value > MAX_BYTE_I) { throw _constructError("Numeric value ("+getText()+") out of range of Java byte"); } return (byte) value; }
Source:
public void sendQueueChunk(List<Song> chunk) throws RemoteException { Preconditions.checkNotNull(mQueueTemp).addAll(chunk); }

Target:
public void sendQueueChunk(List<Song> chunk) throws RemoteException { List<Song> queue = mQueueTemp; if (queue == null) { throw new IllegalStateException("Must call beginBigQueue() to start a transaction"); } queue.addAll(chunk); }
Source:
public LocalWorkspaceDaoImpl(LocalStorageFactory factory) throws IOException { final Map<Class<?>, Object> adapters = new HashMap<>(); adapters.put(Recipe.class, new RecipeTypeAdapter()); adapters.put(ModuleConfig.class, new ModuleConfigAdapter()); this.localStorage = factory.create("workspaces.json", adapters); this.workspaces = new HashMap<>(); }

Target:
public LocalWorkspaceDaoImpl(LocalStorageFactory factory) throws IOException { final Map<Class<?>, Object> adapters = ImmutableMap.of(Recipe.class, new RecipeTypeAdapter(), ModuleConfig.class, new ModuleConfigAdapter()); this.localStorage = factory.create("workspaces.json", adapters); this.workspaces = new HashMap<>(); }
Source:
private void startStatusLogging() { final int healthStatusInterval = config.getInt(NetworkConfig.Keys.HEALTH_STATUS_INTERVAL, 0); if (healthStatusInterval > 0 && HEALTH_LOGGER.isDebugEnabled()) { this.scheduler = Executors .newSingleThreadScheduledExecutor(new DaemonThreadFactory("MessageExchangeStore")); statusLogger = scheduler.scheduleAtFixedRate(new Runnable() { @Override public void run() { if (enableStatus) { dump(5); } } }, healthStatusInterval, healthStatusInterval, TimeUnit.SECONDS); } }

Target:
private void startStatusLogging() { final int healthStatusInterval = config.getInt(NetworkConfig.Keys.HEALTH_STATUS_INTERVAL, NetworkConfigDefaults.DEFAULT_HEALTH_STATUS_INTERVAL); if (healthStatusInterval > 0 && HEALTH_LOGGER.isDebugEnabled()) { this.scheduler = Executors .newSingleThreadScheduledExecutor(new DaemonThreadFactory("MessageExchangeStore")); statusLogger = scheduler.scheduleAtFixedRate(new Runnable() { @Override public void run() { if (enableStatus) { dump(5); } } }, healthStatusInterval, healthStatusInterval, TimeUnit.SECONDS); } }
Source:
public ServletRegistration.Dynamic addServlet(String name, Servlet servlet) { final ServletHolder holder = new NonblockingServletHolder(checkNotNull(servlet)); holder.setName(name); handler.getServletHandler().addServlet(holder); ServletRegistration.Dynamic registration = holder.getRegistration(); if(servlets.contains(name)) { LOGGER.warn("Overriding the existing servlet registered with name: {}", name); } servlets.add(name); return registration; }

Target:
public ServletRegistration.Dynamic addServlet(String name, Servlet servlet) { final ServletHolder holder = new NonblockingServletHolder(checkNotNull(servlet)); holder.setName(name); handler.getServletHandler().addServlet(holder); ServletRegistration.Dynamic registration = holder.getRegistration(); checkDuplicateRegistration(name, servlets, "servlet"); return registration; }
Source:
public Object eval(Object[] args, EvaluationContext ec) { if (entitySelectActivity != null && !entitySelectActivity.containsHereFunction) { refreshLocation(); allowGpsUse(); entitySelectActivity.containsHereFunction = true; } if (location == null) { return ""; } return location.getDisplayText(); }

Target:
public Object eval(Object[] args, EvaluationContext ec) { if (entitySelectActivity != null && !entitySelectActivity.getContainsHereFunction()) { refreshLocation(); allowGpsUse(); entitySelectActivity.setContainsHereFunction(true); } if (location == null) { return ""; } return location.getDisplayText(); }
Source:
protected List<Row> getRowsToUpdate() { final DataContext dc = _updateCallback.getDataContext(); final Table table = getTable(); final List<FilterItem> whereItems = getWhereItems(); final DataSet dataSet = dc.query() .from(table) .select(table.getColumns().toArray(new Column[table.getColumns().size()])) .where(whereItems).execute(); final List<Row> rows = dataSet.toRows(); return rows; }

Target:
protected List<Row> getRowsToUpdate() { final DataContext dc = _updateCallback.getDataContext(); final Table table = getTable(); final List<FilterItem> whereItems = getWhereItems(); final DataSet dataSet = dc.query() .from(table) .select(table.getColumns()) .where(whereItems).execute(); final List<Row> rows = dataSet.toRows(); return rows; }
Source:
public void addAll(SerializableStatus status) { Assert.isLegal(status != null); SerializableStatus[] statuses = (SerializableStatus[]) status.getChildren(); for (SerializableStatus statuse : statuses) { add(statuse); } }

Target:
public void addAll(SerializableStatus status) { Assert.isLegal(status != null); SerializableStatus[] statuses = (SerializableStatus[]) status.getChildren(); for (SerializableStatus s : statuses) { add(s); } }
Source:
private void returnToSyncStateFromOperationHistory() { IProgressMonitor pm = new NullProgressMonitor(); try { IOperationHistory operationHistory = OperationHistoryFactory.getOperationHistory(); IUndoContext undoCtx = getUndoContext(); while (operationHistory != null && operationHistory.canUndo(undoCtx) && session.getStatus() != SessionStatus.SYNC) { IUndoableOperation toUndo = operationHistory.getUndoOperation(undoCtx); operationHistory.undoOperation(toUndo, new NullProgressMonitor(), null); if (marker == toUndo) { break; } } setResourcesBackToSync(); } catch (ExecutionException e) { reloadTheResources(); String sessionLabel = SiriusEditPlugin.getPlugin().getUiCallback().getSessionNameToDisplayWhileSaving(session); SiriusPlugin.getDefault().warning("the session " + sessionLabel + " modified resource(s) have(has) been reloaded. An error occurs while attempting to cancel all modifications.", e); } }

Target:
private void returnToSyncStateFromOperationHistory() { IProgressMonitor pm = new NullProgressMonitor(); try { IOperationHistory operationHistory = OperationHistoryFactory.getOperationHistory(); IUndoContext undoCtx = getUndoContext(); while (operationHistory != null && operationHistory.canUndo(undoCtx) && session.getStatus() != SessionStatus.SYNC) { IUndoableOperation toUndo = operationHistory.getUndoOperation(undoCtx); operationHistory.undoOperation(toUndo, new NullProgressMonitor(), null); if (marker == toUndo) { break; } } setResourcesBackToSync(); } catch (ExecutionException e) { reloadTheResources(); String sessionLabel = SiriusEditPlugin.getPlugin().getUiCallback().getSessionNameToDisplayWhileSaving(session); SiriusPlugin.getDefault().warning(sessionLabel + " modified resources were reloaded. An error occurs while attempting to cancel all modifications.", e); } }
Source:
public static List<ParameterSignature> signatures(Method method) { return signatures(method.getParameterTypes(), method .getParameterAnnotations()); }

Target:
public static ArrayList<ParameterSignature> signatures(Method method) { return signatures(method.getParameterTypes(), method .getParameterAnnotations()); }
Source:
private static DescriptorProtos.FieldDescriptorProto.Type pigTypeToProtoType(byte pigTypeId) { switch(pigTypeId) { case DataType.BOOLEAN: return DescriptorProtos.FieldDescriptorProto.Type.TYPE_BOOL; case DataType.INTEGER: return DescriptorProtos.FieldDescriptorProto.Type.TYPE_INT32; case DataType.LONG: return DescriptorProtos.FieldDescriptorProto.Type.TYPE_INT64; case DataType.FLOAT: return DescriptorProtos.FieldDescriptorProto.Type.TYPE_FLOAT; case DataType.DOUBLE: return DescriptorProtos.FieldDescriptorProto.Type.TYPE_DOUBLE; case DataType.CHARARRAY: return DescriptorProtos.FieldDescriptorProto.Type.TYPE_STRING; case DataType.BYTEARRAY: return DescriptorProtos.FieldDescriptorProto.Type.TYPE_BYTES; default: throw new IllegalArgumentException("Unexpected Pig type where a simple type is expected : " + pigTypeId); } }

Target:
private static Type pigTypeToProtoType(byte pigTypeId) { switch(pigTypeId) { case DataType.BOOLEAN: return Type.TYPE_BOOL; case DataType.INTEGER: return Type.TYPE_INT32; case DataType.LONG: return Type.TYPE_INT64; case DataType.FLOAT: return Type.TYPE_FLOAT; case DataType.DOUBLE: return Type.TYPE_DOUBLE; case DataType.CHARARRAY: return Type.TYPE_STRING; case DataType.BYTEARRAY: return Type.TYPE_BYTES; default: throw new IllegalArgumentException("Unsupported Pig type passed (" + pigTypeId + ") where a simple type is expected while converting Pig to a dynamic Protobuf"); } }
Source:
public TrieNodeImpl put(String path, EntryPoint e) { LOG.info("Entrie.put(" + path + ")"); if (path.startsWith("/")) path = path.substring(1); if (path.length() == 0) { return new TrieNodeImpl(children, Optional.of(e), pathMappings); } String[] elements = path.split("/"); TrieNode existing = children.getOrDefault(elements[0], TrieNodeImpl.empty()); TrieNode newChild = existing.put(path.substring(elements[0].length()), e); HashMap<String, TrieNode> newChildren = new HashMap<>(children); newChildren.put(elements[0], newChild); return new TrieNodeImpl(newChildren, value, pathMappings); }

Target:
public TrieNodeImpl put(String path, EntryPoint e) { LOG.info("Entrie.put(" + path + ")"); path = TrieNode.canonicalise(path); if (path.length() == 0) { return new TrieNodeImpl(children, Optional.of(e)); } String[] elements = path.split("/"); TrieNode existing = children.getOrDefault(elements[0], TrieNodeImpl.empty()); TrieNode newChild = existing.put(path.substring(elements[0].length()), e); HashMap<String, TrieNode> newChildren = new HashMap<>(children); newChildren.put(elements[0], newChild); return new TrieNodeImpl(newChildren, value); }
Source:
private void updatePartitionDataFromKafka() { List<PartitionInfo> partitions = consumer.partitionsFor(ioConfig.getTopic()); if (partitions == null) { log.warn("No such topic [%s] found", ioConfig.getTopic()); } int numPartitions = (partitions != null ? partitions.size() : 0); log.debug("Found [%d] Kafka partitions for topic [%s]", numPartitions, ioConfig.getTopic()); for (int partition = 0; partition < numPartitions; partition++) { int taskGroupId = getTaskGroupIdForPartition(partition); ConcurrentHashMap<Integer, Long> partitionMap = partitionGroups.computeIfAbsent( taskGroupId, k -> new ConcurrentHashMap<>() ); if (partitionMap.putIfAbsent(partition, NOT_SET) == null) { log.info( "New partition [%d] discovered for topic [%s], added to task group [%d]", partition, ioConfig.getTopic(), taskGroupId ); } } }

Target:
private void updatePartitionDataFromKafka() { List<PartitionInfo> partitions; try { synchronized (consumerLock) { partitions = consumer.partitionsFor(ioConfig.getTopic()); } } catch (Exception e) { log.warn( e, "Unable to get partition data from Kafka for brokers [%s], are the brokers up?", ioConfig.getConsumerProperties().get(KafkaSupervisorIOConfig.BOOTSTRAP_SERVERS_KEY) ); return; } int numPartitions = (partitions != null ? partitions.size() : 0); log.debug("Found [%d] Kafka partitions for topic [%s]", numPartitions, ioConfig.getTopic()); for (int partition = 0; partition < numPartitions; partition++) { int taskGroupId = getTaskGroupIdForPartition(partition); ConcurrentHashMap<Integer, Long> partitionMap = partitionGroups.computeIfAbsent( taskGroupId, k -> new ConcurrentHashMap<>() ); if (partitionMap.putIfAbsent(partition, NOT_SET) == null) { log.info( "New partition [%d] discovered for topic [%s], added to task group [%d]", partition, ioConfig.getTopic(), taskGroupId ); } } }
Source:
public void testGetFieldsSimpleBooleanJson() throws IOException { ObjectMapper mapper = new ObjectMapper(); JsonNode jsonNode = mapper.readTree(simpleBooleanJson); List<Schema.Field> fields = jsonSchemaInferrer.getFields(jsonNode); assertEquals(2, fields.size()); Schema.Field fieldA = fields.get(0); assertEquals("a", fieldA.name()); assertEquals("record", fieldA.schema().getType().getName()); List<Schema.Field> fieldATypeFields = fieldA.schema().getFields(); Schema.Field fieldB = fieldATypeFields.get(0); assertEquals("b", fieldB.name()); Schema.Type fieldBType = fieldB.schema().getType(); assertEquals("union", fieldBType.getName()); List<Schema> fieldSchemaBTypeItems = fieldB.schema().getTypes(); assertEquals("boolean", fieldSchemaBTypeItems.get(0).getName()); assertEquals("null", fieldSchemaBTypeItems.get(1).getName()); Schema.Field fieldD = fields.get(1); assertEquals("d", fieldD.name()); Schema.Type fieldDType = fieldD.schema().getType(); assertEquals("union", fieldDType.getName()); List<Schema> fieldSchemaDTypeItems = fieldD.schema().getTypes(); assertEquals("boolean", fieldSchemaDTypeItems.get(0).getName()); assertEquals("null", fieldSchemaDTypeItems.get(1).getName()); }

Target:
public void testGetFieldsSimpleBooleanJson() throws IOException { ObjectMapper mapper = new ObjectMapper(); JsonNode jsonNode = mapper.readTree(simpleBooleanJson); List<Schema.Field> fieldList = jsonSchemaInferrer.getFields(jsonNode); assertThat(fieldList, hasSize(2)); Schema.Field fieldA = fieldList.get(0); assertThat(fieldA.name(), is(equalTo("a"))); assertThat(fieldA.schema().getType().getName(), is(equalTo("record"))); List<Schema.Field> fieldATypeFields = fieldA.schema().getFields(); Schema.Field fieldB = fieldATypeFields.get(0); assertThat(fieldB.name(), is(equalTo("b"))); Schema.Type fieldBType = fieldB.schema().getType(); assertThat(fieldBType.getName(), is(equalTo("union"))); List<Schema> fieldSchemaBTypeItems = fieldB.schema().getTypes(); assertThat(fieldSchemaBTypeItems.get(0).getName(), is(equalTo("boolean"))); assertThat(fieldSchemaBTypeItems.get(1).getName(), is(equalTo("null"))); Schema.Field fieldD = fieldList.get(1); assertThat(fieldD.name(), is(equalTo("d"))); Schema.Type fieldDType = fieldD.schema().getType(); assertThat(fieldDType.getName(), is(equalTo("union"))); List<Schema> fieldSchemaDTypeItems = fieldD.schema().getTypes(); assertThat(fieldSchemaDTypeItems.get(0).getName(), is(equalTo("boolean"))); assertThat(fieldSchemaDTypeItems.get(1).getName(), is(equalTo("null"))); }
Source:
public boolean isAsync() { return false; }

Target:
public boolean isAsync() { return true; }
Source:
public void configure(ServerSideConfiguration config) throws ClusteredTierManagerConfigurationException { try { invokeInternal(messageFactory.configureStoreManager(config), true); } catch (ClusteredClientException e) { throw new ClusteredTierManagerConfigurationException("Error configuring clustered tier manager", e.getCause()); } }

Target:
public void configure(ServerSideConfiguration config) throws ClusteredTierManagerConfigurationException, TimeoutException { try { invokeInternal(timeouts.getLifecycleOperationTimeout(), messageFactory.configureStoreManager(config), true); } catch (ClusterException e) { throw new ClusteredTierManagerConfigurationException("Error configuring clustered tier manager", e); } }
Source:
public void close() { if (ROOT_LOGGER.isTraceEnabled()) { ROOT_LOGGER.tracef("stop second level cache by removing dependency on service '%s'", this.controller.getName().getCanonicalName()); } final UninterruptibleCountDownLatch latch = new UninterruptibleCountDownLatch(1); controller.addListener(new LifecycleListener() { @Override public void handleEvent(final ServiceController<?> controller, final LifecycleEvent event) { if (event == LifecycleEvent.REMOVED) latch.countDown(); } }); controller.setMode(ServiceController.Mode.REMOVE); latch.awaitUninterruptibly(); }

Target:
public void close() { if (ROOT_LOGGER.isTraceEnabled()) { ROOT_LOGGER.tracef("stop second level cache by removing dependency on service '%s'", this.controller.getName().getCanonicalName()); } final CountDownLatch latch = new CountDownLatch(1); controller.addListener(new LifecycleListener() { @Override public void handleEvent(final ServiceController<?> controller, final LifecycleEvent event) { if (event == LifecycleEvent.REMOVED) latch.countDown(); } }); controller.setMode(ServiceController.Mode.REMOVE); try { latch.await(); } catch (InterruptedException ie) { Thread.currentThread().interrupt(); } }
Source:
public Comment createComment(CoreSession session, Comment comment) throws CommentNotFoundException, CommentSecurityException { String parentId = comment.getParentId(); DocumentRef docRef = new IdRef(parentId); if (!CoreInstance.doPrivileged(session, s -> { return s.exists(docRef); })) { throw new CommentNotFoundException("The document or comment " + comment.getParentId() + " does not exist."); } DocumentRef ancestorRef = CoreInstance.doPrivileged(session, s -> { DocumentModel document = s.getDocument(new IdRef(parentId)); return getAncestorRef(s, document); }); if (!session.hasPermission(ancestorRef, SecurityConstants.READ)) { throw new CommentSecurityException("The user " + session.getPrincipal().getName() + " can not create comments on document " + parentId); } if (comment.getCreationDate() == null) { comment.setCreationDate(Instant.now()); } return CoreInstance.doPrivileged(session, s -> { DocumentModel documentToComment = s.getDocument(ancestorRef); DocumentModel commentModel = s.createDocumentModel(documentToComment.getPathAsString(), COMMENT_NAME, COMMENT_DOC_TYPE); Comments.commentToDocumentModel(comment, commentModel); if (comment instanceof ExternalEntity) { commentModel.addFacet(EXTERNAL_ENTITY_FACET); Comments.externalEntityToDocumentModel((ExternalEntity) comment, commentModel); } commentModel.setPropertyValue(COMMENT_ANCESTOR_IDS, (Serializable) computeAncestorIds(s, parentId)); commentModel = s.createDocument(commentModel); notifyEvent(s, CommentEvents.COMMENT_ADDED, s.getDocument(docRef), commentModel); return Comments.newComment(commentModel); }); }

Target:
public Comment createComment(CoreSession session, Comment comment) throws CommentNotFoundException, CommentSecurityException { String parentId = comment.getParentId(); DocumentRef docRef = new IdRef(parentId); if (!CoreInstance.doPrivileged(session, s -> {return s.exists(docRef);})) { throw new CommentNotFoundException("The document or comment " + comment.getParentId() + " does not exist."); } DocumentRef ancestorRef = CoreInstance.doPrivileged(session, s -> { return getAncestorRef(s, s.getDocument(new IdRef(parentId))); }); if (!session.hasPermission(ancestorRef, SecurityConstants.READ)) { throw new CommentSecurityException("The user " + session.getPrincipal().getName() + " can not create comments on document " + parentId); } if (comment.getCreationDate() == null) { comment.setCreationDate(Instant.now()); } return CoreInstance.doPrivileged(session, s -> { String path = getCommentContainerPath(s, parentId); DocumentModel commentModel = s.createDocumentModel(path, COMMENT_NAME, COMMENT_DOC_TYPE); Comments.commentToDocumentModel(comment, commentModel); if (comment instanceof ExternalEntity) { commentModel.addFacet(EXTERNAL_ENTITY_FACET); Comments.externalEntityToDocumentModel((ExternalEntity) comment, commentModel); } commentModel.setPropertyValue(COMMENT_ANCESTOR_IDS, (Serializable) computeAncestorIds(s, parentId)); commentModel = s.createDocument(commentModel); notifyEvent(s, CommentEvents.COMMENT_ADDED, s.getDocument(docRef), commentModel); return Comments.newComment(commentModel); }); }
Source:
private void verifyTicketAuth(KerberosContainer kdc) throws IOException, InterruptedException { String tokenCache = kdc.getClientTokenCache(); FirefoxDriver negotiatingDriver = getNegotiatingFirefox(kdc, tokenCache); Assert.assertThat(new Login(jenkins), loggedInAs("user")); negotiatingDriver.get(jenkins.url.toExternalForm()); negotiatingDriver.get(jenkins.url("/whoAmI").toExternalForm()); String out = negotiatingDriver.getPageSource(); assertThat(out, containsString(AUTHORIZED)); assertUnauthenticatedRequestIsRejected(getBadassHttpClient()); }

Target:
private void verifyTicketAuth(KerberosContainer kdc) throws IOException, InterruptedException { String tokenCache = kdc.getClientTokenCache(); FirefoxDriver negotiatingDriver = getNegotiatingFirefox(kdc, tokenCache); negotiatingDriver.get(jenkins.url.toExternalForm()); negotiatingDriver.get(jenkins.url("/whoAmI").toExternalForm()); String out = negotiatingDriver.getPageSource(); assertThat(out, containsString(AUTHORIZED)); assertUnauthenticatedRequestIsRejected(getBadassHttpClient()); }
Source:
public CommitCommand setCommitter(String name, String email) { this.committer = new PersonIdent(name, email); return this; }

Target:
public CommitCommand setCommitter(String name, String email) { return setCommitter(new PersonIdent(name, email)); }
Source:
public void fireFrameworkEvent(FrameworkEvent event) { log.debug("Firing FrameworkEvent on " + frameworkListeners.size() + " listeners"); Object[] listeners = frameworkListeners.getListeners(); for (Object listener : listeners) { log.debug("Start execution of " + listener.getClass() + " listener"); try { ((FrameworkListener) listener).frameworkEvent(event); log.debug("End execution of " + listener.getClass() + " listener"); } catch (RuntimeException e) { log.error("Error during Framework Listener execution : " + listener.getClass(), e); boolean strict = System.getProperty("nuxeo.start.strict") != null; if (strict) { throw e; } } } }

Target:
public void fireFrameworkEvent(FrameworkEvent event) { log.debug("Firing FrameworkEvent on " + frameworkListeners.size() + " listeners"); Object[] listeners = frameworkListeners.getListeners(); for (Object listener : listeners) { log.debug("Start execution of " + listener.getClass() + " listener"); try { ((FrameworkListener) listener).frameworkEvent(event); log.debug("End execution of " + listener.getClass() + " listener"); } catch (RuntimeException e) { log.error("Error during Framework Listener execution : " + listener.getClass(), e); if (Boolean.getBoolean("nuxeo.start.strict")) { throw e; } } } }
Source:
private void tryWithLock(int alarmId, String reductionKey, BiConsumer<Integer, String> callback, String action) { try { if (getLock().tryLock(LOCK_TIMEOUT_MS, TimeUnit.MILLISECONDS)) { try { callback.accept(alarmId, reductionKey); } finally { getLock().unlock(); } } else { LOG.warn("Failed to acquire Drools session lock within {}ms. " + "{} for alarm with id={} and reduction-key={} will not be immediately reflected in the context.", LOCK_TIMEOUT_MS, action, alarmId, reductionKey); } } catch (InterruptedException e) { LOG.warn("Interrupted while waiting for Drools session lock. " + "{} for alarm with id={} and reduction-key={} will not be immediately reflected in the context.", action, alarmId, reductionKey); } }

Target:
private void tryWithLock(int alarmId, String reductionKey, BiConsumer<Integer, String> callback, String action) { try { if (getLock().tryLock(LOCK_TIMEOUT_MS, TimeUnit.MILLISECONDS)) { try { callback.accept(alarmId, reductionKey); } finally { getLock().unlock(); } } else { LOG.warn("Failed to acquire Drools session lock within {}ms. " + "{} for alarm with id={} and reduction-key={} will not be immediately reflected in the context.", LOCK_TIMEOUT_MS, action, alarmId, reductionKey); } } catch (InterruptedException e) { LOG.warn("Interrupted while waiting for Drools session lock. " + "{} for alarm with id={} and reduction-key={} will not be immediately reflected in the context.", action, alarmId, reductionKey); Thread.currentThread().interrupt(); } }
Source:
public synchronized boolean isCancelled() { if (isCancelled) { sendCancelNotification(); } return isCancelled; }

Target:
public boolean isCancelled() { boolean cancelled = isCancelled.get(); if (cancelled) { sendCancelNotification(); } return cancelled; }
Source:
public void showPlayer(Player player) { Validate.notNull(player, "player cannot be null"); if (equals(player)) return; if (!player.isOnline() || !session.isActive()) return; if (!hiddenEntities.contains(player.getUniqueId())) return; hiddenEntities.remove(player.getUniqueId()); session.send(UserListItemMessage.addOne(((GlowPlayer) player).getProfile())); }

Target:
public void showPlayer(Player player) { Validate.notNull(player, "player cannot be null"); if (equals(player) || !player.isOnline() || !session.isActive()) return; if (!hiddenEntities.contains(player.getUniqueId())) return; hiddenEntities.remove(player.getUniqueId()); session.send(new UserListItemMessage(UserListItemMessage.Action.ADD_PLAYER, ((GlowPlayer) player).getUserListEntry())); }
Source:
public AbstractNetworkPopupView(EventBus eventBus) { super(eventBus); dataCenterEditor = new ListModelListBoxEditor<>(new NameRenderer<StoragePool>()); externalProviderEditor = new ListModelListBoxEditor<>(new NameRenderer<Provider>()); qosEditor = new ListModelListBoxEditor<>(new NameRenderer<HostNetworkQos>()); exportEditor = new EntityModelCheckBoxEditor(Align.RIGHT); exportEditor.asCheckBox().addValueChangeHandler(new ValueChangeHandler<Boolean>() { @Override public void onValueChange(ValueChangeEvent<Boolean> event) { refreshClustersTable(); } }); isVmNetworkEditor = new EntityModelCheckBoxEditor(Align.RIGHT); vlanTagging = new EntityModelCheckBoxEditor(Align.RIGHT); mtuEditor = new IntegerEntityModelTextBoxOnlyEditor(); mtuEditor.setUsePatternFly(true); createSubnetEditor = new EntityModelCheckBoxEditor(Align.RIGHT); this.clustersTable = new EntityModelCellTable<>(SelectionMode.NONE, true); this.shouldSetDnsConfigurationEditor = new EntityModelCheckBoxEditor(Align.RIGHT); initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); initEntityModelCellTable(); localize(); this.nameServerWidget.setUsePatternFly(true); }

Target:
public AbstractNetworkPopupView(EventBus eventBus) { super(eventBus); dataCenterEditor = new ListModelListBoxEditor<>(new NameRenderer<StoragePool>()); externalProviderEditor = new ListModelListBoxEditor<>(new NameRenderer<Provider>()); qosEditor = new ListModelListBoxEditor<>(new NameRenderer<HostNetworkQos>()); exportEditor = new EntityModelCheckBoxEditor(Align.RIGHT); exportEditor.asCheckBox().addValueChangeHandler(new ValueChangeHandler<Boolean>() { @Override public void onValueChange(ValueChangeEvent<Boolean> event) { refreshClustersTable(); } }); isVmNetworkEditor = new EntityModelCheckBoxEditor(Align.RIGHT); vlanTagging = new EntityModelCheckBoxEditor(Align.RIGHT); mtuEditor = new IntegerEntityModelTextBoxOnlyEditor(); mtuEditor.setUsePatternFly(true); createSubnetEditor = new EntityModelCheckBoxEditor(Align.RIGHT); this.clustersTable = new EntityModelCellTable<>(SelectionMode.NONE, true); shouldSetDnsConfigurationEditor = new EntityModelCheckBoxEditor(Align.RIGHT); initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); initEntityModelCellTable(); localize(); nameServersWidget.setUsePatternFly(true); }
Source:
FirstGetChunk() { super(-1, new CompositeBlobInfo.StoreKeyAndSizeAndOffset(blobId, 0L, -1L)); }

Target:
FirstGetChunk() { super(-1, new CompositeBlobInfo.ChunkMetadata(blobId, 0L, -1L)); }
Source:
public void setPosition(Vector2i position) { checkState(MapUtil.isInMapDecorationBounds(position.getX()), "x position out of bounds"); checkState(MapUtil.isInMapDecorationBounds(position.getY()), "y position out of bounds"); this.x = (byte) position.getX(); this.y = (byte) position.getY(); }

Target:
public void setPosition(Vector2i position) { Preconditions.checkState(MapUtil.isInMapDecorationBounds(position.getX()), "x position out of bounds"); Preconditions.checkState(MapUtil.isInMapDecorationBounds(position.getY()), "y position out of bounds"); this.x = (byte) position.getX(); this.y = (byte) position.getY(); }
Source:
public void checkHaddexDate(final I_C_OrderLine orderLine) { if (!orderDAO.getById(OrderId.ofRepoId(orderLine.getC_Order_ID())).isSOTrx()) { return; } final I_M_Product product = productDAO.getById(orderLine.getM_Product_ID()); if (product.isHaddexCheck() && product.getDateHaddexCheck() != null) { final long differenceBetweenNowAndPromisedDateInMonths = Math.abs( ChronoUnit.MONTHS.between( SystemTime.asZonedDateTime(), TimeUtil.asZonedDateTime(orderLine.getDatePromised()) )); if (differenceBetweenNowAndPromisedDateInMonths > getMaxHaddexAgeInMonths(orderLine.getAD_Client_ID(), orderLine.getAD_Org_ID())) { throw new AdempiereException(MSG_HADDEX_CHECK_ERROR).markAsUserValidationError(); } } }

Target:
public void checkHaddexDate(final I_C_OrderLine orderLine) { final I_C_Order order = orderDAO.getById(OrderId.ofRepoId(orderLine.getC_Order_ID())); if (!order.isSOTrx()) { return; } final I_M_Product product = productDAO.getById(orderLine.getM_Product_ID()); if (product.isHaddexCheck() && product.getDateHaddexCheck() != null) { final long differenceBetweenHaddexCheckDateAndPromisedDateInMonths = Math.abs( ChronoUnit.MONTHS.between( TimeUtil.asZonedDateTime(product.getDateHaddexCheck()), TimeUtil.asZonedDateTime(order.getDatePromised()) )); if (differenceBetweenHaddexCheckDateAndPromisedDateInMonths > getMaxHaddexAgeInMonths(orderLine.getAD_Client_ID(), orderLine.getAD_Org_ID())) { throw new AdempiereException(MSG_HADDEX_CHECK_ERROR).markAsUserValidationError(); } } }
Source:
public int hashCode() { return System.identityHashCode(HibernateUtils.unwrap(this)); }

Target:
public int hashCode() { return super.hashCode(); }
Source:
private ICPPConstructor getConstructor(IASTDeclaration decl) { if (decl instanceof ICPPASTFunctionDefinition) { ICPPASTFunctionDefinition functionDefinition = (ICPPASTFunctionDefinition) decl; if (functionDefinition.isDeleted()) return null; boolean isDefaulted = functionDefinition.isDefaulted(); IBinding binding = functionDefinition.getDeclarator().getName().resolveBinding(); if (binding instanceof ICPPConstructor) { ICPPConstructor constructor = (ICPPConstructor) binding; if (!(isDefaulted && (SemanticQueries.isMoveConstructor(constructor) || SemanticQueries.isCopyConstructor(constructor)))) { if (constructor.getClassOwner().getKey() != ICompositeType.k_union) { return constructor; } } } } return null; }

Target:
private ICPPConstructor getConstructor(IASTDeclaration decl) { if (decl instanceof ICPPASTFunctionDefinition) { ICPPASTFunctionDefinition functionDefinition = (ICPPASTFunctionDefinition) decl; if (functionDefinition.isDeleted()) return null; IBinding binding = functionDefinition.getDeclarator().getName().resolveBinding(); if (binding instanceof ICPPConstructor) { ICPPConstructor constructor = (ICPPConstructor) binding; boolean isDefaulted = functionDefinition.isDefaulted(); boolean isMoveConstructor = SemanticQueries.isMoveConstructor(constructor); boolean isCopyConstructor = SemanticQueries.isCopyConstructor(constructor); if (isDefaulted && (isMoveConstructor || isCopyConstructor)) return null; if (constructor.getClassOwner().getKey() == ICompositeType.k_union) return null; return constructor; } } return null; }
Source:
public boolean tryLock(long time, TimeUnit unit) throws InterruptedException { Lock localLock = RedisLockRegistry.this.localRegistry.obtain(lockKey); if (!localLock.tryLock(time, unit)) { return false; } try { long expire = System.currentTimeMillis() + TimeUnit.MILLISECONDS.convert(time, unit); boolean acquired = false; while (!(acquired = this.obtainLock()) && System.currentTimeMillis() < expire) { Thread.sleep(100); } if (!acquired) { localLock.unlock(); if (this.reLock <= 0) { removeThreadLocal(); } } return acquired; } catch (Exception e) { localLock.unlock(); throw new RuntimeException(e); } }

Target:
public boolean tryLock(long time, TimeUnit unit) throws InterruptedException { Lock localLock = RedisLockRegistry.this.localRegistry.obtain(lockKey); if (!localLock.tryLock(time, unit)) { return false; } try { long expire = System.currentTimeMillis() + TimeUnit.MILLISECONDS.convert(time, unit); boolean acquired = false; while (!(acquired = this.obtainLock()) && System.currentTimeMillis() < expire) { Thread.sleep(100); } if (!acquired) { localLock.unlock(); } return acquired; } catch (Exception e) { localLock.unlock(); throw new RuntimeException(e); } }
Source:
public void testPutAlmostTooBigValueTenTimes() throws IOException { ExecutorService es = Executors.newCachedThreadPool(); try { for (int i = 0; i < 10; i++) { es.submit(new Callable<Void>() { public Void call() throws Exception { testPutGetDeleteExists(10 << 20, true, true); return null; }; }); } } finally { es.shutdown(); while (!es.isTerminated()) { try { es.awaitTermination(1, TimeUnit.SECONDS); } catch (InterruptedException e) { break; } } } }

Target:
public void testPutAlmostTooBigValueTenTimes() throws IOException { ExecutorService es = Executors.newCachedThreadPool(); try { for (int i = 0; i < 10; i++) { es.submit(new Callable<Void>() { public Void call() throws Exception { testPutGetDeleteExists(10 << 20, true, true); return null; }; }); } } finally { es.shutdown(); try { es.awaitTermination(1, TimeUnit.MINUTES); } catch (InterruptedException e) { } } }
Source:
@Override public Void deserialize(String topic, byte[] data) { if (data != null) throw new IllegalArgumentException("Data should be null for a VoidDeserializer."); return null; }

Target:
public Void deserialize(String topic, byte[] data) { if (data != null) throw new IllegalArgumentException("Data should be null for a VoidDeserializer."); return null; }
Source:
void convertsStringToClass() { assertConverts("java.lang.Integer", Class.class, Integer.class); }

Target:
void convertsStringToClass() { assertConverts("java.lang.Integer", Class.class, Integer.class); assertConverts("java.lang.Thread$State", Class.class, State.class); }
Source:
public static boolean isTarFile(String fileName) { assertNotNull(fileName); if (fileName.trim().length() == 0) { return false; } TarFile tarFile = null; try { tarFile = new TarFile(fileName.trim()); } catch (TarException tarException) { return false; } catch (IOException ioException) { return false; } finally { if (tarFile != null) { try { tarFile.close(); } catch (IOException e) { } } } return true; }

Target:
public static boolean isTarFile(String fileName) { if (fileName == null || fileName.trim().length() == 0) { return false; } TarFile tarFile = null; try { tarFile = new TarFile(fileName.trim()); } catch (TarException tarException) { return false; } catch (IOException ioException) { return false; } finally { if (tarFile != null) { try { tarFile.close(); } catch (IOException e) { } } } return true; }
Source:
public static int getGlobalConnectionCount() { return DefaultRawMemcacheClient.GLOBAL_CONNECTION_COUNT.get(); }

Target:
public static int getGlobalConnectionCount() { return DefaultRawMemcacheClient.getGlobalConnectionCount(); }
Source:
private void testPublishUnpublishActions() { ______TS("publish action: OPEN feedback session"); homePage.clickAndCancel(homePage.getPublishLink(feedbackSessionOpen.getCourseId(), feedbackSessionOpen.getFeedbackSessionName())); ______TS("publish action: CLOSED feedback session"); homePage.clickAndCancel(homePage.getPublishLink(feedbackSessionClosed.getCourseId(), feedbackSessionClosed.getFeedbackSessionName())); ______TS("unpublish action: PUBLISHED feedback session"); homePage.clickFeedbackSessionUnpublishLink(feedbackSessionPublished.getCourseId(), feedbackSessionPublished.getFeedbackSessionName()); homePage.waitForPageToLoad(); homePage.verifyStatus(Const.StatusMessages.FEEDBACK_SESSION_UNPUBLISHED); assertFalse(BackDoor.getFeedbackSession(feedbackSessionPublished.getCourseId(), feedbackSessionPublished.getFeedbackSessionName()).isPublished()); ______TS("publish action: PUBLISHED feedback session"); homePage.clickFeedbackSessionPublishLink(feedbackSessionPublished.getCourseId(), feedbackSessionPublished.getFeedbackSessionName()); homePage.waitForPageToLoad(); homePage.verifyStatus(Const.StatusMessages.FEEDBACK_SESSION_PUBLISHED); assertTrue(BackDoor.getFeedbackSession(feedbackSessionPublished.getCourseId(), feedbackSessionPublished.getFeedbackSessionName()).isPublished()); }

Target:
private void testPublishUnpublishActions() { ______TS("publish action: AWAITING feedback session"); homePage.verifyUnclickable(homePage.getSessionResultsOptionsCaretElement(feedbackSessionAwaiting.getCourseId(), feedbackSessionAwaiting.getFeedbackSessionName())); ______TS("publish action: OPEN feedback session"); homePage.clickAndCancel(homePage.getPublishLink(feedbackSessionOpen.getCourseId(), feedbackSessionOpen.getFeedbackSessionName())); ______TS("publish action: CLOSED feedback session"); homePage.clickAndCancel(homePage.getPublishLink(feedbackSessionClosed.getCourseId(), feedbackSessionClosed.getFeedbackSessionName())); ______TS("unpublish action: PUBLISHED feedback session"); homePage.clickFeedbackSessionUnpublishLink(feedbackSessionPublished.getCourseId(), feedbackSessionPublished.getFeedbackSessionName()); homePage.waitForPageToLoad(); homePage.verifyStatus(Const.StatusMessages.FEEDBACK_SESSION_UNPUBLISHED); assertFalse(BackDoor.getFeedbackSession(feedbackSessionPublished.getCourseId(), feedbackSessionPublished.getFeedbackSessionName()).isPublished()); ______TS("publish action: PUBLISHED feedback session"); homePage.clickFeedbackSessionPublishLink(feedbackSessionPublished.getCourseId(), feedbackSessionPublished.getFeedbackSessionName()); homePage.waitForPageToLoad(); homePage.verifyStatus(Const.StatusMessages.FEEDBACK_SESSION_PUBLISHED); assertTrue(BackDoor.getFeedbackSession(feedbackSessionPublished.getCourseId(), feedbackSessionPublished.getFeedbackSessionName()).isPublished()); }
Source:
public TaskAttempt(Long delay, TimeUnit timeUnit) { if (delay == null || delay < 0) { throw new IllegalArgumentException(String.format("Argument for delay parameter = %d, must be zero or any positive integer", delay)); } if (timeUnit == null) { throw new IllegalArgumentException("Argument for timeUnit parameter is null"); } this.delay = delay; this.timeOut = 0L; this.timeUnit = TimeUnit.SECONDS; }

Target:
public TaskAttempt(Long delay, TimeUnit timeUnit) { if (delay == null || delay < 0) { throw new IllegalArgumentException(String.format("Argument for delay parameter = %d, must be zero or any positive integer", delay)); } if (timeUnit == null) { throw new IllegalArgumentException("Argument for timeUnit parameter is null"); } this.delay = delay; this.timeOut = 0L; this.timeUnit = timeUnit; }