auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private String getTokenValue(String str) { if (str != null) { if (prefixPattern==null) { prefixPattern = Pattern.compile(prefix); } if (postfixPattern==null) { postfixPattern = Pattern.compile(postfix); } Matcher prefixMatcher = this.prefixPattern.matcher(str); if (prefixMatcher.find()) { int tokenStart = prefixMatcher.end(); String str2 = str.substring(tokenStart); Matcher postfixMatcher = this.postfixPattern.matcher(str2); if (postfixMatcher.find()) { int tokenEnd = postfixMatcher.start(); return str2.substring(0, tokenEnd); } } } return null; }

Target:
private String getTokenValue(String str) { if (str != null) { checkPatterns(); Matcher prefixMatcher = this.prefixPattern.matcher(str); if (prefixMatcher.find()) { int tokenStart = prefixMatcher.end(); String str2 = str.substring(tokenStart); Matcher postfixMatcher = this.postfixPattern.matcher(str2); if (postfixMatcher.find()) { int tokenEnd = postfixMatcher.start(); return str2.substring(0, tokenEnd); } } } return null; }
Source:
public boolean canAccessTarget(AsyncJobStatus target, SubResource subResource, Access required) { if (isOwnerInvalid(target)) { return false; } String principal = target.getPrincipal(); boolean principalMatch = principal != null && principal.equals(this.principalName); if ("user".equalsIgnoreCase(principalType)) { Access allowed = principalMatch ? Access.ALL : Access.READ_ONLY; return allowed.provides(required); } else if ("consumer".equalsIgnoreCase(principalType)) { return principalMatch && Access.ALL.provides(required); } return false; }

Target:
public boolean canAccessTarget(AsyncJobStatus target, SubResource subResource, Access required) { String principal = target.getPrincipalName(); boolean principalMatch = principal != null && principal.equals(this.principalName); if ("user".equalsIgnoreCase(principalType)) { Access allowed = principalMatch ? Access.ALL : Access.READ_ONLY; return allowed.provides(required); } else if ("consumer".equalsIgnoreCase(principalType)) { return principalMatch && Access.ALL.provides(required); } return false; }
Source:
public <T> T transact( RetryLogic logic, AccessMode mode, Function<Transaction, T> work ) throws NotCommittedException, ServiceUnavailableException { int remaining = logic.attempts(); while ( remaining > 0 ) { try ( Session session = session( mode ) ) { boolean failed = false; Transaction tx = session.beginTransaction(); try { T result = work.apply( tx ); tx.success(); return result; } catch ( SessionExpiredException e ) { failed = true; tx.failure(); remaining -= 1; } finally { if ( failed ) { try { tx.close(); } catch ( Exception ex ) { } } else { tx.close(); } } } try { Thread.sleep( logic.pause() ); } catch ( InterruptedException e ) { throw new NotCommittedException( format( "Interrupted after %d attempts", logic.attempts() - remaining ) ); } } throw new NotCommittedException( format( "Unable to commit transaction after %d attempts", logic.attempts() ) ); }

Target:
public <T> T transact( RetryLogic logic, AccessMode mode, Function<Transaction, T> work ) throws NotCommittedException, ServiceUnavailableException { int remaining = logic.attempts(); while ( remaining > 0 ) { try ( Session session = session( mode ) ) { boolean failed = false; Transaction tx = session.beginTransaction(); try { T result = work.apply( tx ); tx.success(); return result; } catch ( SessionExpiredException e ) { failed = true; tx.failure(); remaining -= 1; } finally { if ( failed ) { try { tx.close(); } catch ( Exception ex ) { } } else { tx.close(); } } } try { Thread.sleep( logic.pauseMillis() ); } catch ( InterruptedException e ) { throw new NotCommittedException( format( "Interrupted after %d attempts", logic.attempts() - remaining ) ); } } throw new NotCommittedException( format( "Unable to commit transaction after %d attempts", logic.attempts() ) ); }
Source:
protected GithubUrl withBranch(String branch) { if (!isNullOrEmpty(branch)) { this.branch = branch; } return this; }

Target:
protected GithubUrl withBranch(String branch) { if (!Strings.isNullOrEmpty(branch)) { this.branch = branch; } return this; }
Source:
public void visitNode(Tree tree) { if (!hasSemantic()) { return; } ModifiersTree modifiers; Symbol symbol; if (tree.is(Tree.Kind.METHOD)) { MethodTree methodTree = (MethodTree) tree; symbol = methodTree.symbol(); modifiers = methodTree.modifiers(); } else { ClassTree classTree = (ClassTree) tree; symbol = classTree.symbol(); modifiers = classTree.modifiers(); } if (symbol.metadata().isAnnotatedWith("org.junit.jupiter.api.Test") && !symbol.isPackageVisibility()) { Tree questionableNode = modifiers.modifiers().parallelStream() .filter(keywordTree -> { Modifier modifier = keywordTree.modifier(); return modifier.equals(Modifier.PUBLIC) || modifier.equals(Modifier.PRIVATE) || modifier.equals(Modifier.PROTECTED); }) .map(modifierKeywordTree -> (Tree) modifierKeywordTree) .findFirst() .orElse(tree); reportIssue(questionableNode, "Remove this access modifier"); } }

Target:
public void visitNode(Tree tree) { if (!hasSemantic()) { return; } ClassTree classTree = (ClassTree) tree; List<MethodTree> testMethods = classTree.members().stream() .filter(member -> member.is(Tree.Kind.METHOD)) .map(MethodTree.class::cast) .filter(UnitTestUtils::hasJUnit5TestAnnotation) .collect(Collectors.toList()); testMethods.stream().map(MethodTree::modifiers).forEach(this::raiseIssueOnPresentAccessModifiers); if (!testMethods.isEmpty()) { raiseIssueOnPresentAccessModifiers(classTree.modifiers()); } }
Source:
private JsonValue getPositionalPlaceholderValues(ParameterAccessor accessor) { JsonArray posValues = JsonArray.create(); for (Parameter parameter : this.queryMethod.getParameters().getBindableParameters()) { Object value = couchbaseConverter.convertForWriteIfNeeded(accessor.getBindableValue(parameter.getIndex())); try { posValues.add(value); }catch(InvalidArgumentException iae){ Object o = accessor.getBindableValue(parameter.getIndex()); if(o instanceof Object[]) { Object[] array=(Object[])o; JsonArray ja=JsonValue.ja(); for(Object e:array) { ja.add(String.valueOf(couchbaseConverter.convertForWriteIfNeeded(e))); } posValues.add(ja); } else { throw iae; } } } return posValues; }

