auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void canApproveAndReassign() throws IOException { final String test = "test"; final Approval approval = new ReassignTo(test); final PullRequest request = new PullRequest(); final Github github = Mockito.mock(Github.class); final User assignee = new User(); assignee.setLogin(test); final GitHubClient client = Mockito.mock(GitHubClient.class); Mockito.doReturn(client).when(github).client(); Mockito.when(client.get(Mockito.any(GitHubRequest.class))) .thenReturn( new GitHubResponse( Mockito.mock(HttpURLConnection.class), assignee ) ); MatcherAssert.assertThat( approval.has( request , github , new Github.Repo("xembly/xembly") ), Matchers.is(true) ); MatcherAssert.assertThat( request.getAssignee().getLogin(), Matchers.is(test) ); }

Target:
public void canApproveAndReassign() throws IOException { final String login = "test"; final Approval approval = new ReassignTo(login); final PullRequest request = new PullRequest(); final Github github = Mockito.mock(Github.class); final User assignee = new User(); assignee.setLogin(login); final GitHubClient client = Mockito.mock(GitHubClient.class); Mockito.doReturn(client).when(github).client(); Mockito.when(client.get(Mockito.any(GitHubRequest.class))) .thenReturn( new GitHubResponse( Mockito.mock(HttpURLConnection.class), assignee ) ); MatcherAssert.assertThat( approval.has( request, github, new Github.Repo("xembly/xembly") ), Matchers.is(true) ); MatcherAssert.assertThat( request.getAssignee().getLogin(), Matchers.is(login) ); }
Source:
void cleanSubTypes(final String uuid) { final String selector = "[data-parent-row-uuid=\"" + uuid + "\"]"; final NodeList<Element> subDataTypeRows = getElement().querySelectorAll(selector); for (int i = 0; i < subDataTypeRows.length; i++) { final Element item = subDataTypeRows.getAt(i); cleanSubTypes(item.getAttribute("data-row-uuid")); item.remove(); } }

Target:
void cleanSubTypes(final String uuid) { final String selector = "[data-parent-row-uuid=\"" + uuid + "\"]"; final NodeList<Element> subDataTypeRows = getElement().querySelectorAll(selector); for (int i = 0; i < subDataTypeRows.length; i++) { final Element item = subDataTypeRows.getAt(i); cleanSubTypes(item.getAttribute(UUID_ATTR)); item.remove(); } }
Source:
public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { throw new AbortException("Throwed AbortException from publisher!"); }

Target:
public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { throw new AbortException("Threw AbortException from publisher!"); }
Source:
private static NewIndexDescriptor indexGetForLabelAndPropertyKey( StateHandlingStatementOperations txContext, KernelStatement state, int labelId, int propertyKey ) { final int labelId3 = labelId; final int[] propertyKeyIds = new int[]{propertyKey}; return txContext.indexGetForLabelAndPropertyKey( state, SchemaDescriptorFactory.forLabel( labelId3, propertyKeyIds ) ); }

Target:
private static NewIndexDescriptor indexGetForLabelAndPropertyKey( StateHandlingStatementOperations txContext, KernelStatement state, int labelId, int propertyKey ) { LabelSchemaDescriptor schemaDescriptor = SchemaDescriptorFactory.forLabel( labelId, propertyKey ); return txContext.indexGetForLabelAndPropertyKey( state, schemaDescriptor ); }
Source:
public RemoteServerConfigurationImpl(List<RemoteServerData> serverData, TaskRunner taskRunner) { actualStateMap = Collections.synchronizedMap(new HashMap<>()); remoteServerDataList = new ArrayList<>(serverData); for (RemoteServerData remoteServerData : serverData) { actualStateMap.put(remoteServerData.getServerName(), new RemoteServerState(RemoteServerState.State.NOT_CONNECTED, remoteServerData.getUsername(), null)); } if (taskRunner == null || !(taskRunner instanceof ScheduledTaskRunner)) { logger.info("Task runner isn't ScheduledTaskRunner. Remote server status task won't be scheduled."); } else { scheduledTaskRunner = (ScheduledTaskRunner) taskRunner; } }

Target:
public RemoteServerConfigurationImpl(List<RemoteServerData> serverData, TaskRunner taskRunner) { init(serverData, taskRunner); }
Source:
public SkED25519PublicKey decodePublicKey( SessionContext session, String keyType, InputStream keyData, Map<String, String> headers) throws IOException, GeneralSecurityException { if (!KEY_TYPE.equals(keyType)) { throw new InvalidKeySpecException("Invalid keyType: " + keyType); } boolean noTouchRequired = false; if (headers.containsKey(NO_TOUCH_REQUIRED_HEADER)) { noTouchRequired = Boolean.parseBoolean(headers.get(NO_TOUCH_REQUIRED_HEADER)); } EdDSAPublicKey edDSAPublicKey = Ed25519PublicKeyDecoder.INSTANCE.decodePublicKey(session, KeyPairProvider.SSH_ED25519, keyData, headers); String appName = KeyEntryResolver.decodeString(keyData, MAX_APP_NAME_LENGTH); return new SkED25519PublicKey(appName, noTouchRequired, edDSAPublicKey); }

Target:
public SkED25519PublicKey decodePublicKey( SessionContext session, String keyType, InputStream keyData, Map<String, String> headers) throws IOException, GeneralSecurityException { if (!KEY_TYPE.equals(keyType)) { throw new InvalidKeySpecException("Invalid keyType: " + keyType); } boolean noTouchRequired = parseBooleanHeader(headers, NO_TOUCH_REQUIRED_HEADER, false); EdDSAPublicKey edDSAPublicKey = Ed25519PublicKeyDecoder.INSTANCE.decodePublicKey(session, KeyPairProvider.SSH_ED25519, keyData, headers); String appName = KeyEntryResolver.decodeString(keyData, MAX_APP_NAME_LENGTH); return new SkED25519PublicKey(appName, noTouchRequired, edDSAPublicKey); }
Source:
public void testServerVariableHandling() { String alias = "somealias"; String port = "1234"; String host = "localhost.local"; String username = "acme"; String password = "password"; String url = "service:jmx:remoting-jms://amce.local:1234"; System.setProperty("myalias", alias); System.setProperty("myport", port); System.setProperty("myhost", host); System.setProperty("myusername",username); System.setProperty("mypassword", password); System.setProperty("myurl", url); Server s1 = Server.builder() .setAlias("${myalias}") .setPort("${myport}") .setHost("${myhost}") .setUsername("${myusername}") .setPassword("${mypassword}") .setUrl("${myurl}") .build(); Server s2 = Server.builder() .setAlias(alias) .setPort(port) .setHost(host) .setUsername(username) .setPassword(password) .setUrl(url) .build(); assertEquals(s1.hashCode(), s2.hashCode()); System.clearProperty("myalias"); System.clearProperty("myport"); System.clearProperty("myhost"); System.clearProperty("myusername"); System.clearProperty("myusername"); System.clearProperty("myurl"); }

