auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testInt3139JsonPathFilter() { this.filterInput1.send(testMessage); Message<?> receive = this.output.receive(1000); assertNotNull(receive); assertEquals(JSON, receive.getPayload()); this.filterInput2.send(testMessage); receive = this.output.receive(1000); assertNotNull(receive); Message<String> message = MessageBuilder.withPayload(JSON) .setHeader("price", 10) .build(); this.filterInput3.send(message); receive = this.output.receive(1000); assertNotNull(receive); this.filterInput4.send(testMessage); receive = this.output.receive(1000); assertNotNull(receive); }

Target:
public void testInt3139JsonPathFilter() { this.filterInput1.send(testMessage); Message<?> receive = this.output.receive(1000); assertNotNull(receive); assertEquals(JSON, receive.getPayload()); this.filterInput2.send(testMessage); receive = this.output.receive(1000); assertNotNull(receive); Message<String> message = MessageBuilder.withPayload(JSON) .setHeader("price", 10) .build(); this.filterInput3.send(message); receive = this.output.receive(1000); assertNotNull(receive); this.filterInput4.send(testMessage); receive = this.output.receive(1000); assertNotNull(receive); try { this.filterInput1.send(new GenericMessage<String>("{foo:{}}")); fail("MessageRejectedException is expected."); } catch (Exception e) { assertThat(e, Matchers.instanceOf(MessageRejectedException.class)); } receive = this.output.receive(0); assertNull(receive); receive = this.discardChannel.receive(1000); assertNotNull(receive); }
Source:
public void write(Image entity, FieldWriter writer, OutputContext ctxt) throws IOException { writer.writeField("uri", entity.getCanonicalUri()); writer.writeField("mime_type", entity.getMimeType()); Image.Type type = entity.getType(); writer.writeField("type", (type != null || type != Image.Type.GENERIC) ? entity.getType().getName() : null); Image.Color color = entity.getColor(); writer.writeField("color", color != null ? entity.getColor().getName() : null); Image.Theme theme = entity.getTheme(); writer.writeField("theme", theme != null ? entity.getTheme().getName() : null); Image.AspectRatio aspectRatio = entity.getAspectRatio(); writer.writeField("aspect_ratio", aspectRatio != null ? entity.getAspectRatio().getName() : null); writer.writeField("availability_start", entity.getAvailabilityStart()); writer.writeField("availability_end", entity.getAvailabilityEnd()); writer.writeField("width", entity.getWidth()); writer.writeField("height", entity.getHeight()); writer.writeField("hasTitleArt", entity.hasTitleArt()); writer.writeObject(sourceWriter, entity.getSource(), ctxt); }

Target:
public void write(Image entity, FieldWriter writer, OutputContext ctxt) throws IOException { writer.writeField("uri", entity.getCanonicalUri()); writer.writeField("mime_type", entity.getMimeType()); Image.Type type = entity.getType(); writer.writeField("type", type != null ? entity.getType().getName() : null); Image.Color color = entity.getColor(); writer.writeField("color", color != null ? entity.getColor().getName() : null); Image.Theme theme = entity.getTheme(); writer.writeField("theme", theme != null ? entity.getTheme().getName() : null); Image.AspectRatio aspectRatio = entity.getAspectRatio(); writer.writeField("aspect_ratio", aspectRatio != null ? entity.getAspectRatio().getName() : null); writer.writeField("availability_start", entity.getAvailabilityStart()); writer.writeField("availability_end", entity.getAvailabilityEnd()); writer.writeField("width", entity.getWidth()); writer.writeField("height", entity.getHeight()); writer.writeField("hasTitleArt", entity.hasTitleArt()); writer.writeObject(sourceWriter, entity.getSource(), ctxt); }
Source:
public static boolean check(String blob, String password) throws IOException, GeneralSecurityException { final Map<String, String> map; try { map = getEncryptionMap(blob); } catch (JsonParseException e) { LOG.warn("Invalid format of previous password. Cannot check equality of previous and new password."); return false; } if (!ARTIFACT.equals(map.get(ARTIFACT_KEY))) { throw new IllegalArgumentException(String.format("Invalid artifact '%s'", map.get(ARTIFACT_KEY))); } if (!VERSION.equals(map.get(VERSION_KEY))) { throw new IllegalArgumentException(String.format("Invalid version '%s'", map.get(VERSION_KEY))); } byte[] salt = Base64.decodeBase64(map.get(SALT_KEY)); return Arrays.equals( Base64.decodeBase64(map.get(SECRET_KEY)), SecretKeyFactory.getInstance(map.get(ALGORITHM_KEY)).generateSecret( new PBEKeySpec( password.toCharArray(), salt, Integer.parseInt(map.get(ITERATIONS_KEY)), salt.length * 8 ) ).getEncoded() ); }

Target:
public static boolean check(String blob, String password) throws IOException, GeneralSecurityException { final Map<String, String> map = getEncryptionMap(blob); if (map.isEmpty()) { LOG.warn("Invalid format of previous password. Cannot check equality of previous and new password."); return false; } if (!ARTIFACT.equals(map.get(ARTIFACT_KEY))) { throw new IllegalArgumentException(String.format("Invalid artifact '%s'", map.get(ARTIFACT_KEY))); } if (!VERSION.equals(map.get(VERSION_KEY))) { throw new IllegalArgumentException(String.format("Invalid version '%s'", map.get(VERSION_KEY))); } byte[] salt = Base64.decodeBase64(map.get(SALT_KEY)); return Arrays.equals( Base64.decodeBase64(map.get(SECRET_KEY)), SecretKeyFactory.getInstance(map.get(ALGORITHM_KEY)).generateSecret( new PBEKeySpec( password.toCharArray(), salt, Integer.parseInt(map.get(ITERATIONS_KEY)), salt.length * 8 ) ).getEncoded() ); }
Source:
public void close(String namespace) { final byte[] pattern = redisKey(prefix, hash(namespace), "*"); try (final Jedis client = pool.getResource()) { final Set<byte[]> keys = client.keys(pattern); if (keys.size() == 0) { return; } client.del(keys.toArray(new byte[keys.size()][])); } catch (JedisConnectionException ex) { Throwables.propagate(ex); } catch (JedisException ex) { log.warn(ex, "Error cleaning cache items"); } }