Target:
private JsonValue getPositionalPlaceholderValues(ParameterAccessor accessor) { JsonArray posValues = JsonArray.create(); for (Parameter parameter : this.queryMethod.getParameters().getBindableParameters()) { Object rawValue = accessor.getBindableValue(parameter.getIndex()); Object value = couchbaseConverter.convertForWriteIfNeeded(rawValue); putPositionalValue(accessor, parameter, posValues, value); } return posValues; }
Source:
private void removeMachine(String workspaceId, String machineId) { try (StripedLocks.WriteLock lock = stripedLocks.acquireWriteLock(workspaceId)) { EnvironmentHolder environmentHolder = environments.get(workspaceId); if (environmentHolder != null) { for (int i = 0; i < environmentHolder.machines.size(); i++) { if (environmentHolder.machines.get(i).getId().equals(machineId)) { environmentHolder.machines.remove(i); return; } } } } }

Target:
private void removeMachine(String workspaceId, String machineId) { try (StripedLocks.WriteLock lock = stripedLocks.acquireWriteLock(workspaceId)) { EnvironmentHolder environmentHolder = environments.get(workspaceId); if (environmentHolder != null) { removeFirstMatching(environmentHolder.machines, m -> m.getId().equals(machineId)); } } }
Source:
public ImageContent(Bitmap img, String caption) throws ContentException { Objects.requireNonNull(img); mImage = Bitmap.createBitmap(img); mCaption = caption; }

Target:
public ImageContent(Bitmap img, String caption) throws ContentException { Objects.requireNonNull(img); mImage = Bitmap.createBitmap(img); mCaption = Objects.requireNonNull(caption); }
Source:
public Map<UUID, StreamAddressSpace> getStreamsAddressSpace(List<StreamAddressRange> streamsAddressesRange) { StreamsAddressResponse streamsAddressResponse = layoutHelper(e -> CFUtils.getUninterruptibly(e.getPrimarySequencerClient() .getStreamsAddressSpace(streamsAddressesRange))); return streamsAddressResponse.getAddressMap(); }

Target:
public Map<UUID, StreamAddressSpace> getStreamsAddressSpace(List<StreamAddressRange> streamsAddressesRange) { Supplier<Map<UUID, StreamAddressSpace>> streamsAddressResponseSupplier = () -> layoutHelper(e -> CFUtils.getUninterruptibly(e.getPrimarySequencerClient() .getStreamsAddressSpace(streamsAddressesRange)).getAddressMap()); return streamAddressRangeTimer.map(timer -> timer.record(streamsAddressResponseSupplier)) .orElseGet(() -> streamsAddressResponseSupplier.get()); }
Source:
private Range getRangeFromBehavior(String executionBehavior) { Range range; int startRowLimit = 1; int endRowLimit = docDisplay_.getRowCount(); Scope scope = docDisplay_.getCurrentChunk(); if (scope != null) { startRowLimit = scope.getBodyStart().getRow(); endRowLimit = scope.getEnd().getRow() - 1; } if (executionBehavior == UIPrefsAccessor.EXECUTE_STATEMENT) { range = docDisplay_.getMultiLineExpr( docDisplay_.getCursorPosition(), startRowLimit, endRowLimit); } else if (executionBehavior == UIPrefsAccessor.EXECUTE_PARAGRAPH) { range = docDisplay_.getParagraph( docDisplay_.getCursorPosition(), startRowLimit, endRowLimit); } else { int row = docDisplay_.getCursorPosition().getRow(); range = Range.fromPoints( Position.create(row, 0), Position.create(row, docDisplay_.getLength(row))); } return range; }

Target:
private Range getRangeFromBehavior(String executionBehavior) { Range range; int startRowLimit = 0; int endRowLimit = docDisplay_.getRowCount(); Scope scope = docDisplay_.getCurrentChunk(); if (scope != null) { startRowLimit = scope.getBodyStart().getRow(); endRowLimit = scope.getEnd().getRow() - 1; } if (executionBehavior == UIPrefsAccessor.EXECUTE_STATEMENT) { range = docDisplay_.getMultiLineExpr( docDisplay_.getCursorPosition(), startRowLimit, endRowLimit); } else if (executionBehavior == UIPrefsAccessor.EXECUTE_PARAGRAPH) { range = docDisplay_.getParagraph( docDisplay_.getCursorPosition(), startRowLimit, endRowLimit); } else { int row = docDisplay_.getCursorPosition().getRow(); range = Range.fromPoints( Position.create(row, 0), Position.create(row, docDisplay_.getLength(row))); } return range; }
Source:
void create(TreeLogger logger, JArrayType targetType) throws UnableToCompleteException { this.targetType = targetType; this.componentType = targetType.getComponentType(); if (componentType.isPrimitive() != null || SerializerCreator.isBoxedPrimitive(componentType)) { logger.log(TreeLogger.DEBUG, "No need to create array deserializer for primitive array " + targetType); return; } if (deserializerFor(targetType) != null) return; logger.log(TreeLogger.DEBUG, "Creating result deserializer for " + targetType.getSimpleSourceName()); final SourceWriter srcWriter = getSourceWriter(logger, context); if (srcWriter == null) return; final String dsn = getDeserializerQualifiedName(targetType); generatedDeserializers.put(targetType.getQualifiedSourceName(), dsn); generateSingleton(srcWriter); generateInstanceMembers(srcWriter); generateFromResult(srcWriter); srcWriter.commit(logger); }

Target:
void create(TreeLogger logger, JArrayType targetType) throws UnableToCompleteException { this.targetType = targetType; this.componentType = targetType.getComponentType(); if (componentType.isPrimitive() != null || SerializerCreator.isBoxedPrimitive(componentType)) { logger.log(TreeLogger.DEBUG, "No need to create array deserializer for primitive array " + targetType); return; } if (deserializerFor(targetType) != null) { return; } logger.log(TreeLogger.DEBUG, "Creating result deserializer for " + targetType.getSimpleSourceName()); final SourceWriter srcWriter = getSourceWriter(logger, context); if (srcWriter == null) { return; } final String dsn = getDeserializerQualifiedName(targetType); generatedDeserializers.put(targetType.getQualifiedSourceName(), dsn); generateSingleton(srcWriter); generateInstanceMembers(srcWriter); generateFromResult(srcWriter); srcWriter.commit(logger); }
Source:
private static String loadTaskForm(String taskForm) { String taskFormJson = ""; try { taskFormJson = Resources.toString(FormValuesProcessorTest.class.getResource(taskForm), Charsets.UTF_8); } catch (IOException e) { e.printStackTrace(); } return taskFormJson; }