Target:
public void testServerVariableHandling() { try{ String alias = "somealias"; String port = "1234"; String host = "localhost.local"; String username = "acme"; String password = "password"; String url = "service:jmx:remoting-jms://amce.local:1234"; System.setProperty("myalias", alias); System.setProperty("myport", port); System.setProperty("myhost", host); System.setProperty("myusername",username); System.setProperty("mypassword", password); System.setProperty("myurl", url); Server serverFromSystemProperties = Server.builder() .setAlias("${myalias}") .setPort("${myport}") .setHost("${myhost}") .setUsername("${myusername}") .setPassword("${mypassword}") .setUrl("${myurl}") .build(); Server serverFromDirectParameters = Server.builder() .setAlias(alias) .setPort(port) .setHost(host) .setUsername(username) .setPassword(password) .setUrl(url) .build(); assertEquals(serverFromSystemProperties.hashCode(), serverFromDirectParameters.hashCode()); }finally{ System.clearProperty("myalias"); System.clearProperty("myport"); System.clearProperty("myhost"); System.clearProperty("myusername"); System.clearProperty("myusername"); System.clearProperty("myurl"); } }
Source:
public void tearDown() throws Exception { executor.shutdownNow(); scheduledExecutor.shutdownNow(); executor.awaitTermination(10, SECONDS); scheduledExecutor.awaitTermination(10, SECONDS); }

Target:
public void tearDown() throws Exception { executor.shutdownNow(); scheduledExecutor.shutdownNow(); assertTrue(executor.awaitTermination(10, SECONDS)); assertTrue(scheduledExecutor.awaitTermination(10, SECONDS)); }
Source:
public void run() { StringBuffer traceBuffer = new StringBuffer(); try { Path filePath = Paths.get(filename); RandomAccessFile file = new RandomAccessFile(filePath.toFile(), "r"); traceBuffer.append("[" + filename + "]: threaded put object\n"); client.putObject(bucketName, filename, file,null,null,null,null); traceBuffer.append("[" + filename + "]: delete file\n"); Files.delete(Paths.get(filename)); traceBuffer.append("[" + filename + "]: delete object\n"); client.removeObject(bucketName, filename); } catch (Exception e) { System.err.print(traceBuffer.toString()); e.printStackTrace(); } }

Target:
public void run() { StringBuffer traceBuffer = new StringBuffer(); try { traceBuffer.append("[" + filename + "]: threaded put object\n"); client.putObject(bucketName, filename, filename, null, null, null, null); traceBuffer.append("[" + filename + "]: delete file\n"); Files.delete(Paths.get(filename)); traceBuffer.append("[" + filename + "]: delete object\n"); client.removeObject(bucketName, filename); } catch (Exception e) { System.err.print(traceBuffer.toString()); e.printStackTrace(); } }
Source:
public void setUp() { final EventTypeOptionsValidator eventTypeOptionsValidator = new EventTypeOptionsValidator(TOPIC_RETENTION_MIN_MS, TOPIC_RETENTION_MAX_MS); eventTypeService = new EventTypeService(eventTypeRepository, timelineService, partitionResolver, enrichment, subscriptionDbRepository, schemaEvolutionService, partitionsCalculator, featureToggleService, authorizationValidator, timelineSync, transactionTemplate, nakadiSettings, nakadiKpiPublisher, KPI_ET_LOG_EVENT_TYPE, nakadiAuditLogPublisher, AUDIT_ET_LOG_EVENT_TYPE,eventTypeOptionsValidator, adminService); when(transactionTemplate.execute(any())).thenAnswer(invocation -> { final TransactionCallback callback = (TransactionCallback) invocation.getArguments()[0]; return callback.doInTransaction(null); }); }

Target:
public void setUp() { final EventTypeOptionsValidator eventTypeOptionsValidator = new EventTypeOptionsValidator(TOPIC_RETENTION_MIN_MS, TOPIC_RETENTION_MAX_MS); eventTypeService = new EventTypeService(eventTypeRepository, timelineService, partitionResolver, enrichment, subscriptionDbRepository, schemaEvolutionService, partitionsCalculator, featureToggleService, authorizationValidator, timelineSync, transactionTemplate, nakadiSettings, nakadiKpiPublisher, KPI_ET_LOG_EVENT_TYPE, nakadiAuditLogPublisher, eventTypeOptionsValidator, adminService); when(transactionTemplate.execute(any())).thenAnswer(invocation -> { final TransactionCallback callback = (TransactionCallback) invocation.getArguments()[0]; return callback.doInTransaction(null); }); }
Source:
public void makeRequest(ConveyorTile tile, Resource target) throws GeoWebCacheException { WMSLayer layer = (WMSLayer) tile.getLayer(); GridSubset gridSubset = layer.getGridSubset(tile.getGridSetId()); Map<String, String> wmsParams = layer.getWMSRequestTemplate(tile.getMimeType(), WMSLayer.RequestType.MAP); wmsParams.put("FORMAT", tile.getMimeType().getFormat()); wmsParams.put("SRS", layer.backendSRSOverride(gridSubset.getSRS())); wmsParams.put("HEIGHT", String.valueOf(gridSubset.getTileHeight())); wmsParams.put("WIDTH", String.valueOf(gridSubset.getTileWidth())); BoundingBox bbox = gridSubset.boundsFromIndex(tile.getTileIndex()); wmsParams.put("BBOX", bbox.toString()); Map<String, String> fullParameters = tile.getFilteringParameters(); if (fullParameters.isEmpty()) { fullParameters = layer.getDefaultParameterFilters(); } wmsParams.putAll(fullParameters); if (tile.getMimeType() == XMLMime.kml) { wmsParams.put("format_options", "mode:superoverlay;overlaymode:auto"); } MimeType mimeType = tile.getMimeType(); makeRequest(tile, layer, wmsParams, mimeType, target); }