Target:
public void close(String namespace) { try (ResourceHolder<ShardedJedis> clientHolder = supplier.get()) { final ShardedJedis jedis = clientHolder.get(); final byte[] setKey = CacheImplUtils.computeNamespaceHash(prefix, namespace).getBytes(); final Set<byte[]> keys = jedis.smembers(setKey); if (keys.size() == 0) { return; } keys.add(setKey); for (byte[] key : keys) { final String itemKey = CacheImplUtils.computeKeyHash(prefix, namespace, key); jedis.del(itemKey); } } catch (JedisConnectionException | IOException ex) { Throwables.propagate(ex); } catch (JedisException ex) { log.warn(ex, "Error cleaning cache items"); } }
Source:
public void areUniqueAndOrderedLong() { final int iterations = 1000; CorfuRuntime r = getDefaultRuntime(); OrderedGUIDGenerator guidGenerator = r.getGuidGenerator(); long lastValue = 0; HashSet<Long> uniq = new HashSet<>(iterations); for (int i = 0; i < iterations; i++) { long current = guidGenerator.nextLong(); assertThat(current).isGreaterThan(lastValue); lastValue = current; assertThat(uniq).doesNotContain(current); uniq.add(current); } }

Target:
public void areUniqueAndOrderedLong() { final int iterations = 1000; CorfuRuntime r = getDefaultRuntime(); OrderedGuidGenerator guidGenerator = r.getGuidGenerator(); long lastValue = 0; HashSet<Long> uniq = new HashSet<>(iterations); for (int i = 0; i < iterations; i++) { long current = guidGenerator.nextLong(); assertThat(current).isGreaterThan(lastValue); lastValue = current; assertThat(uniq).doesNotContain(current); uniq.add(current); } }
Source:
static String chomp(String line) { if (line.charAt(line.length() - 1) == '\n') { return line.substring(0, line.length() - 1); } return line; }

Target:
static String chomp(String line) { if (line != null && !line.isEmpty() && line.charAt(line.length() - 1) == '\n') { return line.substring(0, line.length() - 1); } return line; }
Source:
public void start() { LOG.info("Starting Replication Monitor Thread."); running = true; replicationMonitor.start(); }

Target:
public synchronized void start() { if (!running) { LOG.info("Starting Replication Monitor Thread."); running = true; replicationMonitor.start(); } else { LOG.info("Replication Monitor Thread is already running."); } }
Source:
public int compareTo(UInt128 other) { if (this.equals(other)) { return 0; } if ((this.high < this.high) || ((this.high == other.high) && (this.low < other.low))) { return -1; } return 1; }

Target:
public int compareTo(UInt128 other) { if (this.equals(other)) { return 0; } if ((this.high < other.high) || ((this.high == other.high) && (this.low < other.low))) { return -1; } return 1; }
Source:
public default void bulkDelete(Collection<T> objects) throws IOException { List<T> managedObjects = new ArrayList<>(); for (T object : objects) { managedObjects.add(get(object.getId())); } for (T object : managedObjects) { authorizeDeletion(object); } ValidationResult result = new ValidationResult(); for (T object : managedObjects) { result.merge(validateDeletion(object)); } result.throwIfInvalid(); for (T object : managedObjects) { beforeDelete(object); try { try { getDeletionStore().delete(object, getAuthorizationManager().getCurrentUser()); } catch (DataIntegrityViolationException e) { if (e.getCause() != null && e.getCause() instanceof ConstraintViolationException) { throw (ConstraintViolationException) e.getCause(); } } } catch (ConstraintViolationException e) { throw new ValidationException(String.format("%s %s cannot be deleted because it is connected to other items", object.getDeleteType(), object.getDeleteDescription())); } afterDelete(object); } }

Target:
public default void bulkDelete(Collection<T> objects) throws IOException { List<T> managedObjects = new ArrayList<>(); for (T object : objects) { managedObjects.add(get(object.getId())); } for (T object : managedObjects) { authorizeDeletion(object); } ValidationResult result = new ValidationResult(); for (T object : managedObjects) { result.merge(validateDeletion(object)); } result.throwIfInvalid(); for (T object : managedObjects) { beforeDelete(object); try { getDeletionStore().delete(object, getAuthorizationManager().getCurrentUser()); } catch (ConstraintViolationException | DataIntegrityViolationException e) { if (e instanceof ConstraintViolationException || e.getCause() instanceof ConstraintViolationException) { if (!(object instanceof User)) { LoggerFactory.getLogger(DeleterService.class).error("Unhandled foreign key failure on delete", e); } throw new ValidationException(String.format("%s %s cannot be deleted because it is connected to other items", object.getDeleteType(), object.getDeleteDescription())); } else { throw e; } } afterDelete(object); } }
Source:
public String getCategory() { return "MAINTENANCE"; }