Target:
private static String loadTaskForm(String taskForm) throws IOException { return Resources.toString(FormValuesProcessorTest.class.getResource(taskForm), Charsets.UTF_8); }
Source:
BingTile(int x, int y, int zoomLevel) { this.x = x; this.y = y; this.zoomLevel = zoomLevel; }

Target:
private BingTile(int x, int y, int zoomLevel) { checkArgument(zoomLevel <= MAX_ZOOM_LEVEL); this.x = x; this.y = y; this.zoomLevel = zoomLevel; }
Source:
private void resetRoutingTableAndNotify(long startTime, RoutingTable newRoutingTable) { _routingTableRef.set(newRoutingTable); String clusterName = _helixManager != null ? _helixManager.getClusterName() : null; logger.info("Refresh the RoutingTable for cluster {}, takes ms.", clusterName, (System.currentTimeMillis() - startTime)); notifyRoutingTableChange(_helixManager != null ? _helixManager.getClusterName() : null); if (_isPeriodicRefreshEnabled) { _lastRefreshTimestamp = System.currentTimeMillis(); } }

Target:
private void resetRoutingTableAndNotify(long startTime, RoutingTable newRoutingTable) { _routingTableRef.set(newRoutingTable); String clusterName = _helixManager != null ? _helixManager.getClusterName() : null; logger.info("Refreshed the RoutingTable for cluster {}, took ms.", clusterName, (System.currentTimeMillis() - startTime)); notifyRoutingTableChange(clusterName); if (_isPeriodicRefreshEnabled) { _lastRefreshTimestamp = System.currentTimeMillis(); } }
Source:
private PreparedStatement prepareStatementFromFieldsAndTableName() { if (tablename == null || tablename.length() == 0) { throw new RuntimeException("Please sepcify query or table name."); } StringBuilder queryfields = new StringBuilder(); StringBuilder values = new StringBuilder(); for (FieldInfo fieldInfo : fieldInfos) { if (queryfields.length() == 0) { queryfields.append(fieldInfo.getColumnName()); values.append("?"); } else { queryfields.append(",").append(fieldInfo.getColumnName()); values.append(",").append("?"); } } String statement = "INSERT INTO " + store.keyspace + "." + tablename + " (" + queryfields.toString() + ") " + "VALUES (" + values.toString() + ");"; return store.getSession().prepare(statement); }

Target:
private PreparedStatement prepareStatementFromFieldsAndTableName() { if (tablename == null || tablename.length() == 0) { throw new RuntimeException("Please sepcify query or table name."); } StringBuilder queryfields = new StringBuilder(); StringBuilder values = new StringBuilder(); for (FieldInfo fieldInfo: fieldInfos) { if (queryfields.length() == 0) { queryfields.append(fieldInfo.getColumnName()); values.append("?"); } else { queryfields.append(",").append(fieldInfo.getColumnName()); values.append(",").append("?"); } } String statement = "INSERT INTO " + store.keyspace + "." + tablename + " (" + queryfields.toString() + ") " + "VALUES (" + values.toString() + ");"; LOG.debug("statement is {}", statement); return store.getSession().prepare(statement); }
Source:
private String getClaims(String httpResponseContentStr) { JsonElement root = new JsonParser().parse(httpResponseContentStr); String claims = root.getAsJsonObject().get("claims").getAsString(); return claims; }

Target:
private String getClaims(String httpResponseContentStr) { JsonElement root = new JsonParser().parse(httpResponseContentStr); JsonElement claims = root.getAsJsonObject().get("claims"); return claims != null ? claims.getAsString() : null; }
Source:
public void test() { FileLinesContextFactory fileLinesContextFactory = mock(FileLinesContextFactory.class); DefaultFileSystem fileSystem = new DefaultFileSystem(Paths.get("")); FileLinesContext fileLinesContext = mock(FileLinesContext.class); File file = new File(BASE_DIR, "file_lines.py"); DefaultInputFile inputFile = new DefaultInputFile(TestUtils.MODULE, file.getPath()); fileSystem.add(inputFile); when(fileLinesContextFactory.createFor(inputFile)).thenReturn(fileLinesContext); SquidAstVisitor<Grammar> visitor = new FileLinesVisitor(fileLinesContextFactory, fileSystem); PythonAstScanner.scanSingleFile(file, visitor); verify(fileLinesContext).setIntValue(CoreMetrics.NCLOC_DATA_KEY, 1, 0); verify(fileLinesContext).setIntValue(CoreMetrics.NCLOC_DATA_KEY, 2, 1); verify(fileLinesContext).setIntValue(CoreMetrics.NCLOC_DATA_KEY, 3, 0); verify(fileLinesContext).setIntValue(CoreMetrics.NCLOC_DATA_KEY, 4, 1); verify(fileLinesContext).setIntValue(CoreMetrics.NCLOC_DATA_KEY, 5, 0); verify(fileLinesContext).setIntValue(CoreMetrics.COMMENT_LINES_DATA_KEY, 1, 1); verify(fileLinesContext).setIntValue(CoreMetrics.COMMENT_LINES_DATA_KEY, 2, 0); verify(fileLinesContext).setIntValue(CoreMetrics.COMMENT_LINES_DATA_KEY, 3, 0); verify(fileLinesContext).setIntValue(CoreMetrics.COMMENT_LINES_DATA_KEY, 4, 1); verify(fileLinesContext).setIntValue(CoreMetrics.COMMENT_LINES_DATA_KEY, 5, 0); verify(fileLinesContext).save(); verifyNoMoreInteractions(fileLinesContext); }