Target:
public void makeRequest(ConveyorTile tile, Resource target) throws GeoWebCacheException { WMSLayer layer = (WMSLayer) tile.getLayer(); GridSubset gridSubset = layer.getGridSubset(tile.getGridSetId()); Map<String, String> wmsParams = layer.getWMSRequestTemplate(tile.getMimeType(), WMSLayer.RequestType.MAP); wmsParams.put("FORMAT", tile.getMimeType().getFormat()); wmsParams.put("SRS", layer.backendSRSOverride(gridSubset.getSRS())); wmsParams.put("HEIGHT", String.valueOf(gridSubset.getTileHeight())); wmsParams.put("WIDTH", String.valueOf(gridSubset.getTileWidth())); BoundingBox bbox = gridSubset.boundsFromIndex(tile.getTileIndex()); wmsParams.put("BBOX", bbox.toString()); Map<String, String> filteringParameters = tile.getFilteringParameters(); if (filteringParameters.isEmpty()) { filteringParameters = layer.getDefaultParameterFilters(); } wmsParams.putAll(filteringParameters); if (tile.getMimeType() == XMLMime.kml) { wmsParams.put("format_options", "mode:superoverlay;overlaymode:auto"); } MimeType mimeType = tile.getMimeType(); makeRequest(tile, layer, wmsParams, mimeType, target); }
Source:
protected Object getNonNullValueForType(Type type) { if (type.getJavaType() == boolean.class) { return true; } if (type.getJavaType() == long.class) { return 1L; } if (type.getJavaType() == double.class) { return 1.0; } if (type.getJavaType() == Slice.class) { return Slices.utf8Slice("_"); } if (type instanceof ArrayType) { ArrayType arrayType = (ArrayType) type; Type elementType = arrayType.getElementType(); Object elementNonNullValue = getNonNullValueForType(elementType); return arrayBlockOf(elementType, elementNonNullValue); } if (type instanceof MapType) { MapType mapType = (MapType) type; Type keyType = mapType.getKeyType(); Type valueType = mapType.getValueType(); Object keyNonNullValue = getNonNullValueForType(keyType); Object valueNonNullValue = getNonNullValueForType(valueType); Map map = ImmutableMap.of(keyNonNullValue, valueNonNullValue); return mapBlockOf(keyType, valueType, map); } if (type instanceof RowType) { RowType rowType = (RowType) type; List<Type> elementTypes = rowType.getTypeParameters(); Object[] elementNonNullValues = elementTypes.stream().map(this::getNonNullValueForType).toArray(Object[]::new); return toRow(elementTypes, elementNonNullValues); } throw new IllegalStateException("Unsupported Java type " + type.getJavaType() + " (for type " + type + ")"); }

Target:
private static Object getNonNullValueForType(Type type) { if (type.getJavaType() == boolean.class) { return true; } if (type.getJavaType() == long.class) { return 1L; } if (type.getJavaType() == double.class) { return 1.0; } if (type.getJavaType() == Slice.class) { return Slices.utf8Slice("_"); } if (type instanceof ArrayType) { ArrayType arrayType = (ArrayType) type; Type elementType = arrayType.getElementType(); Object elementNonNullValue = getNonNullValueForType(elementType); return arrayBlockOf(elementType, elementNonNullValue); } if (type instanceof MapType) { MapType mapType = (MapType) type; Type keyType = mapType.getKeyType(); Type valueType = mapType.getValueType(); Object keyNonNullValue = getNonNullValueForType(keyType); Object valueNonNullValue = getNonNullValueForType(valueType); Map map = ImmutableMap.of(keyNonNullValue, valueNonNullValue); return mapBlockOf(keyType, valueType, map); } if (type instanceof RowType) { RowType rowType = (RowType) type; List<Type> elementTypes = rowType.getTypeParameters(); Object[] elementNonNullValues = elementTypes.stream().map(AbstractTestType::getNonNullValueForType).toArray(Object[]::new); return toRow(elementTypes, elementNonNullValues); } throw new IllegalStateException("Unsupported Java type " + type.getJavaType() + " (for type " + type + ")"); }
Source:
public AllureReportGenerator(final File... inputDirectories) { this.inputDirectories = inputDirectories; testSuiteFiles = new TestSuiteFiles(validateXML, inputDirectories); }

Target:
public AllureReportGenerator(final File... inputDirectories) { this.inputDirectories = inputDirectories; this.testRunGenerator = new TestRunGenerator(validateXML, inputDirectories); }
Source:
public void updateValues( Object object ) { validateFields( object ); for( Field field : getScenarioFields( object ) ) { try { Object value = getValue( field ); if( value != null ) { field.set( object, value ); log.debug( "Setting field to value {}", field, value ); } else if( isRequired( field ) ) { throw new RuntimeException( "TODO Better exception?" ); } } catch( IllegalAccessException e ) { throw new RuntimeException( "Error while updating field " + field, e ); } } }

Target:
public void updateValues( Object object ) { validateFields( object ); for( ScenarioStateField field : getScenarioFields( object ) ) { Object value = getValue( field ); if( value != null ) { try { field.getField().set( object, value ); } catch( IllegalAccessException e ) { throw new RuntimeException( "Error while updating field " + field.getField(), e ); } log.debug( "Setting field to value {}", field.getField(), value ); } else if( field.isRequired() ) { throw new JGivenMissingRequiredScenarioStateException( field.getField() ); } } }
Source:
public List<Template> getTemplates() { return templates; }

Target:
public List<Template> getTemplates() { return Collections.unmodifiableList(templates); }
Source:
public void sanityCheck( Input.Estimates inputEstimates, RecordFormats recordFormats, MemoryStatsVisitor.Visitable baseMemory, MemoryStatsVisitor.Visitable... memoryVisitables ) { long estimatedCacheSize = estimatedCacheSize( baseMemory, memoryVisitables ); long freeMemory = freeMemoryLookup.getAsLong(); long optimalMinimalHeapSize = optimalMinimalHeapSize( inputEstimates, recordFormats ); long actualHeapSize = actualHeapSizeLookup.getAsLong(); boolean freeMemoryIsKnown = freeMemory != VALUE_UNAVAILABLE; if ( freeMemoryIsKnown && actualHeapSize + freeMemory < estimatedCacheSize + optimalMinimalHeapSize ) { monitor.insufficientAvailableMemory( estimatedCacheSize, optimalMinimalHeapSize, freeMemory ); return; } if ( actualHeapSize < optimalMinimalHeapSize ) { monitor.insufficientHeapSize( optimalMinimalHeapSize, actualHeapSize ); return; } if ( ((freeMemoryIsKnown && freeMemory < estimatedCacheSize) || !freeMemoryIsKnown) && actualHeapSize > optimalMinimalHeapSize * 1.2 ) { monitor.abundantHeapSize( optimalMinimalHeapSize, actualHeapSize ); } }