Target:
public String getCategory() { return JobCategory.CATEGORY_MISC; }
Source:
public void bulkUpsert(List<Entry> entries) { entries.forEach(this::eagerLoadEntry); entries = filterCheckerWorkflows(entries); List<Entry> workflows = entries.stream().filter(entry -> (entry instanceof BioWorkflow)).collect(Collectors.toList()); List<Entry> tools = entries.stream().filter(entry -> (entry instanceof Tool)).collect(Collectors.toList()); if (entries.isEmpty()) { return; } try (RestClient restClient = RestClient.builder(new HttpHost(hostname, port, "http")).build()) { String toolsNewlineDJSON = getNDJSON(tools); HttpEntity toolsBulkEntity = new NStringEntity(toolsNewlineDJSON, ContentType.APPLICATION_JSON); Response post = restClient.performRequest("POST", "/tools/_doc/_bulk", Collections.emptyMap(), toolsBulkEntity); if (post.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { throw new CustomWebApplicationException("Could not submit tools index to elastic search", HttpStatus.SC_INTERNAL_SERVER_ERROR); } } catch (IOException e) { LOGGER.error("Could not submit tools index to elastic search. " + e.getMessage()); } try (RestClient restClient = RestClient.builder(new HttpHost(hostname, port, "http")).build()) { String workflowsNewlineDJSON = getNDJSON(workflows); HttpEntity workflowsBulkEntity = new NStringEntity(workflowsNewlineDJSON, ContentType.APPLICATION_JSON); Response post = restClient.performRequest("POST", "/workflows/_doc/_bulk", Collections.emptyMap(), workflowsBulkEntity); if (post.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { throw new CustomWebApplicationException("Could not submit workflows index to elastic search", HttpStatus.SC_INTERNAL_SERVER_ERROR); } } catch (IOException e) { LOGGER.error("Could not submit workflows index to elastic search. " + e.getMessage()); } }

Target:
public void bulkUpsert(List<Entry> entries) { entries.forEach(this::eagerLoadEntry); entries = filterCheckerWorkflows(entries); if (entries.isEmpty()) { return; } List<Entry> workflowsEntryList = entries.stream().filter(entry -> (entry instanceof BioWorkflow)).collect(Collectors.toList()); List<Entry> toolsEntryList = entries.stream().filter(entry -> (entry instanceof Tool)).collect(Collectors.toList()); if (!workflowsEntryList.isEmpty()) { postBulkUpdate("workflows", workflowsEntryList); } if (!toolsEntryList.isEmpty()) { postBulkUpdate("tools", toolsEntryList); } }
Source:
public void test_scanAndRegister() { MetricsRegistryImpl mr = new MetricsRegistryImpl(Logger.getLogger(MetricsRegistryImpl.class), ProbeLevel.INFO); mr.newProbeBuilder() .withTag("tag1", "value1") .scanAndRegister(this); assertEquals(new HashSet<String>(asList( "[tag1=value1,unit=count,metric=probe1]", "[tag1=value1,unit=bytes,metric=secondProbe]" )), mr.getNames()); }

Target:
public void test_scanAndRegister() { MetricsRegistryImpl registry = new MetricsRegistryImpl(Logger.getLogger(MetricsRegistryImpl.class), ProbeLevel.INFO); registry.newProbeBuilder() .withTag("tag1", "value1") .scanAndRegister(this); assertProbes(registry); }
Source:
public Allergy getByUniqueId(String uuid) { try { int allergyId = Integer.parseInt(uuid); return Context.getPatientService().getAllergy(allergyId); } catch (NumberFormatException ex) { throw new ObjectNotFoundException(); } }

Target:
public Allergy getByUniqueId(String uuid) { return Context.getPatientService().getAllergyByUuid(uuid); }
Source:
protected synchronized void upgradeAccMgr() { String installedVersion = getInstalledAccMgrVersion(); if (installedVersion.equals(SalesforceSDKManager.SDK_VERSION)) { return; } writeCurVersion(ACC_MGR_KEY, SalesforceSDKManager.SDK_VERSION); if (TextUtils.isEmpty(installedVersion)) { installedVersion = getInstalledAccMgrVersion(); } try { final String majorVersionNum = installedVersion.substring(0, 3); double installedVerDouble = Double.parseDouble(majorVersionNum); if (installedVerDouble < 2.2) { upgradeTo2Dot2(); } } catch (NumberFormatException e) { SalesforceLogger.getLogger(SalesforceSDKManager.SF_SDK_COMPONENT_NAME, SalesforceSDKManager.getInstance().getAppContext()).log(SalesforceLogger.Level.ERROR, TAG, "Failed to parse installed version", e); } }

Target:
protected synchronized void upgradeAccMgr() { String installedVersion = getInstalledAccMgrVersion(); if (installedVersion.equals(SalesforceSDKManager.SDK_VERSION)) { return; } writeCurVersion(ACC_MGR_KEY, SalesforceSDKManager.SDK_VERSION); if (TextUtils.isEmpty(installedVersion)) { installedVersion = getInstalledAccMgrVersion(); } try { final String majorVersionNum = installedVersion.substring(0, 3); double installedVerDouble = Double.parseDouble(majorVersionNum); if (installedVerDouble < 2.2) { upgradeTo2Dot2(); } } catch (NumberFormatException e) { SalesforceSDKLogger.e(TAG, "Failed to parse installed version", e); } }
Source:
public void write(T entity, FieldWriter writer, OutputContext ctxt) throws IOException { writer.writeObject(publisherWriter, entity.getSource(), ctxt); if (entity instanceof Tag) { Tag tag = (Tag) entity; writer.writeField("namespace", tag.getNamespace()); writer.writeField("value", tag.getValue()); writer.writeField("topic_type", tag.getType()); } writer.writeField("title", entity.getTitle()); writer.writeField("description", entity.getDescription()); writer.writeField("image", entity.getImage()); writer.writeField("thumbnail", entity.getThumbnail()); }

Target:
public void write(T entity, FieldWriter writer, OutputContext ctxt) throws IOException { writer.writeObject(publisherWriter, entity.getSource(), ctxt); if (entity instanceof Topic) { Topic topic = (Topic) entity; writer.writeField("namespace", topic.getNamespace()); writer.writeField("value", topic.getValue()); writer.writeField("topic_type", topic.getType()); } writer.writeField("title", entity.getTitle()); writer.writeField("description", entity.getDescription()); writer.writeField("image", entity.getImage()); writer.writeField("thumbnail", entity.getThumbnail()); }
Source:
public void testCircuitBreakerBreak() throws Exception { String model1 = "test-circuit-break-model-1"; String model2 = "test-circuit-break-model-2"; String model3 = "test-circuit-break-model-3"; withTrainedModel(model1, 5L); withTrainedModel(model2, 5L); withTrainedModel(model3, 12L); CircuitBreaker circuitBreaker = new CustomCircuitBreaker(11); ModelLoadingService modelLoadingService = new ModelLoadingService(trainedModelProvider, auditor, threadPool, clusterService, trainedModelStatsService, Settings.EMPTY, "test-node", circuitBreaker); ModelLoadedTracker loadedTracker = new ModelLoadedTracker(Arrays.asList(model1, model2)); for (String modelId : Arrays.asList(model1, model2)) { modelLoadingService.addModelLoadedListener(modelId, loadedTracker.actionListener()); } modelLoadingService.addModelLoadedListener(model3, ActionListener.wrap( r -> fail("Should not have succeeded to load model as breaker should be reached"), e -> assertThat(e, instanceOf(CircuitBreakingException.class)) )); modelLoadingService.clusterChanged(ingestChangedEvent(model1, model2, model3)); assertBusy(() -> { verify(trainedModelProvider, times(1)).getTrainedModel(eq(model1), eq(false), any()); verify(trainedModelProvider, times(1)).getTrainedModel(eq(model2), eq(false), any()); verify(trainedModelProvider, times(1)).getTrainedModel(eq(model3), eq(false), any()); }); assertBusy(() -> { assertThat(circuitBreaker.getUsed(), equalTo(10L)); assertThat(circuitBreaker.getTrippedCount(), equalTo(1L)); }); modelLoadingService.clusterChanged(ingestChangedEvent(model1)); assertBusy(() -> { assertThat(circuitBreaker.getUsed(), equalTo(5L)); }); }

Target:
public void testCircuitBreakerBreak() throws Exception { String model1 = "test-circuit-break-model-1"; String model2 = "test-circuit-break-model-2"; String model3 = "test-circuit-break-model-3"; withTrainedModel(model1, 5L); withTrainedModel(model2, 5L); withTrainedModel(model3, 12L); CircuitBreaker circuitBreaker = new CustomCircuitBreaker(11); ModelLoadingService modelLoadingService = new ModelLoadingService(trainedModelProvider, auditor, threadPool, clusterService, trainedModelStatsService, Settings.EMPTY, "test-node", circuitBreaker); modelLoadingService.addModelLoadedListener(model3, ActionListener.wrap( r -> fail("Should not have succeeded to load model as breaker should be reached"), e -> assertThat(e, instanceOf(CircuitBreakingException.class)) )); modelLoadingService.clusterChanged(ingestChangedEvent(model1, model2, model3)); assertBusy(() -> { verify(trainedModelProvider, times(1)).getTrainedModel(eq(model1), eq(false), any()); verify(trainedModelProvider, times(1)).getTrainedModel(eq(model2), eq(false), any()); verify(trainedModelProvider, times(1)).getTrainedModel(eq(model3), eq(false), any()); }); assertBusy(() -> { assertThat(circuitBreaker.getUsed(), equalTo(10L)); assertThat(circuitBreaker.getTrippedCount(), equalTo(1L)); }); modelLoadingService.clusterChanged(ingestChangedEvent(model1)); assertBusy(() -> { assertThat(circuitBreaker.getUsed(), equalTo(5L)); }); }
Source:
public IndentLevel getSuggestedChildIndent(AbstractExpressionHandler child) { if (child instanceof CatchHandler || child instanceof FinallyHandler) { return getIndent(); } final DetailAST resSpecAst = getMainAst().getFirstChild(); if (resSpecAst.getType() == TokenTypes.RESOURCE_SPECIFICATION) { final DetailAST resourcesAst = resSpecAst.findFirstToken(TokenTypes.RESOURCES); final IndentLevel expIndent = new IndentLevel(getIndent(), getBasicOffset()); DetailAST resourcesAstChild = resourcesAst.findFirstToken(TokenTypes.RESOURCE); for (int i = 0; i < resourcesAst.getChildCount(); i++) { if (resourcesAstChild.getType() == TokenTypes.RESOURCE && resourcesAstChild.getLineNo() != resSpecAst.getLineNo() && resourcesAstChild.getColumnNo() != Integer.parseInt(expIndent.toString())) { logError(resourcesAstChild, "", resourcesAstChild.getColumnNo(), expIndent); } resourcesAstChild = resourcesAstChild.getNextSibling(); } } return super.getSuggestedChildIndent(child); }

Target:
public IndentLevel getSuggestedChildIndent(AbstractExpressionHandler child) { if (child instanceof CatchHandler || child instanceof FinallyHandler) { return getIndent(); } return super.getSuggestedChildIndent(child); }
Source:
private String pid() { try { List<String> cmd = new ArrayList<>(); cmd.add("sh"); cmd.add("-c"); cmd.add("ps ax | grep \"" + id + "\""); final Process process = new ProcessBuilder(cmd).start(); BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); String line; while ((line = reader.readLine()) != null) { final Matcher matcher = PS.matcher(line); if (matcher.find()) { return matcher.group(1); } } process.waitFor(); } catch (Exception e) { e.printStackTrace(out); } return null; }

Target:
private String pid() { try { final Process process = new ProcessBuilder(Arrays.asList("sh", "-c", "ps ax | grep \"" + id + "\"")).start(); BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); String line; while ((line = reader.readLine()) != null) { final Matcher matcher = PS.matcher(line); if (matcher.find()) { return matcher.group(1); } } process.waitFor(); reader.close(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); e.printStackTrace(out); } catch (Exception e) { e.printStackTrace(out); } return null; }
Source:
private VdcBllMessages vNicProfileInUseValidationMessage(int numberOfEntities) { boolean singular = numberOfEntities == 1; return singular ? VdcBllMessages.ACTION_TYPE_FAILED_VNIC_PROFILE_IN_ONE_USE : VdcBllMessages.ACTION_TYPE_FAILED_VNIC_PROFILE_IN_MANY_USES; }