Target:
public void test() { FileLinesContextFactory fileLinesContextFactory = mock(FileLinesContextFactory.class); DefaultFileSystem fileSystem = new DefaultFileSystem(Paths.get("")); FileLinesContext fileLinesContext = mock(FileLinesContext.class); File file = new File(BASE_DIR, "file_lines.py"); DefaultInputFile inputFile = new DefaultInputFile("", file.getPath()); fileSystem.add(inputFile); when(fileLinesContextFactory.createFor(inputFile)).thenReturn(fileLinesContext); SquidAstVisitor<Grammar> visitor = new FileLinesVisitor(fileLinesContextFactory, fileSystem); PythonAstScanner.scanSingleFile(file, visitor); verify(fileLinesContext).setIntValue(CoreMetrics.NCLOC_DATA_KEY, 1, 0); verify(fileLinesContext).setIntValue(CoreMetrics.NCLOC_DATA_KEY, 2, 1); verify(fileLinesContext).setIntValue(CoreMetrics.NCLOC_DATA_KEY, 3, 0); verify(fileLinesContext).setIntValue(CoreMetrics.NCLOC_DATA_KEY, 4, 1); verify(fileLinesContext).setIntValue(CoreMetrics.NCLOC_DATA_KEY, 5, 0); verify(fileLinesContext).setIntValue(CoreMetrics.COMMENT_LINES_DATA_KEY, 1, 1); verify(fileLinesContext).setIntValue(CoreMetrics.COMMENT_LINES_DATA_KEY, 2, 0); verify(fileLinesContext).setIntValue(CoreMetrics.COMMENT_LINES_DATA_KEY, 3, 0); verify(fileLinesContext).setIntValue(CoreMetrics.COMMENT_LINES_DATA_KEY, 4, 1); verify(fileLinesContext).setIntValue(CoreMetrics.COMMENT_LINES_DATA_KEY, 5, 0); verify(fileLinesContext).save(); verifyNoMoreInteractions(fileLinesContext); }
Source:
public NameEnvironmentAnswer findClass(char[] typeName, String qualifiedPackageName, String qualifiedBinaryFileName, boolean asBinaryOnly) { if (!isPackage(qualifiedPackageName)) return null; try { IBinaryType reader = ClassFileReader.read(this.zipFile, qualifiedBinaryFileName); if (reader != null) { if (this.annotationPaths != null) { String qualifiedClassName = qualifiedBinaryFileName.substring(0, qualifiedBinaryFileName.length()-SuffixConstants.EXTENSION_CLASS.length()-1); for (String annotationPath : this.annotationPaths) { try { if (this.annotationZipFile == null) { this.annotationZipFile = ClassWithExternalAnnotations.getAnnotationZipFile(annotationPath, null); } IBinaryType nextReader = ClassWithExternalAnnotations.create(reader, annotationPath, qualifiedClassName, this.annotationZipFile); if (nextReader.getExternalAnnotationStatus() == ExternalAnnotationStatus.TYPE_IS_ANNOTATED) { reader = nextReader; break; } } catch (IOException e) { } } } return new NameEnvironmentAnswer(reader, fetchAccessRestriction(qualifiedBinaryFileName)); } } catch(ClassFormatException e) { } catch (IOException e) { } return null; }

Target:
public NameEnvironmentAnswer findClass(char[] typeName, String qualifiedPackageName, String qualifiedBinaryFileName, boolean asBinaryOnly) { if (!isPackage(qualifiedPackageName)) return null; try { IBinaryType reader = ClassFileReader.read(this.zipFile, qualifiedBinaryFileName); if (reader != null) { if (this.annotationPaths != null) { String qualifiedClassName = qualifiedBinaryFileName.substring(0, qualifiedBinaryFileName.length()-SuffixConstants.EXTENSION_CLASS.length()-1); for (String annotationPath : this.annotationPaths) { try { if (this.annotationZipFile == null) { this.annotationZipFile = ClassWithExternalAnnotations.getAnnotationZipFile(annotationPath, null); } reader = ClassWithExternalAnnotations.create(reader, annotationPath, qualifiedClassName, this.annotationZipFile); if (reader.getExternalAnnotationStatus() == ExternalAnnotationStatus.TYPE_IS_ANNOTATED) { break; } } catch (IOException e) { } } } return new NameEnvironmentAnswer(reader, fetchAccessRestriction(qualifiedBinaryFileName)); } } catch(ClassFormatException e) { } catch (IOException e) { } return null; }
Source:
public void testIdleExpiryInPutAll() throws InterruptedException { Cache<String, String> cache = cm.getCache(); final long idleTime = EXPIRATION_TIMEOUT; Map<String, String> m = new HashMap<String, String>(); m.put("k1", "v"); m.put("k2", "v"); long start = now(); cache.putAll(m, -1, MILLISECONDS, idleTime, MILLISECONDS); assert "v".equals(cache.get("k1")) || moreThanLifespanElapsed(start, idleTime); assert "v".equals(cache.get("k2")) || moreThanLifespanElapsed(start, idleTime); Thread.sleep(idleTime + 100); assert cache.get("k1") == null; assert cache.get("k2") == null; }

Target:
public void testIdleExpiryInPutAll() throws InterruptedException { Cache<String, String> cache = cm.getCache(); final long idleTime = EXPIRATION_TIMEOUT; Map<String, String> m = new HashMap<String, String>(); m.put("k1", "v"); m.put("k2", "v"); long start = now(); cache.putAll(m, -1, MILLISECONDS, idleTime, MILLISECONDS); assert "v".equals(cache.get("k1")) || moreThanDurationElapsed(start, idleTime); assert "v".equals(cache.get("k2")) || moreThanDurationElapsed(start, idleTime); Thread.sleep(idleTime + 100); assert cache.get("k1") == null; assert cache.get("k2") == null; }
Source:
Store.ValueHolder<V> getOrComputeIfAbsent(K key, Function<K, Store.ValueHolder<V>> source) throws CacheAccessException; void invalidate(K key) throws CacheAccessException; void invalidate(K key, NullaryFunction<K> invalidator) throws CacheAccessException; void invalidate() throws CacheAccessException; void setInvalidationListener(InvalidationListener<K, V> invalidationListener); interface InvalidationListener<K, V> { void onInvalidation(K key, Store.ValueHolder<V> valueHolder); }

Target:
Store.ValueHolder<V> getOrComputeIfAbsent(K key, Function<K, Store.ValueHolder<V>> source) throws CacheAccessException; void invalidate(K key) throws CacheAccessException; void invalidate(K key, NullaryFunction<K> function) throws CacheAccessException; void invalidate() throws CacheAccessException; void setInvalidationListener(InvalidationListener<K, V> invalidationListener); interface InvalidationListener<K, V> { void onInvalidation(K key, Store.ValueHolder<V> valueHolder); }
Source:
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); if (client) ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setForceServerMode(true); cfg.setUserAttributes(F.asMap(TEST_ATTRIBUTE_NAME, testAttribute)); CacheConfiguration cacheCfg = new CacheConfiguration(DEFAULT_CACHE_NAME); cacheCfg.setCacheMode(CacheMode.REPLICATED); cacheCfg.setName(STATIC_CACHE_NAME); cfg.setCacheConfiguration(cacheCfg); cfg.setIncludeEventTypes(EventType.EVT_CACHE_STARTED, EventType.EVT_CACHE_STOPPED, EventType.EVT_CACHE_NODES_LEFT); if (daemon) cfg.setDaemon(true); return cfg; }