Target:
void sanityCheck( Input.Estimates inputEstimates, RecordFormats recordFormats, MemoryStatsVisitor.Visitable baseMemory, MemoryStatsVisitor.Visitable... memoryVisitables ) { long estimatedCacheSize = estimatedCacheSize( baseMemory, memoryVisitables ); long freeMemory = freeMemoryLookup.getAsLong(); long optimalMinimalHeapSize = optimalMinimalHeapSize( inputEstimates, recordFormats ); long actualHeapSize = actualHeapSizeLookup.getAsLong(); boolean freeMemoryIsKnown = freeMemory != VALUE_UNAVAILABLE; if ( freeMemoryIsKnown && actualHeapSize + freeMemory < estimatedCacheSize + optimalMinimalHeapSize ) { monitor.insufficientAvailableMemory( estimatedCacheSize, optimalMinimalHeapSize, freeMemory ); return; } if ( actualHeapSize < optimalMinimalHeapSize ) { monitor.insufficientHeapSize( optimalMinimalHeapSize, actualHeapSize ); return; } if ( (!freeMemoryIsKnown || freeMemory < estimatedCacheSize) && actualHeapSize > optimalMinimalHeapSize * 1.2 ) { monitor.abundantHeapSize( optimalMinimalHeapSize, actualHeapSize ); } }
Source:
public void chGetEnvelopeTest() throws Exception { WMTSCapabilities caps = createCapabilities("admin_ch.getcapa.xml"); WebMapTileServer wmts = new WebMapTileServer(caps); Layer layer = (Layer) caps.getLayer("ch.are.alpenkonvention"); assertNotNull(wmts.getEnvelope(layer, CRS.decode("urn:ogc:def:crs:EPSG:2056"))); assertNull(wmts.getEnvelope(layer, CRS.decode("EPSG:4326"))); CoordinateReferenceSystem crs = CRS.decode("CRS:84"); GeneralEnvelope envelope = wmts.getEnvelope(layer, crs); assertNotNull(envelope); assertEquals(45.398181, envelope.getMinimum(1), 0.0001); assertEquals(5.140242, envelope.getMinimum(0), 0.0001); assertEquals(48.230651, envelope.getMaximum(1), 0.0001); assertEquals(11.47757, envelope.getMaximum(0), 0.0001); }

Target:
public void chGetEnvelopeTest() throws Exception { WMTSCapabilities caps = createCapabilities("admin_ch.getcapa.xml"); WebMapTileServer wmts = new WebMapTileServer(caps); Layer layer = (Layer) caps.getLayer("ch.are.alpenkonvention"); assertNotNull(wmts.getEnvelope(layer, CRS.decode("urn:ogc:def:crs:OGC:1.3:CRS84"))); assertNotNull(wmts.getEnvelope(layer, CRS.decode("CRS:84"))); assertNotNull(wmts.getEnvelope(layer, CRS.decode("EPSG:2056"))); assertNotNull(wmts.getEnvelope(layer, CRS.decode("urn:ogc:def:crs:EPSG:2056"))); assertNull(wmts.getEnvelope(layer, CRS.decode("EPSG:4326"))); CoordinateReferenceSystem crs = CRS.decode("CRS:84"); GeneralEnvelope envelope = wmts.getEnvelope(layer, crs); assertNotNull(envelope); assertEquals(45.398181, envelope.getMinimum(1), 0.0001); assertEquals(5.140242, envelope.getMinimum(0), 0.0001); assertEquals(48.230651, envelope.getMaximum(1), 0.0001); assertEquals(11.47757, envelope.getMaximum(0), 0.0001); }
Source:
private Mono<OffsetDateTime> populateLastConsumable() { return DownloadUtils.downloadToString(this.client, METADATA_SEGMENT_PATH) .flatMap(json -> { try { ObjectMapper objectMapper = new ObjectMapper(); JsonNode jsonNode = objectMapper.readTree(json); this.lastConsumable = OffsetDateTime.parse(jsonNode.get("lastConsumable").asText()); if (this.lastConsumable.isBefore(endTime)) { this.safeEndTime = this.lastConsumable; } return Mono.just(this.lastConsumable); } catch (IOException e) { return Mono.error(e); } }); }

Target:
private Mono<OffsetDateTime> populateLastConsumable() { return DownloadUtils.downloadToByteArray(this.client, METADATA_SEGMENT_PATH) .flatMap(json -> { try { JsonNode jsonNode = MAPPER.reader().readTree(json); this.lastConsumable = OffsetDateTime.parse(jsonNode.get("lastConsumable").asText()); if (this.lastConsumable.isBefore(endTime)) { this.safeEndTime = this.lastConsumable; } return Mono.just(this.lastConsumable); } catch (IOException e) { return FluxUtil.monoError(logger, new UncheckedIOException(e)); } }); }
Source:
protected PNOperationType getOperationType() { return PNOperationType.PNAccessManagerGranToken; }

Target:
protected PNOperationType getOperationType() { return PNOperationType.PNAccessManagerGrantToken; }
Source:
public String toText() { StringBuffer sb = new StringBuffer(); elements.forEach(e -> sb.append(e.toText())); return sb.toString(); }

Target:
public String toText() { StringBuilder sb = new StringBuilder(); elements.forEach(e -> sb.append(e.toText())); return sb.toString(); }
Source:
public void setAcceptedPatterns(Set<String> patterns) { if (acceptedPatterns == null) { LOG.debug("Replacing accepted patterns with [{}], be aware that this affects all instances and safety of your application!", acceptedPatterns, patterns); } else { LOG.warn("Replacing accepted patterns with [{}], be aware that this affects all instances and safety of your application!", acceptedPatterns, patterns); } acceptedPatterns = new HashSet<>(patterns.size()); for (String pattern : patterns) { acceptedPatterns.add(Pattern.compile(pattern, Pattern.CASE_INSENSITIVE)); } }