Target:
private VdcBllMessages vNicProfileInUseValidationMessage(int numberOfEntities) { boolean singular = numberOfEntities == 1; if (singular) { return VdcBllMessages.ACTION_TYPE_FAILED_VNIC_PROFILE_IN_ONE_USE; } else { return VdcBllMessages.ACTION_TYPE_FAILED_VNIC_PROFILE_IN_MANY_USES; } }
Source:
public void handle(Encounter object, User creator, Date dateCreated, String other) { for (Obs obs : object.getAllObs()) { try { if (obs.getConcept().getDatatype() != null && obs.getConcept().getDatatype().isComplex()) { String handlerString = Context.getConceptService().getConceptComplex(obs.getConcept().getConceptId()) .getHandler(); Context.getObsService().getHandler(handlerString).saveObs(obs); } } catch (Exception e) { log.error("Unable to save complex obs", e); } } }

Target:
public void handle(Encounter object, User creator, Date dateCreated, String other) { for (Obs obs : object.getAllObs()) { try { if (obs.getConcept().getDatatype().isComplex()) { String handlerString = Context.getConceptService().getConceptComplex(obs.getConcept().getConceptId()) .getHandler(); Context.getObsService().getHandler(handlerString).saveObs(obs); } } catch (Exception e) { log.error("Unable to save complex obs", e); } } }
Source:
protected void processModulesAndArgs() { super.processModulesAndArgs(); if ( contains(argLoader) ) { String loadername = getValue(argLoader).toLowerCase(); if ( loadername.matches("basic.*") ) loader = LoaderEnum.Basic; else if ( loadername.matches("phas.*") ) loader = LoaderEnum.Phased; else if ( loadername.matches("seq.*") ) loader = LoaderEnum.Sequential; else if ( loadername.matches("para.*") ) loader = LoaderEnum.Parallel; else if ( loadername.matches("para.*") ) loader = LoaderEnum.Parallel; else if ( loadername.matches("light") ) loader = LoaderEnum.Light; else throw new CmdException("Unrecognized value for --loader: "+loadername); } if ( super.contains(argStats) ) { if ( ! hasValueOfTrue(argStats) && ! hasValueOfFalse(argStats) ) throw new CmdException("Not a boolean value: "+getValue(argStats)); generateStats = super.hasValueOfTrue(argStats); } if ( super.contains(argSyntax) ) { String syntax = super.getValue(argSyntax) ; Lang lang$ = RDFLanguages.nameToLang(syntax) ; if ( lang$ == null ) throw new CmdException("Can not detemine the syntax from '" + syntax + "'") ; this.lang = lang$ ; } if ( super.graphName != null ) lang = Lang.NTRIPLES; }