Target:
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); if (cfg.isClientMode()) ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setForceServerMode(true); cfg.setUserAttributes(F.asMap(TEST_ATTRIBUTE_NAME, testAttribute)); CacheConfiguration cacheCfg = new CacheConfiguration(DEFAULT_CACHE_NAME); cacheCfg.setCacheMode(CacheMode.REPLICATED); cacheCfg.setName(STATIC_CACHE_NAME); cfg.setCacheConfiguration(cacheCfg); cfg.setIncludeEventTypes(EventType.EVT_CACHE_STARTED, EventType.EVT_CACHE_STOPPED, EventType.EVT_CACHE_NODES_LEFT); if (daemon) cfg.setDaemon(true); return cfg; }
Source:
public void update(@NotNull final String host, @NotNull final int hport, @NotNull final String server, @NotNull final int sport) { try { new Shell.Plain( new SSH( Manifests.read("Thindeck-LoadBalancer-Host"), Integer.parseInt( Manifests.read("Thindeck-LoadBalancer-Port") ), Manifests.read("Thindeck-LoadBalancer-User"), FileUtils.readFileToString( new File( Manifests.read("Thindeck-LoadBalancer-Key-File") ) ) ) ).exec( Joiner.on(";").join( String.format( "cd %s", Manifests.read("Thindeck-LoadBalancer-Directory") ), "TMPFILE=`mktemp`", String.format( "cat %s.hosts.conf | sed -r 's/}/ server %s:%d;\\n}/' > $TMPFILE", host, server, sport ), String.format("mv $TMPFILE %s.hosts.conf", host), "pkill -HUP -f ngnix" ) ); } catch (final UnknownHostException ex) { throw new IllegalStateException(ex); } catch (final IOException ex) { throw new IllegalStateException(ex); } }

Target:
public void update(@NotNull final String host, @NotNull final int hport, @NotNull final String server, @NotNull final int sport) { try { new Shell.Plain( new SSH( Manifests.read("Thindeck-LoadBalancer-Host"), Integer.parseInt( Manifests.read("Thindeck-LoadBalancer-Port") ), Manifests.read("Thindeck-LoadBalancer-User"), FileUtils.readFileToString( new File( Manifests.read("Thindeck-LoadBalancer-Key-File") ) ) ) ).exec( Joiner.on(";").join( String.format( "cd %s", Manifests.read("Thindeck-LoadBalancer-Directory") ), "TMPFILE=`mktemp`", String.format( "cat %s.hosts.conf | sed -r 's/}/ server %s:%d;\\n}/' > $TMPFILE", host, server, sport ), String.format("mv $TMPFILE %s.hosts.conf", host), "pkill -HUP -f nginx" ) ); } catch (final UnknownHostException ex) { throw new IllegalStateException(ex); } catch (final IOException ex) { throw new IllegalStateException(ex); } }
Source:
private void appendOffsets() { ensureOffsetsBufferSize(); int baseOffset = getLastOffsetInBuffer(); if (positionsOffset > 0) { baseOffset -= offsets[positionsOffset - 1]; } for (int i = positionsOffset; i < positionsOffset + batchSize; i++) { int currentOffset = offsets[i]; ByteArrayUtils.writeInt(offsetsBuffer, offsetsBufferIndex, currentOffset + baseOffset); offsetsBufferIndex += ARRAY_INT_INDEX_SCALE; } verify(offsetsBufferIndex == (bufferedPositionCount + batchSize) * ARRAY_INT_INDEX_SCALE); }

Target:
private void appendOffsets() { ensureOffsetsBufferCapacity(); int baseOffset = lastOffset - offsets[positionsOffset]; for (int i = positionsOffset; i < positionsOffset + batchSize; i++) { offsetsBufferIndex = setInt(offsetsBuffer, offsetsBufferIndex, offsets[i + 1] + baseOffset); } lastOffset = offsets[positionsOffset + batchSize] + baseOffset; }
Source:
if (tempBT == 0) { tempBT = (long) ProcUtil.getSystemUptimeSeconds(); }

Target:
if (tempBT == 0) { tempBT = System.currentTimeMillis() / 1000L - (long) ProcUtil.getSystemUptimeSeconds(); }
Source:
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { Command command = (Command) msg; command.setChannelHandlerContext(ctx); commandQueue.offer(command); }

Target:
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { Command command = (Command) msg; command.setChannelHandlerContext(ctx); commandQueue.put(command); }
Source:
public void buildReport(ActionManager manager) { TreeFilteringResourceVisitor visitor = new TreeFilteringResourceVisitor(); visitor.setBreadthFirstMode(); visitor.setTraversalFilter(null); visitor.setResourceVisitor((resource, depth) -> { Map<String, List<String>> brokenRefs = collectBrokenReferences(resource, regex, excludeList, deepCheckList); for(Map.Entry<String, List<String>> ref : brokenRefs.entrySet()){ String propertyPath = ref.getKey(); List<String> refs = ref.getValue(); reportData.put(propertyPath, new EnumMap<>(REPORT.class)); reportData.get(propertyPath).put(REPORT.reference, refs.stream().collect(Collectors.joining(","))); } }); manager.deferredWithResolver(rr -> visitor.accept(rr.getResource(sourcePath))); }

Target:
public void buildReport(ActionManager manager) { TreeFilteringResourceVisitor visitor = new TreeFilteringResourceVisitor(); visitor.setBreadthFirstMode(); visitor.setTraversalFilter(null); visitor.setResourceVisitor((resource, depth) -> { manager.deferredWithResolver(rr -> { Map<String, List<String>> brokenRefs = collectBrokenReferences(resource, regex, excludeList, deepCheckList); for(Map.Entry<String, List<String>> ref : brokenRefs.entrySet()){ String propertyPath = ref.getKey(); List<String> refs = ref.getValue(); reportData.put(propertyPath, new EnumMap<>(REPORT.class)); reportData.get(propertyPath).put(REPORT.reference, refs.stream().collect(Collectors.joining(","))); } }); }); manager.deferredWithResolver(rr -> visitor.accept(rr.getResource(sourcePath))); }
Source:
public void testRotateTicketSeedFile() throws InterruptedException, IOException { startServer(); OpenSslServerConfiguration config = (OpenSslServerConfiguration) server.getSSLConfiguration(); List<SessionTicketKey> actual = ImmutableList.copyOf(config.ticketKeys); List<SessionTicketKey> expected = new TicketSeedFileParser().parse(getTicketSeedFile()); assertTicketKeysEqual(actual, expected); updateTicketSeedFile(getResourceFileContents(Plain.class, "/ticket_seeds2.json")); Thread.sleep(300); config = (OpenSslServerConfiguration) server.getSSLConfiguration(); List<SessionTicketKey> actual2 = ImmutableList.copyOf(config.ticketKeys); List<SessionTicketKey> expected2 = new TicketSeedFileParser().parse(getTicketSeedFile()); assertTicketKeysEqual(actual2, expected2); Assert.assertNotEquals(actual.get(0).getName(), actual2.get(0).getName()); }