Target:
public void setAcceptedPatterns(Set<String> patterns) { if (acceptedPatterns == null) { LOG.debug("Sets accepted patterns to [{}], note this impacts the safety of your application!", patterns); } else { LOG.warn("Replacing accepted patterns with [{}], be aware that this affects all instances and safety of your application!", acceptedPatterns, patterns); } acceptedPatterns = new HashSet<>(patterns.size()); for (String pattern : patterns) { acceptedPatterns.add(Pattern.compile(pattern, Pattern.CASE_INSENSITIVE)); } }
Source:
public Collection<PsiElement> getPsiTargets(StringLiteralExpression element) { final Set<PsiElement> priorityTargets = new LinkedHashSet<>(); final Set<PsiElement> targets = new LinkedHashSet<>(); final String contents = element.getContents(); if(StringUtils.isBlank(contents)) { return targets; } final String priorityTemplate = "/" + LaravelSettings.getInstance(element.getProject()).getMainLanguage() + "/"; FileBasedIndexImpl.getInstance().getFilesWithKey(TranslationKeyStubIndex.KEY, new HashSet<>(Collections.singletonList(contents)), virtualFile -> { PsiFile psiFileTarget = PsiManager.getInstance(getProject()).findFile(virtualFile); if(psiFileTarget == null) { return true; } String namespace = TranslationUtil.getNamespaceFromFilePath(virtualFile.getPath()); if(namespace == null) { return true; } psiFileTarget.acceptChildren(new ArrayReturnPsiRecursiveVisitor(namespace, (key, psiKey, isRootElement) -> { if(!isRootElement && key.equalsIgnoreCase(contents)) { if(virtualFile.getPath().contains(priorityTemplate)) { priorityTargets.add(psiKey); } else { targets.add(psiKey); } } })); return true; }, GlobalSearchScope.getScopeRestrictedByFileTypes(GlobalSearchScope.allScope(getProject()), PhpFileType.INSTANCE)); priorityTargets.addAll(targets); return priorityTargets; }

Target:
public Collection<PsiElement> getPsiTargets(StringLiteralExpression element) { final String contents = element.getContents(); if(StringUtils.isBlank(contents)) { return Collections.emptyList(); } final String priorityTemplate = "/" + LaravelSettings.getInstance(element.getProject()).getMainLanguage() + "/"; final Set<PsiElement> priorityTargets = new LinkedHashSet<>(); final Set<PsiElement> targets = new LinkedHashSet<>(); FileBasedIndex.getInstance().getFilesWithKey(TranslationKeyStubIndex.KEY, new HashSet<>(Collections.singletonList(contents)), virtualFile -> { PsiFile psiFileTarget = PsiManager.getInstance(getProject()).findFile(virtualFile); if(psiFileTarget == null) { return true; } String namespace = TranslationUtil.getNamespaceFromFilePath(virtualFile.getPath()); if(namespace == null) { return true; } psiFileTarget.acceptChildren(new ArrayReturnPsiRecursiveVisitor(namespace, (key, psiKey, isRootElement) -> { if(!isRootElement && key.equalsIgnoreCase(contents)) { if(virtualFile.getPath().contains(priorityTemplate)) { priorityTargets.add(psiKey); } else { targets.add(psiKey); } } })); return true; }, GlobalSearchScope.getScopeRestrictedByFileTypes(GlobalSearchScope.allScope(getProject()), PhpFileType.INSTANCE)); priorityTargets.addAll(targets); return priorityTargets; }
Source:
public String getExecuteButtonLabel() { try { executeButtonLabel = System.getProperty("PROMOTION_BUILD_APPROVE_BUTTON_CUSTOM_LABEL"); if(executeButtonLabel == null) { executeButtonLabel = "Approve"; } } catch (Exception e) { e.printStackTrace(); executeButtonLabel = "Approve"; } return executeButtonLabel; }

Target:
public String getExecuteButtonLabel() { String label = System.getProperty(this.getClass().getSimpleName()+".approveButtonLabel"); if(null == label) { label = "Approve"; } return label; }
Source:
protected void executeRuntimeStep(OperationContext context, ModelNode operation) throws OperationFailedException { final ModelNode result = new ModelNode(); final PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR)); final String cacheContainerName = address.getElement(CACHE_CONTAINER_INDEX).getValue(); final String counterType = address.getElement(COUNTER_INDEX).getKey(); final String counterName = address.getElement(COUNTER_INDEX).getValue(); final ServiceController<?> controller = context.getServiceRegistry(false) .getService(CacheContainerServiceName.CACHE_CONTAINER.getServiceName(cacheContainerName)); Long value = null; if (controller != null) { DefaultCacheContainer cacheManager = (DefaultCacheContainer) controller.getValue(); CounterManager counterManager = EmbeddedCounterManagerFactory.asCounterManager(cacheManager); if (ModelKeys.STRONG_COUNTER.equals(counterType)) { StrongCounter sc = counterManager.getStrongCounter(counterName); try { value = sc.getValue().get(); } catch (Exception e) { throw new OperationFailedException("Can not get value from counter " + sc, e); } } else if (ModelKeys.WEAK_COUNTER.equals(counterType)) { WeakCounter wc = counterManager.getWeakCounter(counterName); value = wc.getValue(); } result.set(value); } context.getResult().set(result); }

Target:
protected void executeRuntimeStep(OperationContext context, ModelNode operation) throws OperationFailedException { final ModelNode result = new ModelNode(); final PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR)); final String cacheContainerName = address.getElement(CACHE_CONTAINER_INDEX).getValue(); final String counterType = address.getElement(COUNTER_INDEX).getKey(); final String counterName = address.getElement(COUNTER_INDEX).getValue(); final ServiceController<?> controller = context.getServiceRegistry(false) .getService(CacheContainerServiceName.CACHE_CONTAINER.getServiceName(cacheContainerName)); Long value = null; if (controller != null) { DefaultCacheContainer cacheManager = (DefaultCacheContainer) controller.getValue(); CounterManager counterManager = EmbeddedCounterManagerFactory.asCounterManager(cacheManager); if (ModelKeys.STRONG_COUNTER.equals(counterType)) { StrongCounter sc = counterManager.getStrongCounter(counterName); value = sc.sync().getValue(); } else { WeakCounter wc = counterManager.getWeakCounter(counterName); value = wc.sync().getValue(); } result.set(value); } context.getResult().set(result); }
Source:
public static final IntList lineMapOrBinary(final byte[] buf, int ptr, int end) throws BinaryBlobException { IntList map = new IntList((end - ptr) / 36); map.add(Integer.MIN_VALUE); boolean foundLF = true; for (; ptr < end; ptr++) { if (foundLF) { map.add(ptr); } if (buf[ptr] == '\0') { throw new BinaryBlobException(); } foundLF = (buf[ptr] == '\n'); } map.add(end); return map; }