Target:
protected void processModulesAndArgs() { super.processModulesAndArgs(); if ( contains(argLoader) ) { String loadername = getValue(argLoader).toLowerCase(); if ( loadername.matches("basic.*") ) loader = LoaderEnum.Basic; else if ( loadername.matches("phas.*") ) loader = LoaderEnum.Phased; else if ( loadername.matches("seq.*") ) loader = LoaderEnum.Sequential; else if ( loadername.matches("para.*") ) loader = LoaderEnum.Parallel; else if ( loadername.matches("light") ) loader = LoaderEnum.Light; else throw new CmdException("Unrecognized value for --loader: "+loadername); } if ( super.contains(argStats) ) { if ( ! hasValueOfTrue(argStats) && ! hasValueOfFalse(argStats) ) throw new CmdException("Not a boolean value: "+getValue(argStats)); generateStats = super.hasValueOfTrue(argStats); } if ( super.graphName != null ) lang = Lang.NTRIPLES; if ( super.contains(argSyntax) ) { String syntax = super.getValue(argSyntax) ; Lang lang$ = RDFLanguages.nameToLang(syntax) ; if ( lang$ == null ) throw new CmdException("Can not detemine the syntax from '" + syntax + "'") ; this.lang = lang$ ; } }
Source:
public void testExecuteScriptOnBusyNode() throws Exception { FileLock fileLock = new FileLock(); Path fileLockPath = fileLock.lock(); log("Submit job"); final JobId jobId = schedulerHelper.submitJob(createJobWithLock(fileLockPath.toString())); log("Wait when node becomes busy"); RMNodeEvent event; do { event = schedulerHelper.waitForAnyNodeEvent(RMEventType.NODE_STATE_CHANGED, TIMEOUT); } while (!event.getNodeState().equals(NodeState.BUSY)); log("Wait when task starts"); schedulerHelper.waitForEventTaskRunning(jobId, "Test task"); log("Wait some time until task launcher is started"); Thread.sleep(5000); List<ScriptResult<Object>> results = schedulerHelper.getResourceManager() .executeScript("println \"Executing Script\";", "groovy", TargetType.NODE_URL.name(), Sets.newSet(testNode.getNodeURL())); Assert.assertEquals(1, results.size()); ScriptResult result = results.get(0); if (result.errorOccured()) { result.getException().printStackTrace(); Assert.fail("Script execution failed"); } log("Let task finish"); fileLock.unlock(); log("Wait when job finish"); schedulerHelper.waitForEventJobFinished(jobId, TIMEOUT); schedulerHelper.waitUntilState(testNode.getNodeURL(), NodeState.FREE, TIMEOUT); log("Check job result"); checkJobResult(schedulerHelper.getSchedulerInterface(), jobId); Assert.assertEquals("After the node is freed, no active object should remain", 0, testNode.getNode().getNumberOfActiveObjects()); }

Target:
public void testExecuteScriptOnBusyNode() throws Exception { FileLock fileLock = new FileLock(); Path fileLockPath = fileLock.lock(); log("Submit job"); final JobId jobId = schedulerHelper.submitJob(createJobWithLock(fileLockPath.toString())); log("Wait when node becomes busy"); RMNodeEvent event; do { event = schedulerHelper.waitForAnyNodeEvent(RMEventType.NODE_STATE_CHANGED, TIMEOUT); } while (!event.getNodeState().equals(NodeState.BUSY)); log("Wait when task starts"); schedulerHelper.waitForEventTaskRunning(jobId, "Test task"); log("Wait some time until task launcher is started"); Thread.sleep(5000); List<ScriptResult<Object>> results = schedulerHelper.getResourceManager() .executeScript("println \"Executing Script\";", "groovy", TargetType.NODE_URL.name(), Sets.newSet(testNode.getNodeURL())); Assert.assertEquals(1, results.size()); ScriptResult result = results.get(0); if (result.errorOccured()) { result.getException().printStackTrace(); Assert.fail("Script execution failed"); } log("Let task finish"); fileLock.unlock(); log("Wait when job finish"); schedulerHelper.waitForEventJobFinished(jobId, TIMEOUT); schedulerHelper.waitUntilState(testNode.getNodeURL(), NodeState.FREE, TIMEOUT); log("Check job result"); checkJobResult(schedulerHelper.getSchedulerInterface(), jobId); checkActiveObjects(); }
Source:
public void testDestFileWithComma() { AgentOptions options = new AgentOptions(); AgentOptions options = new AgentOptions("destfile=build/jacoco/foo, bar.exec"); assertEquals("build/jacoco/foo, bar.exec", options.getDestfile()); }

Target:
public void testDestFileWithComma() { AgentOptions options = new AgentOptions("destfile=build/jacoco/foo, bar.exec"); assertEquals("build/jacoco/foo, bar.exec", options.getDestfile()); }
Source:
protected List<Car> getAvailableCars() { List<Car> cars = Lists.newArrayList(); for (int i = 0; i < CarBrand.values().length; i++) { cars.add(new Car(i,CarBrand.values()[i])); } return cars; }