Target:
public void testRotateTicketSeedFile() throws InterruptedException, IOException { startServer(); OpenSslServerConfiguration config = (OpenSslServerConfiguration) server.getSSLConfiguration(); List<SessionTicketKey> actual = ImmutableList.copyOf(config.ticketKeys); List<SessionTicketKey> expected = new TicketSeedFileParser().parse(getTicketSeedFile()); assertTicketKeysEqual(actual, expected); long callbacksSucceeded = fileWatcher.getStats().getCallbacksSucceeded(); updateTicketSeedFile(getResourceFileContents(Plain.class, "/ticket_seeds2.json")); while (fileWatcher.getStats().getCallbacksSucceeded() < callbacksSucceeded + 1) { Thread.sleep(25); } config = (OpenSslServerConfiguration) server.getSSLConfiguration(); List<SessionTicketKey> actual2 = ImmutableList.copyOf(config.ticketKeys); List<SessionTicketKey> expected2 = new TicketSeedFileParser().parse(getTicketSeedFile()); assertTicketKeysEqual(actual2, expected2); Assert.assertNotEquals(actual.get(0).getName(), actual2.get(0).getName()); }
Source:
@Override public String getDescription() { return "Setup okbuck cache and dependencies"; }

Target:
@Override public String getDescription() { return "Okbuck task for the root project. Also sets up groovy and kotlin if required."; }
Source:
private static Map<Integer, RexLiteral> getAllColumnValuePairs(RexCall call) { if (call.isA(SqlKind.AND)) { return call.getOperands().stream().flatMap(entry -> { if (entry instanceof RexCall) { final Pair<Integer, RexLiteral> p = getColumnValuePairs((RexCall) entry); if (p != null) { return Stream.of(p); } } return Stream.empty(); }).collect(Collectors.toMap(Pair::getFirst, Pair::getSecond, (a, b) -> a)); } else { final Map<Integer, RexLiteral> m = new HashMap<>(); final Pair<Integer, RexLiteral> p = getColumnValuePairs(call); if (p != null) { m.put(p.getFirst(), p.getSecond()); } return m; } }

Target:
private static Map<Integer, RexNode> getAllColumnValuePairs(RexCall call) { if (call.isA(SqlKind.AND)) { return call.getOperands().stream().flatMap(entry -> { if (entry instanceof RexCall) { return getColumnValuePairs((RexCall) entry); } else { return Stream.empty(); } }).collect(Collectors.toMap(Pair::getFirst, Pair::getSecond, (a, b) -> a)); } else { final Map<Integer, RexNode> m = new HashMap<>(); getColumnValuePairs(call).findAny().ifPresent(p -> m.put(p.getFirst(), p.getSecond())); return m; } }
Source:
public void tryAssembleMergedConfig(GoConfigHolder cruiseConfigHolder,List<PartialConfig> partials) { try { GoConfigHolder newConfigHolder; if (partials.size() == 0) { newConfigHolder = cruiseConfigHolder; } else { BasicCruiseConfig merge = new BasicCruiseConfig((BasicCruiseConfig) cruiseConfigHolder.config, partials); List<ConfigErrors> allErrors = validate(merge); if (!allErrors.isEmpty()) { throw new GoConfigInvalidException(merge, allErrors); } CruiseConfig basicForEdit = this.fileService.loadForEditing(); CruiseConfig forEdit = new BasicCruiseConfig((BasicCruiseConfig) basicForEdit, partials); newConfigHolder = new GoConfigHolder(merge, forEdit); } this.saveValidConfigToCacheAndNotifyConfigChangeListeners(newConfigHolder); } catch (Exception e) { LOGGER.error("Failed validation of merged configuration: {}", e); saveConfigError(e); } }

Target:
public void tryAssembleMergedConfig(GoConfigHolder cruiseConfigHolder,List<PartialConfig> partials) { try { GoConfigHolder newConfigHolder; if (partials.size() == 0) { newConfigHolder = cruiseConfigHolder; } else { BasicCruiseConfig merge = new BasicCruiseConfig((BasicCruiseConfig) cruiseConfigHolder.config, partials); List<ConfigErrors> allErrors = validate(merge); if (!allErrors.isEmpty()) { throw new GoConfigInvalidException(merge, allErrors); } CruiseConfig basicForEdit = this.fileService.loadForEditing(); CruiseConfig forEdit = new BasicCruiseConfig((BasicCruiseConfig) basicForEdit, partials); newConfigHolder = new GoConfigHolder(merge, forEdit); } this.saveValidConfigToCacheAndNotifyConfigChangeListeners(newConfigHolder); } catch (Exception e) { LOGGER.error("Failed validation of merged configuration: {}", e.toString()); saveConfigError(e); } }
Source:
public WorkflowVersion createVersionForWorkflow(String repository, String gitReference, Workflow workflow, SourceFile dockstoreYml) throws IOException { GHRepository ghRepository = getRepository(repository); Pattern pattern = Pattern.compile("^refs/(tags|heads)/([a-zA-Z0-9]+([./_-]?[a-zA-Z0-9]+)*)$"); Matcher matcher = pattern.matcher(gitReference); if (!matcher.find()) { String msg = "Reference " + gitReference + " is not of the valid form"; LOG.info(msg); throw new CustomWebApplicationException(msg, LAMBDA_FAILURE); } String gitBranchType = matcher.group(1); String gitBranchName = matcher.group(2); GHRef ghRef = ghRepository.getRef(gitBranchType + "/" + gitBranchName); Triple<String, Date, String> ref = getRef(ghRef, ghRepository); if (ref == null) { String msg = "Cannot retrieve the workflow reference from GitHub, ensure that " + gitReference + " is a valid branch/tag."; LOG.info(msg); throw new CustomWebApplicationException(msg, LAMBDA_FAILURE); } Optional<WorkflowVersion> existingVersion = workflow.getWorkflowVersions().stream().filter(workflowVersion -> Objects.equals(workflowVersion.getReference(), gitBranchName)).findFirst(); if (existingVersion.isPresent()) { workflow.removeWorkflowVersion(existingVersion.get()); } Map<String, WorkflowVersion> existingDefaults = new HashMap<>(); existingVersion.ifPresent(workflowVersion -> existingDefaults.put(gitReference, workflowVersion)); return setupWorkflowVersionsHelper(ghRepository.getFullName(), workflow, ref, Optional.of(workflow), existingDefaults, ghRepository, dockstoreYml); }