Target:
public static final IntList lineMapOrBinary(final byte[] buf, int ptr, int end) throws BinaryBlobException { IntList map = new IntList((end - ptr) / 36); map.add(Integer.MIN_VALUE); boolean foundLF = true; for (; ptr < end; ptr++) { if (foundLF) { map.add(ptr); } if (buf[ptr] == '\0') { throw new BinaryBlobException() @Override { public Throwable fillInStackTrace() { return this; } }; } foundLF = (buf[ptr] == '\n'); } map.add(end); return map; }
Source:
public UpdateDynamicParametersCommand(String nodeSourceName) { this.nodeSourceName = nodeSourceName; }

Target:
public UpdateDynamicParametersCommand(String nodeSourceName) { super(nodeSourceName); }
Source:
public void setSetPath(String path) { setPath.set(requireNonNull(path, "path is null")); }

Target:
public void setSetPath(String path) { requireNonNull(path, "path is null"); setPath.set(path); }
Source:
private void loadANR(Activity activity, final ViewGroup root) { final ImageView fakeAnr = new ImageView(activity); fakeAnr.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); fakeAnr.setAdjustViewBounds(true); fakeAnr.setScaleType(ImageView.ScaleType.CENTER_INSIDE); root.addView(fakeAnr); for (int i = 0; i < 200; i++) { root.postDelayed( new Runnable() { @Override public void run() { fakeAnr.setImageResource(getRandomSelfie()); } }, i * ANR_INTERVAL ); } }

Target:
private void loadANR(Activity activity, final ViewGroup root) { final ImageView fakeAnr = new ImageView(activity); fakeAnr.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); fakeAnr.setAdjustViewBounds(true); fakeAnr.setScaleType(ImageView.ScaleType.CENTER_INSIDE); root.addView(fakeAnr); for (int i = 0; i < 200; i++) { root.postDelayed( new Runnable() { @Override public void run() { fakeAnr.setImageResource(makeItBreak()); } }, i * ANR_INTERVAL ); } }
Source:
public boolean addMac(String mac) { boolean retVal = true; boolean allowDuplicate = getAllowDuplicate(); lockObj.writeLock().lock(); try { if (allocatedMacs.contains(mac)) { retVal = allowDuplicate ? true : false; } else if (availableMacs.contains(mac)) { retVal = commitNewMac(mac); } else if (allocatedCustomMacs.contains(mac)) { retVal = allowDuplicate ? true : false; } else { allocatedCustomMacs.add(mac); } } finally { lockObj.writeLock().unlock(); } return retVal; }

Target:
public boolean addMac(String mac) { boolean retVal = false; lockObj.writeLock().lock(); try { if (availableMacs.contains(mac)) { retVal = commitNewMac(mac); } else if (allocatedMacs.containsKey(mac)) { retVal = addMacToMap(allocatedMacs, mac); } else { retVal = addMacToMap(allocatedCustomMacs, mac); } } finally { lockObj.writeLock().unlock(); } return retVal; }
Source:
protected void applyRow(Concept component, ConceptRow row, Collection<Concept> componentsToAttach) { component.setId(row.getId()); if (row.getEffectiveTime() != null) { component.setEffectiveTime(row.getEffectiveTime()); component.setReleased(true); } else { component.unsetEffectiveTime(); } component.setActive(row.isActive()); component.setModule(getOrCreate(row.getModuleId(), componentsToAttach)); component.setDefinitionStatus(getOrCreate(row.getDefinitionStatusId(), componentsToAttach)); component.setExhaustive(false); getImportContext().conceptVisited(row.getId()); }

Target:
protected void applyRow(Concept component, ConceptRow row, Collection<Concept> componentsToAttach) { if (row.getEffectiveTime() != null) { component.setEffectiveTime(row.getEffectiveTime()); component.setReleased(true); } else { component.unsetEffectiveTime(); } component.setActive(row.isActive()); component.setModule(getOrCreate(row.getModuleId(), componentsToAttach)); component.setDefinitionStatus(getOrCreate(row.getDefinitionStatusId(), componentsToAttach)); component.setExhaustive(false); getImportContext().conceptVisited(row.getId()); }
Source:
public FileStatus[] listStatus(Path f) throws FileNotFoundException, IOException { Path qualifiedPath = makeQualified(f); List<FileStatus> fileStatuses = fileStatusesByParentPath.get(qualifiedPath); if (fileStatuses == null) { throw new FileNotFoundException( String.format("Path '%s' (qualified: '%s') does not exist.", f, qualifiedPath)); } return cloneFileStatusList(fileStatuses); }

Target:
public FileStatus[] listStatus(Path f) throws FileNotFoundException, IOException { Path qualifiedPath = makeQualified(f); List<FileStatus> fileStatuses = fileStatusesByParentPath.get(qualifiedPath); if (fileStatuses == null) { throw new FileNotFoundException( String.format("Path '%s' (qualified: '%s') does not exist.", f, qualifiedPath)); } FileStatus[] result = new FileStatus[fileStatuses.size()]; for (int i = 0; i < fileStatuses.size(); i++) { result[i] = new FileStatus(fileStatuses.get(i)); } return result; }
Source:
public void testUpdateSite() throws Exception { File baseDir = getBasedir("projects/simple/p003"); Map<String, Object> params = new HashMap<String, Object>(); params.put("groupId", "group-p003"); params.put("version", "1.0.0"); params.put("aggregator", Boolean.FALSE); generate(baseDir, params); Model model = readModel(baseDir, "pom.xml"); assertEquals("group-p003", model.getGroupId()); assertEquals("p003", model.getArtifactId()); assertEquals("1.0.0", model.getVersion()); assertEquals("eclipse-repository", model.getPackaging()); }

Target:
public void testUpdateSite() throws Exception { File baseDir = getBasedir("projects/simple/p003"); Map<String, Object> params = new HashMap<String, Object>(); params.put("groupId", "group-p003"); params.put("version", "1.0.0"); params.put("aggregator", Boolean.FALSE); generate(baseDir, params); Model model = readModel(baseDir, "pom.xml"); assertEquals("group-p003", model.getGroupId()); assertEquals("p003", model.getArtifactId()); assertEquals("1.0.0", model.getVersion()); assertEquals("eclipse-update-site", model.getPackaging()); }
Source:
protected Optional<PlanNodeStatsEstimate> visitIsNotNullPredicate(IsNotNullPredicate node, Void context) { if (node.getValue() instanceof SymbolReference) { Symbol symbol = Symbol.from(node.getValue()); SymbolStatsEstimate symbolStats = input.getSymbolStatistics(symbol); PlanNodeStatsEstimate.Builder result = PlanNodeStatsEstimate.buildFrom(input); result.setOutputRowCount(input.getOutputRowCount() * (1 - symbolStats.getNullsFraction())); result.addSymbolStatistics(symbol, symbolStats.mapNullsFraction(x -> 0.0)); return Optional.of(result.build()); } return Optional.empty(); }