Target:
protected List<Car> getAvailableCars() { List<Car> cars = Lists.newArrayList(); CarBrand[] carBrands = CarBrand.values(); for (int i = 0; i < carBrands.length; i++) { cars.add(new Car(i, CarBrand.values()[i])); } return cars; }
Source:
public void setArgs(List<String> args) { if (min != null) replace(args, "-Xms", String.valueOf(min)); if (max != null) replace(args, "-Xmx", String.valueOf(max)); if (eden != null) replace(args, "-Xmn", String.valueOf(eden)); if (threadStackSize != null) replace(args, "ThreadStackSize", String.valueOf(threadStackSize)); if (newRatio != null) replace(args, "-XX:NewRatio=", String.valueOf(newRatio)); if (useLargePages != null) set(args, "UseLargePages", useLargePages); }

Target:
public void setArgs(List<String> args) { if (min != null) replace(args, "-Xms", String.valueOf(min)); if (max != null) replace(args, "-Xmx", String.valueOf(max)); if (newSize != null) replace(args, "-XX:NewSize=", String.valueOf(newSize)); if (maxNewSize != null) replace(args, "-XX:MaxNewSize=", String.valueOf(maxNewSize)); if (threadStackSize != null) replace(args, "-Xss", String.valueOf(threadStackSize)); if (newRatio != null) replace(args, "-XX:NewRatio=", String.valueOf(newRatio)); if (useLargePages != null) set(args, "UseLargePages", useLargePages); }
Source:
private String[] getPayloads(HttpMessage msg) { return this.name().equals("PORTSCAN") ? new String[] {getXslForPortScan(msg)} : payloads; }

Target:
private String[] getPayloads(HttpMessage msg) { return this == PORTSCAN ? new String[] {getXslForPortScan(msg)} : payloads; }
Source:
public void init() { final PayloadVerifierFactory factory = PayloadVerifierFactory.getInstance(); factory.register(Visibility.USER, new UserVerifier()); factory.register(Visibility.ROLE, new RoleVerifier()); factory.register(Visibility.ROLES, new RolesVerifier()); factory.register(Visibility.PERMISSION, new PermissionVerifier()); factory.register(Visibility.GLOBAL, new GlobalVerifier()); factory.register(Visibility.EXCLUDE_OWNER, new ExcludeOwnerVerifier()); }

Target:
public void init() { final PayloadVerifierFactory factory = PayloadVerifierFactory.getInstance(); factory.register(Visibility.USER, new UserVerifier()); factory.register(Visibility.ROLE, new RoleVerifier()); factory.register(Visibility.ROLES, new MultipleRolesVerifier()); factory.register(Visibility.PERMISSION, new PermissionVerifier()); factory.register(Visibility.GLOBAL, new GlobalVerifier()); factory.register(Visibility.EXCLUDE_OWNER, new ExcludeOwnerVerifier()); }
Source:
public void testBuilder() { Parse.Configuration.Builder builder = new Parse.Configuration.Builder(null); builder.applicationId("foo"); builder.clientKey("bar"); builder.server("<LINK_0>"); builder.enableLocalDataStore(); Parse.Configuration configuration = builder.build(); assertNull(configuration.context); assertEquals(configuration.applicationId, "foo"); assertEquals(configuration.clientKey, "bar"); assertEquals(configuration.server, "<LINK_0>/"); assertEquals(configuration.localDataStoreEnabled, true); }

Target:
public void testBuilder() { Parse.Configuration.Builder builder = new Parse.Configuration.Builder(null); builder.applicationId("foo"); builder.clientKey("bar"); builder.enableLocalDataStore(); Parse.Configuration configuration = builder.build(); assertNull(configuration.context); assertEquals(configuration.applicationId, "foo"); assertEquals(configuration.clientKey, "bar"); assertEquals(configuration.localDataStoreEnabled, true); }
Source:
public List<PermissionSubject> getPermissionCheckSubjects() { if (permsList == null) { permsList = new ArrayList<PermissionSubject>(); DiskImage image = getImage(); Guid guid = image == null ? Guid.Empty : image.getvm_guid(); if (getParameters().getOperation() == ImageOperation.Copy) { permsList.add(new PermissionSubject(guid, VdcObjectType.VmTemplate, ActionGroup.COPY_TEMPLATE)); } else { permsList.add(new PermissionSubject(guid, VdcObjectType.VM, ActionGroup.MOVE_VM)); } addStoragePermissionByQuotaMode(permsList, getParameters().getStoragePoolId(), getParameters().getStorageDomainId()); permsList = QuotaHelper.getInstance().addQuotaPermissionSubject(permsList, getStoragePool(), getQuotaId()); } return permsList; }

Target:
public List<PermissionSubject> getPermissionCheckSubjects() { if (permsList == null) { permsList = new ArrayList<PermissionSubject>(); DiskImage image = getImage(); Guid diskId = image == null ? Guid.Empty : image.getimage_group_id(); permsList.add(new PermissionSubject(diskId, VdcObjectType.Disk, ActionGroup.CONFIGURE_DISK_STORAGE)); addStoragePermissionByQuotaMode(permsList, getParameters().getStoragePoolId(), getParameters().getStorageDomainId()); permsList = QuotaHelper.getInstance().addQuotaPermissionSubject(permsList, getStoragePool(), getQuotaId()); } return permsList; }
Source:
public void traceOpened(TmfTraceOpenedSignal signal) { ITmfTrace trace = signal.getTrace(); if (signal.getTrace() instanceof TmfExperiment) { TmfExperiment experiment = (TmfExperiment) signal.getTrace(); for (ITmfTrace expTrace : experiment.getTraces()) { if (expTrace == this) { trace = expTrace; break; } } } if (trace == this) { try { buildStatistics(); } catch (TmfTraceException e) { e.printStackTrace(); } try { buildStateSystem(); } catch (TmfTraceException e) { e.printStackTrace(); } try { if (fResource != null) { fResource.getProject().refreshLocal(IResource.DEPTH_INFINITE, null); } } catch (CoreException e) { e.printStackTrace(); } } if (signal.getTrace() == this) { final ITmfContext context = seekEvent(0); final ITmfEvent event = getNext(context); context.dispose(); if (event == null) { return; } final TmfTimeRange timeRange = new TmfTimeRange(event.getTimestamp(), TmfTimestamp.BIG_CRUNCH); final TmfTraceRangeUpdatedSignal rangeUpdatedsignal = new TmfTraceRangeUpdatedSignal(this, this, timeRange); new Thread() { @Override public void run() { broadcast(rangeUpdatedsignal); } }.start(); return; } }