Target:
public WorkflowVersion createVersionForWorkflow(String repository, String gitReference, Workflow workflow, SourceFile dockstoreYml) throws IOException { GHRepository ghRepository = getRepository(repository); Pattern pattern = Pattern.compile("^refs/(tags|heads)/([a-zA-Z0-9]+([./_-]?[a-zA-Z0-9]+)*)$"); Matcher matcher = pattern.matcher(gitReference); if (!matcher.find()) { String msg = "Reference " + gitReference + " is not of the valid form"; LOG.error(msg); throw new CustomWebApplicationException(msg, LAMBDA_FAILURE); } String gitBranchType = matcher.group(1); String gitBranchName = matcher.group(2); GHRef ghRef = ghRepository.getRef(gitBranchType + "/" + gitBranchName); Triple<String, Date, String> ref = getRef(ghRef, ghRepository); if (ref == null) { String msg = "Cannot retrieve the workflow reference from GitHub, ensure that " + gitReference + " is a valid branch/tag."; LOG.info(msg); throw new CustomWebApplicationException(msg, LAMBDA_FAILURE); } Optional<WorkflowVersion> existingVersion = workflow.getWorkflowVersions().stream().filter(workflowVersion -> Objects.equals(workflowVersion.getReference(), gitBranchName)).findFirst(); if (existingVersion.isPresent()) { workflow.removeWorkflowVersion(existingVersion.get()); } Map<String, WorkflowVersion> existingDefaults = new HashMap<>(); existingVersion.ifPresent(workflowVersion -> existingDefaults.put(gitReference, workflowVersion)); return setupWorkflowVersionsHelper(ghRepository.getFullName(), workflow, ref, Optional.of(workflow), existingDefaults, ghRepository, dockstoreYml); }
Source:
public void onClicked(MouseEvent event) { if (event.getButton().equals(MouseButton.SECONDARY)) { dismiss(); } else { if (!StageHolder.getStage().isFocused()) { StageHolder.getStage().setIconified(false); StageHolder.getStage().requestFocus(); } action.call(event); } }

Target:
public void onClicked(MouseEvent event) { if (event.getButton().equals(MouseButton.SECONDARY)) { dismiss(); } else { action.call(event); } }
Source:
public void testConfigProviderRegex() { testConfigProviderRegex("${file:/tmp/somefile.txt:somevar}"); testConfigProviderRegex("\"${file:/tmp/somefile.txt:somevar}\""); testConfigProviderRegex("plain.PlainLoginModule required username=\"${file:/tmp/somefile.txt:somevar}\""); testConfigProviderRegex("plain.PlainLoginModule required username=${file:/tmp/somefile.txt:somevar}"); testConfigProviderRegex("plain.PlainLoginModule required username", false); }

Target:
public void testConfigProviderRegex() { testConfigProviderRegex("\"${::}\""); testConfigProviderRegex("${::}"); testConfigProviderRegex("\"${:/a:somevar}\""); testConfigProviderRegex("\"${file::somevar}\""); testConfigProviderRegex("${file:/a/b/c:}"); testConfigProviderRegex("${file:/tmp/somefile.txt:somevar}"); testConfigProviderRegex("\"${file:/tmp/somefile.txt:somevar}\""); testConfigProviderRegex("plain.PlainLoginModule required username=\"${file:/tmp/somefile.txt:somevar}\""); testConfigProviderRegex("plain.PlainLoginModule required username=${file:/tmp/somefile.txt:somevar}"); testConfigProviderRegex("plain.PlainLoginModule required username=${file:/tmp/somefile.txt:somevar} not null"); testConfigProviderRegex("plain.PlainLoginModule required username=${file:/tmp/somefile.txt:somevar} password=${file:/tmp/somefile.txt:othervar}"); testConfigProviderRegex("plain.PlainLoginModule required username", false); }
Source:
public List<OrganizationType> getAllOrganizations(String exchangeName) throws ExchangeManagerException { refreshExchangeCacheIfRequired(); return null != exchangeName ? new ArrayList<>(getCache().get(exchangeName).values()) : new ArrayList<>(getCache().get(this.getDefaultExchange()).values()); }

Target:
public List<OrganizationType> getAllOrganizations(String exchangeName) throws ExchangeManagerException { refreshExchangeCacheIfRequired(); return (null != exchangeName) ? new ArrayList<>(getCache().get(exchangeName).values()) : new ArrayList<>(getCache().get(this.getDefaultExchange()).values()); }
Source:
public AlarmState alarm() { System.out.println(name + ": " + currentAlarmState); return currentAlarmState; }

Target:
public AlarmState alarm() { return currentAlarmState; }
Source:
public void verifyCommentFormErrorMessage(String commentTableIdSuffix, String errorMessage) { WebElement errorMessageSpan = waitForElementPresence( By.cssSelector("#responseCommentTable" + commentTableIdSuffix + " .col-sm-offset-5 #errorMessage")); assertEquals(errorMessage, errorMessageSpan.getText()); }

Target:
public void verifyCommentFormErrorMessage(String commentTableIdSuffix, String errorMessage) { WebElement errorMessageSpan = waitForElementPresence(By.cssSelector("#errorMessage")); assertEquals(errorMessage, errorMessageSpan.getText()); }
Source:
public void postExecution(ActionEvaluationResponse response) { if(null != response.getException()) { eventBus.publish(new QueryProcessingError(response.getRequest(), response.getException())); } eventBus.publish(new QueryProcessed(response.getRequest(), response.getResponse(), response.getElapsedTime())); }

Target:
public void postExecution(ActionEvaluationResponse response) { if(null != response.getException()) { eventBus.publish(new QueryProcessingError(response.getRequest(), response.getException())); } else { eventBus.publish(new QueryProcessed(response.getRequest(), response.getResponse(), response.getElapsedTime())); } }
Source:
public void testNeedsRepositoryCredentialsPageCompletesWithoutCredentials() { TaskRepository repository = new TaskRepository(MockRepositoryConnector.CONNECTOR_KIND, "http://localhost/"); MockRepositorySettingsPage page = new MockRepositorySettingsPage(repository); page.setNeedsRepositoryCredentials(false); try { Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); page.createControl(shell); page.setUrl("<LINK_0>"); assertTrue(page.isPageComplete()); assertNull(page.getMessage()); assertNotNull(page.createTaskRepository()); } finally { page.dispose(); } }