Target:
protected PlanNodeStatsEstimate visitIsNotNullPredicate(IsNotNullPredicate node, Void context) { if (node.getValue() instanceof SymbolReference) { Symbol symbol = Symbol.from(node.getValue()); SymbolStatsEstimate symbolStats = input.getSymbolStatistics(symbol); PlanNodeStatsEstimate.Builder result = PlanNodeStatsEstimate.buildFrom(input); result.setOutputRowCount(input.getOutputRowCount() * (1 - symbolStats.getNullsFraction())); result.addSymbolStatistics(symbol, symbolStats.mapNullsFraction(x -> 0.0)); return result.build(); } return PlanNodeStatsEstimate.unknown(); }
Source:
public Bucket getBucketMetadata() throws IOException, GeneralSecurityException { Storage client = StorageFactory.getService(sConfig.getPassword()); return client.buckets().get(sConfig.getBucket() + "a").execute(); }

Target:
public Bucket getBucketMetadata() throws IOException, GeneralSecurityException { Storage client = StorageFactory.getService(sConfig.getPassword()); return client.buckets().get(sConfig.getBucket()).execute(); }
Source:
public void invoke(String... parameters) { CmdLineParser parser = new CmdLineParser(this); try { parser.parseArgument(parameters); if (getParameters().isEmpty()) { throw new CmdLineException(parser, "asciidoctor: FAILED: input file missing"); } } catch (CmdLineException e) { System.err.println(e.getMessage()); parser.printUsage(System.err); return; } List<String> inputFiles = getParameters(); for (String inputFile : inputFiles) { Options options = parse(inputFile); String output = renderInput(options, inputFile); if(output != null) { System.out.println(output); } } }

Target:
public void invoke(String... parameters) { CmdLineParser parser = new CmdLineParser(this); try { try { parser.parseArgument(parameters); if (inputFiles.isEmpty()) { throw new CmdLineException(parser, "asciidoctor: FAILED: input file missing"); } } catch (CmdLineException e) { System.err.println(e.getMessage()); parser.printUsage(System.err); return; } Options options = parse(); ZipOutputStream zip = new ZipOutputStream(new FileOutputStream(zipFile)); for (String inputFile : inputFiles) { String output = renderInput(options, inputFile); zip.putNextEntry(new ZipEntry(mapInFileToOutFile(inputFile))); zip.write(output.getBytes()); zip.closeEntry(); } zip.close(); } catch (java.io.IOException e) { System.err.println(e.getMessage()); } }
Source:
public URLParams and(final String key, final boolean value) { map.put(key, "" + value); return this; }

Target:
public URLParams and(final String key, final boolean value) { map.put(key, String.valueOf(value)); return this; }
Source:
public ClusteredStoreConfiguration() { this(DEFAULT_CONSISTENCY, DEFAULT_CONCURRENCY); }

Target:
public ClusteredStoreConfiguration() { this(Consistency.EVENTUAL); }
Source:
public SoapHeaderMessagePriorityEndpointInterceptor messagePriorityInterceptor() { LOGGER.debug("Creating Message Priority Interceptor Bean"); return new SoapHeaderMessagePriorityEndpointInterceptor(MESSAGE_PRIORITY_HEADER); }

Target:
public SoapHeaderInterceptor messagePriorityInterceptor() { LOGGER.debug("Creating Message Priority Interceptor Bean"); return new SoapHeaderInterceptor(MESSAGE_PRIORITY_HEADER, MESSAGE_PRIORITY_HEADER); }
Source:
void setDefaults(final Context context, final String clientId) { sClientId = clientId; sApplicationName = context.getPackageName(); try { sApplicationVersion = context.getPackageManager().getPackageInfo(sApplicationName, 0).versionName; } catch (PackageManager.NameNotFoundException nnfe) { sApplicationVersion = "NA"; } sClientIp = "NA"; try { sDeviceId = StringExtensions.createHash(Secure.getString(context.getContentResolver(), Secure.ANDROID_ID)); } catch (UnsupportedEncodingException | NoSuchAlgorithmException e) { sDeviceId = ""; } if (mDefaultEventCount == 0) { setEvent(EventStrings.APPLICATION_NAME, sApplicationName); setEvent(EventStrings.APPLICATION_VERSION, sApplicationVersion); setEvent(EventStrings.CLIENT_ID, sClientId); setEvent(EventStrings.CLIENT_IP, sClientIp); setEvent(EventStrings.DEVICE_ID, sDeviceId); mDefaultEventCount = mEventList.size(); } }

Target:
void setDefaults(final Context context, final String clientId) { sClientId = clientId; sApplicationName = context.getPackageName(); try { sApplicationVersion = context.getPackageManager().getPackageInfo(sApplicationName, 0).versionName; } catch (PackageManager.NameNotFoundException nnfe) { sApplicationVersion = "NA"; } try { sDeviceId = StringExtensions.createHash(Secure.getString(context.getContentResolver(), Secure.ANDROID_ID)); } catch (UnsupportedEncodingException | NoSuchAlgorithmException e) { sDeviceId = ""; } if (mDefaultEventCount == 0) { setProperty(EventStrings.APPLICATION_NAME, sApplicationName); setProperty(EventStrings.APPLICATION_VERSION, sApplicationVersion); setProperty(EventStrings.CLIENT_ID, sClientId); setProperty(EventStrings.DEVICE_ID, sDeviceId); mDefaultEventCount = mEventList.size(); } }
Source:
public void onMessage(Message jmsMessage) { logger.debug("message get " + jmsMessage.toString()); try { if (jmsMessage instanceof ObjectMessage) { Object messageObject = ((ObjectMessage) jmsMessage).getObject(); try { T message = (T) messageObject; onMessage(message); } catch (ClassCastException e) { throw new IllegalStateException("Received message of wrong payload type " + messageObject.getClass() + " to destination " + getDestinationName(jmsMessage)); } } else { logger.warn("Received message of wrong type to destination {}", jmsMessage.getClass().getName(), getDestinationName(jmsMessage)); } } catch (JMSException e) { throw new MessageDeliveryException("Failed to handle message from destination " + getDestinationName(jmsMessage), e); } }