Target:
public void traceOpened(TmfTraceOpenedSignal signal) { ITmfTrace trace = signal.getTrace(); if (signal.getTrace() instanceof TmfExperiment) { TmfExperiment experiment = (TmfExperiment) signal.getTrace(); for (ITmfTrace expTrace : experiment.getTraces()) { if (expTrace == this) { trace = expTrace; break; } } } if (signal.getTrace() == this || trace == this) { final ITmfContext context = seekEvent(0); getNext(context); context.dispose(); } if (trace == this) { try { buildStatistics(); } catch (TmfTraceException e) { e.printStackTrace(); } try { buildStateSystem(); } catch (TmfTraceException e) { e.printStackTrace(); } try { if (fResource != null) { fResource.getProject().refreshLocal(IResource.DEPTH_INFINITE, null); } } catch (CoreException e) { e.printStackTrace(); } } if (signal.getTrace() == this) { if (getNbEvents() == 0) { return; } final TmfTimeRange timeRange = new TmfTimeRange(getStartTime(), TmfTimestamp.BIG_CRUNCH); final TmfTraceRangeUpdatedSignal rangeUpdatedsignal = new TmfTraceRangeUpdatedSignal(this, this, timeRange); new Thread() { @Override public void run() { broadcast(rangeUpdatedsignal); } }.start(); return; } }
Source:
public void flush() throws IOException { asyncMutator.flush(); }

Target:
public void flush() throws IOException { asyncMutator.flush(); handleExceptions(); }
Source:
public static Integer prepareConnectionForTransaction(Connection con, @Nullable TransactionDefinition definition) throws SQLException { Assert.notNull(con, "No Connection specified"); final boolean debugEnabled = logger.isDebugEnabled(); if (definition != null && definition.isReadOnly()) { try { if (debugEnabled) { logger.debug("Setting JDBC Connection [" + con + "] read-only"); } con.setReadOnly(true); } catch (SQLException | RuntimeException ex) { Throwable exToCheck = ex; while (exToCheck != null) { if (exToCheck.getClass().getSimpleName().contains("Timeout")) { throw ex; } exToCheck = exToCheck.getCause(); } logger.debug("Could not set JDBC Connection read-only", ex); } } Integer previousIsolationLevel = null; if (definition != null && definition.getIsolationLevel() != TransactionDefinition.ISOLATION_DEFAULT) { if (debugEnabled) { logger.debug("Changing isolation level of JDBC Connection [" + con + "] to " + definition.getIsolationLevel()); } int currentIsolation = con.getTransactionIsolation(); if (currentIsolation != definition.getIsolationLevel()) { previousIsolationLevel = currentIsolation; con.setTransactionIsolation(definition.getIsolationLevel()); } } return previousIsolationLevel; }

Target:
public static Integer prepareConnectionForTransaction(Connection con, @Nullable TransactionDefinition definition) throws SQLException { Assert.notNull(con, "No Connection specified"); boolean debugEnabled = logger.isDebugEnabled(); if (definition != null && definition.isReadOnly()) { try { if (debugEnabled) { logger.debug("Setting JDBC Connection [" + con + "] read-only"); } con.setReadOnly(true); } catch (SQLException | RuntimeException ex) { Throwable exToCheck = ex; while (exToCheck != null) { if (exToCheck.getClass().getSimpleName().contains("Timeout")) { throw ex; } exToCheck = exToCheck.getCause(); } logger.debug("Could not set JDBC Connection read-only", ex); } } Integer previousIsolationLevel = null; if (definition != null && definition.getIsolationLevel() != TransactionDefinition.ISOLATION_DEFAULT) { if (debugEnabled) { logger.debug("Changing isolation level of JDBC Connection [" + con + "] to " + definition.getIsolationLevel()); } int currentIsolation = con.getTransactionIsolation(); if (currentIsolation != definition.getIsolationLevel()) { previousIsolationLevel = currentIsolation; con.setTransactionIsolation(definition.getIsolationLevel()); } } return previousIsolationLevel; }
Source:
public static UserFragment newInstance(String login) { UserFragment f = new UserFragment(); Bundle args = new Bundle(); args.putString(Constants.EXTRA_LOGIN, login); f.setArguments(args); return f; }

Target:
public static UserFragment newInstance(String login) { UserFragment f = new UserFragment(); Bundle args = new Bundle(); args.putString(EXTRA_LOGIN, login); f.setArguments(args); return f; }
Source:
public static String loadJSON(URL src) throws IOException { URLConnection con = ProxyConfiguration.open(src); int responseCode = HttpURLConnection.HTTP_OK; if (con instanceof HttpURLConnection) { ((HttpURLConnection) con).setInstanceFollowRedirects(true); responseCode = ((HttpURLConnection) con).getResponseCode(); } if (HttpURLConnection.HTTP_OK != responseCode && HttpURLConnection.HTTP_MOVED_TEMP != responseCode && HttpURLConnection.HTTP_MOVED_PERM != responseCode && HttpURLConnection.HTTP_SEE_OTHER != responseCode) { throw new IOException("Could not find JSON in " + src); } else if (HttpURLConnection.HTTP_OK != responseCode) { String redirection = ((HttpURLConnection) con).getHeaderField("Location"); con = ProxyConfiguration.open(new URL(redirection)); responseCode = ((HttpURLConnection) con).getResponseCode(); } if (HttpURLConnection.HTTP_OK != responseCode) { throw new IOException("Could not find JSON in " + src); } try (InputStream is = con.getInputStream()) { String jsonp = IOUtils.toString(is, "UTF-8"); int start = jsonp.indexOf('{'); int end = jsonp.lastIndexOf('}'); if (start >= 0 && end > start) { return jsonp.substring(start, end + 1); } else { throw new IOException("Could not find JSON in " + src); } } }

Target:
public static String loadJSON(URL src) throws IOException { URLConnection con; try { con = ProxyConfiguration.openURLAllowingCrossProtocolRedirects(src); } catch (IOException e) { throw new IOException("Could not find JSON in " + src, e); } try (InputStream is = con.getInputStream()) { String jsonp = IOUtils.toString(is, "UTF-8"); int start = jsonp.indexOf('{'); int end = jsonp.lastIndexOf('}'); if (start >= 0 && end > start) { return jsonp.substring(start, end + 1); } else { throw new IOException("Could not find JSON in " + src); } } }
Source:
public boolean isFinished() { return false; }