Target:
public void testNeedsRepositoryCredentialsPageCompletesWithoutCredentials() { TaskRepository repository = new TaskRepository(MockRepositoryConnector.CONNECTOR_KIND, "http://localhost/"); MockRepositorySettingsPage page = new MockRepositorySettingsPage(repository); page.setNeedsRepositoryCredentials(false); try { Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); page.createControl(shell); page.setUrl("<LINK_0>"); assertNull(page.getRepositoryUserNameEditor()); assertNull(page.getRepositoryPasswordEditor()); assertTrue(page.isPageComplete()); assertNull(page.getMessage()); assertNotNull(page.createTaskRepository()); } finally { page.dispose(); } }
Source:
public CellIdentityCdma() { super(CellIdentityCdma.class.getSimpleName(), TYPE_CDMA, null, null); mNetworkId = Integer.MAX_VALUE; mSystemId = Integer.MAX_VALUE; mBasestationId = Integer.MAX_VALUE; mLongitude = Integer.MAX_VALUE; mLatitude = Integer.MAX_VALUE; mAlphaLong = null; mAlphaShort = null; }

Target:
public CellIdentityCdma() { super(TAG, TYPE_CDMA, null, null); mNetworkId = Integer.MAX_VALUE; mSystemId = Integer.MAX_VALUE; mBasestationId = Integer.MAX_VALUE; mLongitude = Integer.MAX_VALUE; mLatitude = Integer.MAX_VALUE; mAlphaLong = null; mAlphaShort = null; }
Source:
public SecurityInfoBuilder id(SecurityId id) { this.id = id; return this; }

Target:
public SecurityInfoBuilder id(SecurityId id) { this.id = ArgChecker.notNull(id, "id"); return this; }
Source:
private void cancelCurrentRequest() { this.bufferedContent = null; this.bufferedContentReadOffset = 0; this.bytesToSkipBeforeReading = 0; if (requestContext != null) { requestContext.close(); requestContext = null; } if (resIterator != null) { resIterator = null; } }

Target:
private void cancelCurrentRequest() { bufferedContent = null; bufferedContentReadOffset = 0; bytesToSkipBeforeReading = 0; if (requestContext != null) { requestContext.close(); requestContext = null; } if (resIterator != null) { resIterator = null; } }
Source:
private void appendMissingSegment(ResponseContext responseContext) { List<SegmentDescriptor> missingSegments = (List<SegmentDescriptor>) responseContext.get(ResponseContext.CTX_MISSING_SEGMENTS_KEY); if (missingSegments == null) { missingSegments = new ArrayList<>(); responseContext.put(ResponseContext.CTX_MISSING_SEGMENTS_KEY, missingSegments); } missingSegments.add(specificSpec.getDescriptor()); }

Target:
private void appendMissingSegment(ResponseContext responseContext) { List<SegmentDescriptor> missingSegments = (List<SegmentDescriptor>) responseContext.get(ResponseContext.CTX_MISSING_SEGMENTS); if (missingSegments == null) { missingSegments = new ArrayList<>(); responseContext.put(ResponseContext.CTX_MISSING_SEGMENTS, missingSegments); } missingSegments.add(specificSpec.getDescriptor()); }
Source:
public T get(final FindOptions options) { final MorphiaIterator<T, T> it = fetch(options .copy() .limit(1)); T t = (it.hasNext()) ? it.next() : null; it.close(); return t; }

Target:
public T get(final FindOptions options) { final MorphiaIterator<T, T> it = fetch(options .copy() .limit(1)); try { return (it.hasNext()) ? it.next() : null; } finally { it.close(); } }
Source:
public void loadLibs(Context context) throws UnsatisfiedLinkError { SQLiteDatabase.loadLibs(context); }

Target:
public static void loadLibs(Context context) throws UnsatisfiedLinkError { SQLiteDatabase.loadLibs(context); }
Source:
static ByteBuf createExplicitLACEntry(long ledgerId, ByteBuf explicitLac) { ByteBuf bb = Unpooled.buffer(8 + 8 + 4 + explicitLac.capacity()); bb.writeLong(ledgerId); bb.writeLong(METAENTRY_ID_LEDGER_EXPLICITLAC); bb.writeInt(explicitLac.capacity()); bb.writeBytes(explicitLac); return bb; }

Target:
static ByteBuf createExplicitLACEntry(long ledgerId, ByteBuf explicitLac) { ByteBuf bb = PooledByteBufAllocator.DEFAULT.directBuffer(8 + 8 + 4 + explicitLac.capacity()); bb.writeLong(ledgerId); bb.writeLong(METAENTRY_ID_LEDGER_EXPLICITLAC); bb.writeInt(explicitLac.capacity()); bb.writeBytes(explicitLac); return bb; }
Source:
public InternalRemoteRemoteObject createRemoteObject(RemoteObject<?> remoteObject, String name, boolean rebind) throws ProActiveException { throwIfAgentIsNul("createRemoteObject call failed"); try { if (!name.startsWith("/")) { name = "/" + name; } String publicAddress = ProActiveInet.getPublicAddress(), uriUserInfo; if (publicAddress != null) { uriUserInfo = (PNPPublicPort != -1) ? ProActiveInet.getPublicAddress() + ':' + PNPPublicPort : ProActiveInet.getPublicAddress(); } else uriUserInfo = null; URI uri = new URI(this.getProtocolId(), uriUserInfo, URIBuilder.getHostNameorIP(this.agent.getInetAddress()), this.agent.getPort(), name, null, null); InternalRemoteRemoteObject irro = new InternalRemoteRemoteObjectImpl(remoteObject, uri); RemoteRemoteObject rmo = register(irro, uri, rebind); irro.setRemoteRemoteObject(rmo); return irro; } catch (URISyntaxException e) { throw new PNPException("Failed to create remote object " + name, e); } }

Target:
public InternalRemoteRemoteObject createRemoteObject(RemoteObject<?> remoteObject, String name, boolean rebind) throws ProActiveException { throwIfAgentIsNul("createRemoteObject call failed"); try { if (!name.startsWith("/")) { name = "/" + name; } String publicAddress = ProActiveInet.getPublicAddress(), uriUserInfo = null; if (publicAddress != null) { if (pnpPublicPort != -1) { uriUserInfo = ProActiveInet.getPublicAddress() + ':' + pnpPublicPort; } else uriUserInfo = ProActiveInet.getPublicAddress(); } URI uri = new URI(this.getProtocolId(), uriUserInfo, URIBuilder.getHostNameorIP(this.agent.getInetAddress()), this.agent.getPort(), name, null, null); InternalRemoteRemoteObject irro = new InternalRemoteRemoteObjectImpl(remoteObject, uri); RemoteRemoteObject rmo = register(irro, uri, rebind); irro.setRemoteRemoteObject(rmo); return irro; } catch (URISyntaxException e) { throw new PNPException("Failed to create remote object " + name, e); } }
Source:
public static String getName() { return "Custom Activity"; }

Target:
public static String getName() { return "Asset Options"; }