Target:
public void onMessage(Message jmsMessage) { logger.debug("message get {}", jmsMessage.toString()); try { if (jmsMessage instanceof ObjectMessage) { Object messageObject = ((ObjectMessage) jmsMessage).getObject(); try { T message = (T) messageObject; onMessage(message); } catch (ClassCastException e) { throw new IllegalStateException("Received message of wrong payload type " + messageObject.getClass() + " to destination " + getDestinationName(jmsMessage)); } } else { logger.warn("Received message of wrong type to destination {}", jmsMessage.getClass().getName(), getDestinationName(jmsMessage)); } } catch (JMSException e) { throw new MessageDeliveryException("Failed to handle message from destination " + getDestinationName(jmsMessage), e); } }
Source:
@Override protected void beforeTest() throws Exception { startGridsMultiThreaded(GRID_CNT - 2); Ignite grid = startClientGrid(GRID_CNT - 2); grid.createNearCache(DEFAULT_CACHE_NAME, new NearCacheConfiguration()); grid = startGrid(GRID_CNT - 1); grid.cache(DEFAULT_CACHE_NAME); }

Target:
@Override protected void beforeTest() throws Exception { startGridsMultiThreaded(GRID_CNT - 2); Ignite grid = startClientGrid(GRID_CNT - 2); grid.createNearCache(DEFAULT_CACHE_NAME, new NearCacheConfiguration()); grid = startClientGrid(GRID_CNT - 1); grid.cache(DEFAULT_CACHE_NAME); }
Source:
public void runCollectionsTest() { Path workingPath = createTestDirectory(workingDirsRoot, "collections-test"); String packageName = "foo.bar"; String regressionBasename = "TestClass"; String errorBasename = ""; List<String> options = getStandardOptions(workingPath, packageName, regressionBasename, errorBasename); options.add("--no-error-revealing-tests"); options.add("--inputlimit=500"); options.add("--testclass=java2.util2.TreeSet"); options.add("--testclass=java2.util2.Collections"); options.add("--npe-on-null-input=EXPECTED"); options.add("--debug_checks"); options.add("--observers=resources/systemTest/randoop1_observers.txt"); options.add("--omit-field-list=resources/systemTest/testclassomitfields.txt"); long startTime = System.currentTimeMillis(); long timeout = 600000L; RandoopRunDescription randoopRunDesc = generateAndCompile( classpath, workingPath, packageName, regressionBasename, errorBasename, options, timeout); long endTime = System.currentTimeMillis(); System.out.println("runCollectionTest took: " + (endTime - startTime) + " milliseconds"); assertThat("...has regression tests", randoopRunDesc.regressionTestCount, is(greaterThan(0))); TestRunDescription testRunDesc = runTests(classpath, workingPath, packageName, regressionBasename); assertThat( "all regression tests should pass", testRunDesc.testsSucceed, is(equalTo(randoopRunDesc.regressionTestCount))); assertThat("...has no error tests", randoopRunDesc.errorTestCount, is(equalTo(0))); }

Target:
public void runCollectionsTest() { Path workingPath = createTestDirectory(workingDirsRoot, "collections-test"); String packageName = "foo.bar"; String regressionBasename = "TestClass"; String errorBasename = ""; List<String> options = getStandardOptions(workingPath, packageName, regressionBasename, errorBasename); options.add("--no-error-revealing-tests"); options.add("--inputlimit=500"); options.add("--testclass=java2.util2.TreeSet"); options.add("--testclass=java2.util2.Collections"); options.add("--npe-on-null-input=EXPECTED"); options.add("--debug_checks"); options.add("--observers=resources/systemTest/randoop1_observers.txt"); options.add("--omit-field-list=resources/systemTest/testclassomitfields.txt"); long startTime = System.currentTimeMillis(); long timeout = 600000L; RandoopRunDescription randoopRunDesc = generateAndCompile( classpath, workingPath, packageName, regressionBasename, errorBasename, options, timeout); long endTime = System.currentTimeMillis(); assertThat("...has regression tests", randoopRunDesc.regressionTestCount, is(greaterThan(0))); TestRunDescription testRunDesc = runTests(classpath, workingPath, packageName, regressionBasename); assertThat( "all regression tests should pass", testRunDesc.testsSucceed, is(equalTo(randoopRunDesc.regressionTestCount))); assertThat("...has no error tests", randoopRunDesc.errorTestCount, is(equalTo(0))); }
Source:
private Map<String, Object> createEvent() { Map<String, Object> event = new HashMap<String, Object>(); event.put("timestamp", dateFormat.format(new Date())); event.put("dim1", rand.nextLong()); event.put("dim2", rand.nextInt()); return event; }

Target:
private Map<String, Object> createEvent() { Map<String, Object> event = new HashMap<String, Object>(); event.put("timestamp", new DateTime().toString()); event.put("dim1", rand.nextLong()); event.put("dim2", rand.nextInt()); return event; }
Source:
public GavinJobExecution findGavinJobExecution(String jobIdentifier) throws JobNotFoundException { GavinJobExecution result = dataService.findOneById(GAVIN_JOB_EXECUTION, jobIdentifier, GavinJobExecution.class); if (result == null) { throw new JobNotFoundException(); } return result; }

Target:
public GavinJobExecution findGavinJobExecution(String jobIdentifier) { GavinJobExecution result = dataService.findOneById(GAVIN_JOB_EXECUTION, jobIdentifier, GavinJobExecution.class); if (result == null) { throw new UnknownEntityException(gavinJobExecutionMetaData, jobIdentifier); } return result; }
Source:
private static String[][] extractRequires(IInstallableUnit iu) { Collection<IRequirement> requyres = iu.getRequirements(); String[][] tuples = new String[requyres.size()][4]; int i = 0; for (IRequirement iRequirement : requyres) { IRequiredCapability next = (IRequiredCapability) iRequirement; tuples[i++] = new String[] {next.getNamespace(), next.getName(), next.getRange().toString(), Boolean.valueOf(next.getMin() == 0).toString()}; } return tuples; }

Target:
private static String[][] extractRequires(IInstallableUnit iu) { Collection<IRequirement> requirements = iu.getRequirements(); String[][] tuples = new String[requirements.size()][4]; int i = 0; for (IRequirement requirement : requirements) { IRequiredCapability capability = (IRequiredCapability) requirement; tuples[i++] = new String[] {capability.getNamespace(), capability.getName(), capability.getRange().toString(), Boolean.valueOf(capability.getMin() == 0).toString()}; } return tuples; }