Target:
public boolean isFinished() { return this.isFinished(); }
Source:
private void subscribeToEvents() { Client client = client(); this.subscriptions = subscribe(client, command, consumers, streamingErrorHandler()); checkNotNull(subscriptions); client.subscriptions() .addAll(subscriptions); }

Target:
private void subscribeToEvents() { Client client = client(); this.subscriptions = subscribe(client, command, consumers, streamingErrorHandler()); client.subscriptions() .addAll(subscriptions); }
Source:
public boolean isActivePeriod() { if (getStart().isAfter(LocalDate.now())) { return false; } if (getEnd().isBefore(LocalDate.now())) { return false; } return true; }

Target:
public boolean isActivePeriod() { LocalDate now = LocalDate.now(); return now.isAfter(getStart()) && now.isBefore(getEnd()); }
Source:
public void failsToWriteBigDoc() throws IOException { final File file = new File( this.folder.newFolder(), "big_file" ); final String content = StringUtils.repeat('b', 101); final byte[] bytes = content.getBytes(StandardCharsets.UTF_8); new SafeDoc(new SmallDoc(new MkDoc(file, "", ""), Tv.HUNDRED)).write( new ByteArrayInputStream(bytes), bytes.length ); MatcherAssert.assertThat( Files.toString(file, StandardCharsets.UTF_8), Matchers.equalTo(content) ); }

Target:
public void failsToWriteBigDoc() throws IOException { final File file = new File( this.folder.newFolder(), "big_file" ); final String content = StringUtils.repeat('b', 101); final byte[] bytes = content.getBytes(StandardCharsets.UTF_8); new SmallDoc(new MkDoc(file, "", ""), Tv.HUNDRED).write( new ByteArrayInputStream(bytes), bytes.length ); MatcherAssert.assertThat( Files.toString(file, StandardCharsets.UTF_8), Matchers.equalTo(content) ); }
Source:
public boolean handleResponse(ZWaveController zController, SerialMessage lastSentMessage, SerialMessage incomingMessage) { logger.debug("Got RemoveFailedNode response."); int nodeId = lastSentMessage.getMessagePayloadByte(0); switch(incomingMessage.getMessagePayloadByte(0)) { case FAILED_NODE_REMOVE_STARTED: logger.debug("NODE {}: Remove failed node successfully placed on stack.", nodeId); break; case FAILED_NODE_NOT_PRIMARY_CONTROLLER: logger.error("NODE {}: Remove failed node failed as not Primary Controller for node!", nodeId); transactionComplete = true; break; case FAILED_NODE_NO_CALLBACK_FUNCTION: logger.error("NODE {}: Remove failed node failed as no callback function!", nodeId); transactionComplete = true; break; case FAILED_NODE_NOT_FOUND: logger.error("NODE {}: Remove failed node failed as node not found on controllers failed list!", nodeId); transactionComplete = true; break; case FAILED_NODE_REMOVE_PROCESS_BUSY: logger.error("NODE {}: Remove failed node failed as Controller Busy!", nodeId); transactionComplete = true; break; case FAILED_NODE_REMOVE_FAIL: logger.error("NODE {}: Remove failed node failed!", nodeId); transactionComplete = true; break; default: logger.error("NODE {}: Remove failed node not placed on stack due to error 0x{}.", nodeId, Integer.toHexString(incomingMessage.getMessagePayloadByte(0))); transactionComplete = true; break; } return true; }

Target:
public boolean handleResponse(ZWaveController zController, SerialMessage lastSentMessage, SerialMessage incomingMessage) { logger.debug("Got RemoveFailedNode response."); int nodeId = lastSentMessage.getMessagePayloadByte(0); switch(incomingMessage.getMessagePayloadByte(0)) { case FAILED_NODE_REMOVE_STARTED: logger.debug("NODE {}: Remove failed node successfully placed on stack.", nodeId); transactionComplete = true; break; case FAILED_NODE_NOT_PRIMARY_CONTROLLER: logger.error("NODE {}: Remove failed node failed as not Primary Controller for node!", nodeId); transactionComplete = true; break; case FAILED_NODE_NO_CALLBACK_FUNCTION: logger.error("NODE {}: Remove failed node failed as no callback function!", nodeId); transactionComplete = true; break; case FAILED_NODE_NOT_FOUND: logger.error("NODE {}: Remove failed node failed as node not found on controllers failed list!", nodeId); transactionComplete = true; break; case FAILED_NODE_REMOVE_PROCESS_BUSY: logger.error("NODE {}: Remove failed node failed as Controller Busy!", nodeId); transactionComplete = true; break; case FAILED_NODE_REMOVE_FAIL: logger.error("NODE {}: Remove failed node failed!", nodeId); transactionComplete = true; break; default: logger.error("NODE {}: Remove failed node not placed on stack due to error 0x{}.", nodeId, Integer.toHexString(incomingMessage.getMessagePayloadByte(0))); transactionComplete = true; break; } return true; }
Source:
public CoberturaPublisher() { }

Target:
public CoberturaPublisher() { this("", true, true, true, true, true, true, true, SourceEncoding.UTF_8, 42); }
Source:
private ApplicationDTO(Builder builder) { this.typeId = builder.typeId; this.categoryId = builder.categoryId; if (builder.id != null) { if (builder.id.matches("^[a-zA-Z0-9_.]+$")) { this.id = builder.id; } else { LOGGER.warn(String.format("Application ID (%s) contains invalid characters, will remove them.", builder.id)); this.id = builder.id.replaceAll("[^a-zA-Z0-9_.]", ""); } } else { this.id = null; } this.name = builder.name == null ? builder.id : builder.name; this.description = builder.description; this.icon = builder.icon; this.miniatures = builder.miniatures; this.scripts = builder.scripts; this.resources = builder.resources; }

Target:
private ApplicationDTO(Builder builder) { this.typeId = builder.typeId; this.categoryId = builder.categoryId; if (builder.id != null) { if (builder.id.matches(ID_REGEX)) { this.id = builder.id; } else { LOGGER.warn(String.format("Application ID (%s) contains invalid characters, will remove them.", builder.id)); this.id = builder.id.replaceAll(INVALID_ID_CHARS_REGEX, ""); } } else { this.id = null; } this.name = builder.name == null ? builder.id : builder.name; this.description = builder.description; this.icon = builder.icon; this.miniatures = builder.miniatures; this.scripts = builder.scripts; this.resources = builder.resources; }