auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private SearchHit createSearchHit(SearchContext context, FieldsVisitor fieldsVisitor, int docId, int subDocId, Map<String, Set<String>> storedToRequestedFields, LeafReaderContext subReaderContext) { Map<String, DocumentField> docFields = emptyMap(); Map<String, DocumentField> metaFields = emptyMap(); if (fieldsVisitor == null) { return new SearchHit(docId, null, docFields, metaFields); } loadStoredFields(context.shardTarget(), subReaderContext, fieldsVisitor, subDocId); fieldsVisitor.postProcess(context.mapperService()); if (fieldsVisitor.fields().isEmpty() == false) { docFields = new HashMap<>(); metaFields = new HashMap<>(); fillDocAndMetaFields(context, fieldsVisitor, storedToRequestedFields, docFields, metaFields); } SearchHit searchHit = new SearchHit(docId, fieldsVisitor.id(), docFields, metaFields); SourceLookup sourceLookup = context.lookup().source(); sourceLookup.setSegmentAndDocument(subReaderContext, subDocId); if (fieldsVisitor.source() != null) { sourceLookup.setSource(fieldsVisitor.source()); } return searchHit; }

Target:
private SearchHit createSearchHit(SearchContext context, FieldsVisitor fieldsVisitor, int docId, int subDocId, Map<String, Set<String>> storedToRequestedFields, LeafReaderContext subReaderContext) { if (fieldsVisitor == null) { return new SearchHit(docId, null, null, null); } loadStoredFields(context.shardTarget(), subReaderContext, fieldsVisitor, subDocId); fieldsVisitor.postProcess(context.mapperService()); SearchHit searchHit; if (fieldsVisitor.fields().isEmpty() == false) { Map<String, DocumentField> docFields = new HashMap<>(); Map<String, DocumentField> metaFields = new HashMap<>(); fillDocAndMetaFields(context, fieldsVisitor, storedToRequestedFields, docFields, metaFields); searchHit = new SearchHit(docId, fieldsVisitor.id(), docFields, metaFields); } else { searchHit = new SearchHit(docId, fieldsVisitor.id(), emptyMap(), emptyMap()); } SourceLookup sourceLookup = context.lookup().source(); sourceLookup.setSegmentAndDocument(subReaderContext, subDocId); if (fieldsVisitor.source() != null) { sourceLookup.setSource(fieldsVisitor.source()); } return searchHit; }
Source:
static boolean isCompactibleSize(long targetBytes, long currentTotalBytes, long additionalBytes) { return targetBytes * (1 + ALLOWED_MARGIN_OF_COMPACTION_SIZE) >= currentTotalBytes + additionalBytes; }

Target:
static boolean isCompactibleSize(long targetBytes, long currentTotalBytes, long additionalBytes) { return currentTotalBytes + additionalBytes <= targetBytes; }
Source:
public void test() { final File file = mockPlatform.createTempFile(true); EditorGame game = new EditorGame(); game.setEditScene("scene0"); mockController.action(NewGame.class, file.getAbsolutePath(), game, new Game()); mockController.action(action, file.getAbsoluteFile(), new DeleteProjectListener() { @Override public void projectDeleted(boolean succeed) { assertTrue( "Project deletion failed! (project file still exists)", succeed); } }); }

Target:
public void test() { final File file = mockPlatform.createTempFile(true); EditorGame game = new EditorGame(); game.setEditScene("scene0"); mockController.action(NewGame.class, file.getAbsolutePath(), game, new Game()); mockController.action(action, file.getAbsoluteFile(), new DeleteProjectListener() { @Override public void projectDeleted(boolean succeeded) { assertTrue( "Project deletion failed (listener invoked with succeeded=false)", succeeded); assertFalse( "Project deletion failed (project file still exists)", file.exists()); } }); }
Source:
public void shutdown() { if (_producers.size() == 0) { return; } LOG.info("Shutting down all producers in event producer pool"); for (Map<String, EventProducer> producerMap : _producers.values()) { producerMap.values().forEach(producer -> producer.shutdown()); } }

Target:
public synchronized void shutdown() { if (_producers.size() == 0) { return; } LOG.info("Shutting down all producers in event producer pool"); for (Map<String, EventProducer> producerMap : _producers.values()) { producerMap.values().forEach(producer -> producer.shutdown()); } _producers.clear(); }
Source:
protected void mapSecondaryIndexes(K key, V value) { if (value == null) { log.trace("Attempting to build an index with a null value, skipping."); return; } try { for (Index<K, V, ? extends Comparable> index : indexSpec) { String indexName = index.getName().get(); Map<Comparable, Map<K, V>> secondaryIndex = secondaryIndexes.get(indexName); for (Comparable indexKey : index.getMultiValueIndexFunction().apply(key, value)) { Map<K, V> slot = secondaryIndex.computeIfAbsent(indexKey, k -> new HashMap<>()); slot.put(key, value); } } } catch (Exception e) { log.error("Received an exception while computing the index. " + "This is most likely an issue with the client's indexing function. {}", e); clearIndex(); throw e; } }

Target:
protected void mapSecondaryIndexes(K key, V value) { if (value == null) { log.warn("Attempting to build an index with a null value, skipping."); return; } try { for (Index<K, V, ? extends Comparable> index : indexSpec) { String indexName = index.getName().get(); Map<Comparable, Map<K, V>> secondaryIndex = secondaryIndexes.get(indexName); for (Comparable indexKey : index.getMultiValueIndexFunction().apply(key, value)) { Map<K, V> slot = secondaryIndex.computeIfAbsent(indexKey, k -> new HashMap<>()); slot.put(key, value); } } } catch (Exception e) { log.error("Received an exception while computing the index. " + "This is most likely an issue with the client's indexing function.", e); clearIndex(); throw e; } }
Source:
private Runnable makeFlyWeightTaskBuildable(final BuildableItem p){ if (p.task instanceof FlyweightTask) { Jenkins h = Jenkins.getInstance(); Map<Node, Integer> hashSource = new HashMap<Node, Integer>(h.getNodes().size()); hashSource.put(h, Math.max(h.getNumExecutors() * 100, 1)); for (Node n : h.getNodes()) { hashSource.put(n, n.getNumExecutors() * 100); } ConsistentHash<Node> hash = new ConsistentHash<Node>(NODE_HASH); hash.addAll(hashSource); Label lbl = p.getAssignedLabel(); for (Node n : hash.list(p.task.getFullDisplayName())) { final Computer c = n.toComputer(); if (c == null || c.isOffline()) { continue; } if (lbl!=null && !lbl.contains(n)) { continue; } if (n.canTake(p) != null) { continue; } LOGGER.log(Level.FINE, "Creating flyweight task {0} for machine {1}", new Object[]{p.task, c.getName()}); return new Runnable() { @Override public void run() { c.startFlyWeightTask(new WorkUnitContext(p).createWorkUnit(p.task)); makePending(p); } }; } } return null; }

Target:
private Runnable makeFlyWeightTaskBuildable(final BuildableItem p){ if (p.task instanceof FlyweightTask) { Jenkins h = Jenkins.getInstance(); Map<Node, Integer> hashSource = new HashMap<Node, Integer>(h.getNodes().size()); hashSource.put(h, Math.max(h.getNumExecutors() * 100, 1)); for (Node n : h.getNodes()) { hashSource.put(n, n.getNumExecutors() * 100); } ConsistentHash<Node> hash = new ConsistentHash<Node>(NODE_HASH); hash.addAll(hashSource); Label lbl = p.getAssignedLabel(); for (Node n : hash.list(p.task.getFullDisplayName())) { final Computer c = n.toComputer(); if (c == null || c.isOffline()) { continue; } if (lbl!=null && !lbl.contains(n)) { continue; } if (n.canTake(p) != null) { continue; } LOGGER.log(Level.FINEST, "Creating flyweight task {0} for computer {1}", new Object[]{p.task.getFullDisplayName(), c.getName()}); return new Runnable() { @Override public void run() { c.startFlyWeightTask(new WorkUnitContext(p).createWorkUnit(p.task)); makePending(p); } }; } } return null; }
Source:
public final void testWindow1() throws Exception { ResultSet res = executeString("SELECT sum(l_quantity) OVER () FROM LINEITEM"); assertResultSet(res); cleanupQuery(res); }

Target:
public final void testWindow1() throws Exception { ResultSet res = executeQuery(); assertResultSet(res); cleanupQuery(res); }
Source:
private void fillJunk(SolGame game, RemoveController remover, SpaceEnvConfig conf, Vector2 chunkCenter) { if (conf == null) { return; } int count = getEntityCount(conf.junkDensity); if (count == 0) { return; } for (int i = 0; i < count; i++) { Vector2 junkPos = getRndPos(chunkCenter); <<<<<<< HEAD TextureAtlas.AtlasRegion tex = new TextureAtlas.AtlasRegion(SolRandom.randomElement(conf.junkTexs)); ======= TextureAtlas.AtlasRegion tex = new TextureAtlas.AtlasRegion(SolMath.elemRnd(conf.junkTextures)); >>>>>>> 4df19c3... Some renaming and refactoring of basically everything, yet another round if (SolRandom.test(.5f)) { tex.flip(!tex.isFlipX(), !tex.isFlipY()); } float sz = SolRandom.randomFloat(.3f, 1) * JUNK_MAX_SZ; float rotationSpeed = SolRandom.randomFloat(JUNK_MAX_ROT_SPD); RectSprite s = new RectSprite(tex, sz, 0, 0, new Vector2(), DrawableLevel.DECO, SolRandom.randomFloat(180), rotationSpeed, SolColor.LG, false); ArrayList<Drawable> drawables = new ArrayList<>(); drawables.add(s); Vector2 speed = new Vector2(); SolMath.fromAl(speed, SolRandom.randomFloat(180), SolRandom.randomFloat(JUNK_MAX_SPD_LEN)); FarDrawable so = new FarDrawable(drawables, junkPos, speed, remover, true); game.getObjectManager().addFarObjNow(so); } }

Target:
private void fillJunk(SolGame game, RemoveController remover, SpaceEnvConfig conf, Vector2 chunkCenter) { if (conf == null) { return; } int count = getEntityCount(conf.junkDensity); if (count == 0) { return; } for (int i = 0; i < count; i++) { Vector2 junkPos = getRndPos(chunkCenter); TextureAtlas.AtlasRegion tex = new TextureAtlas.AtlasRegion(SolRandom.randomElement(conf.junkTextures)); if (SolRandom.test(.5f)) { tex.flip(!tex.isFlipX(), !tex.isFlipY()); } float sz = SolRandom.randomFloat(.3f, 1) * JUNK_MAX_SZ; float rotationSpeed = SolRandom.randomFloat(JUNK_MAX_ROT_SPD); RectSprite s = new RectSprite(tex, sz, 0, 0, new Vector2(), DrawableLevel.DECO, SolRandom.randomFloat(180), rotationSpeed, SolColor.LG, false); ArrayList<Drawable> drawables = new ArrayList<>(); drawables.add(s); Vector2 speed = new Vector2(); SolMath.fromAl(speed, SolRandom.randomFloat(180), SolRandom.randomFloat(JUNK_MAX_SPD_LEN)); FarDrawable so = new FarDrawable(drawables, junkPos, speed, remover, true); game.getObjectManager().addFarObjNow(so); } }
Source:
public boolean deleteFile(File file, boolean recursive) { if (recursive) { return this.deleteRecursive(file); } return file.delete(); }

Target:
public boolean deleteFile(File file, boolean recursive) { if (recursive) { return this.deleteRecursive(file); } return this.deleteFile(file); }
Source:
private static InputStream inflate(final InputStream in, final long size, final ObjectId id) { final Inflater inf = InflaterCache.get(); return new InflaterInputStream(in, inf) { private long remaining = size; @Override public int read(byte[] b, int off, int cnt) throws IOException { try { int r = super.read(b, off, cnt); if (r > 0) remaining -= r; return r; } catch (ZipException badStream) { throw new CorruptObjectException(id, JGitText.get().corruptObjectBadStream); } } @Override public void close() throws IOException { try { if (remaining <= 0) checkValidEndOfStream(in, inf, id, new byte[64]); } finally { super.close(); InflaterCache.release(inf); } } }; }

Target:
private static InputStream inflate(final InputStream in, final long size, final ObjectId id) { final Inflater inf = InflaterCache.get(); return new InflaterInputStream(in, inf) { private long remaining = size; @Override public int read(byte[] b, int off, int cnt) throws IOException { try { int r = super.read(b, off, cnt); if (r > 0) remaining -= r; return r; } catch (ZipException badStream) { throw new CorruptObjectException(id, JGitText.get().corruptObjectBadStream); } } @Override public void close() throws IOException { try { if (remaining <= 0) checkValidEndOfStream(in, inf, id, new byte[64]); } finally { InflaterCache.release(inf); super.close(); } } }; }
Source:
public void cleanUp() { if (executor != null) { executor.shutdownNow(); } if (queryCanceller != null) { queryCanceller.close(); } }

Target:
public void cleanUp() throws IOException { closer.close(); }
Source:
public RemoveLocalProjectsFolderOnWorkspaceRemove( LocalProjectsFolderPathProvider workspaceFolderPathProvider) { this.workspaceFolderPathProvider = workspaceFolderPathProvider; executor = Executors.newCachedThreadPool( new ThreadFactoryBuilder() .setNameFormat("RemoveLocalProjectsFolderOnWorkspaceRemove-%d") .setUncaughtExceptionHandler(LoggingUncaughtExceptionHandler.getInstance()) .setDaemon(true) .build()); }

Target:
public RemoveLocalProjectsFolderOnWorkspaceRemove( LocalProjectsFolderPathProvider workspaceFolderPathProvider) { this.workspaceFolderPathProvider = workspaceFolderPathProvider; executor = Executors.newCachedThreadPool( new ThreadFactoryBuilder() .setNameFormat("RemoveLocalProjectsFolderOnWorkspaceRemove-%d") .setUncaughtExceptionHandler(LoggingUncaughtExceptionHandler.getInstance()) .build()); }
Source:
public void equals_hashCodeTest() { TimeRange range = new TimeRange(new Date(1), new Date(100)); AirConditionerState air = new AirConditionerState(); HumidityState hum = new HumidityState(); Date createdAd = new Date(1); HistoryState airHS = new HistoryState<AirConditionerState>(air, createdAd); HistoryState humHS = new HistoryState<HumidityState>(hum, createdAd); List<HistoryState> list1 = new ArrayList<HistoryState>(); list1.add(airHS); List<HistoryState> list2 = new ArrayList<HistoryState>(); list2.add(humHS); GroupedHistoryStates target = new GroupedHistoryStates(range, list1); GroupedHistoryStates sameOne = new GroupedHistoryStates(range, list1); GroupedHistoryStates differentOne = new GroupedHistoryStates(range, list2); Assert.assertTrue(target.equals(sameOne)); Assert.assertEquals(target.hashCode(), sameOne.hashCode()); Assert.assertFalse(target.equals(differentOne)); Assert.assertNotSame(target.hashCode(), differentOne.hashCode()); Assert.assertFalse(target.equals(null)); Assert.assertFalse(target.equals((Object)airHS)); }

Target:
public void equals_hashCodeTest() { TimeRange range = new TimeRange(new Date(1), new Date(100)); AirConditionerState air = new AirConditionerState(); HumidityState hum = new HumidityState(); Date createdAd = new Date(1); HistoryState<AirConditionerState> airHS = new HistoryState<>(air, createdAd); HistoryState<HumidityState> humHS = new HistoryState<>(hum, createdAd); List<HistoryState<AirConditionerState>> list1 = new ArrayList<HistoryState<AirConditionerState>>(); list1.add(airHS); List<HistoryState<HumidityState>> list2 = new ArrayList<HistoryState<HumidityState>>(); list2.add(humHS); GroupedHistoryStates<AirConditionerState> target = new GroupedHistoryStates<>(range, list1); GroupedHistoryStates<AirConditionerState> sameOne = new GroupedHistoryStates<>(range, list1); GroupedHistoryStates<HumidityState> differentOne = new GroupedHistoryStates<>(range, list2); Assert.assertTrue(target.equals(sameOne)); Assert.assertEquals(target.hashCode(), sameOne.hashCode()); Assert.assertFalse(target.equals(differentOne)); Assert.assertNotSame(target.hashCode(), differentOne.hashCode()); Assert.assertFalse(target.equals(null)); Assert.assertFalse(target.equals((Object)airHS)); }
Source:
protected void deactivate() { lastKnownInterfaceAddresses = null; networkAddressChangeListeners = null; if (lastInterfacePollJob != null && expressionThreadPoolExecutor != null) { expressionThreadPoolExecutor.remove(lastInterfacePollJob); lastInterfacePollJob = null; expressionThreadPoolExecutor = null; } }

Target:
protected void deactivate() { lastKnownInterfaceAddresses = Collections.emptyList(); networkAddressChangeListeners = ConcurrentHashMap.newKeySet(); if (networkInterfacePollFuture != null) { networkInterfacePollFuture.cancel(true); networkInterfacePollFuture = null; scheduledExecutorService = null; } }
Source:
protected void assertContentEquals(IStorage storage, String expectedContents) throws Exception { Scanner scanner = null; try { scanner = new Scanner(storage.getContents()).useDelimiter("\\A"); String fileContent = ""; if (scanner.hasNext()) { fileContent = scanner.next(); } assertEquals(expectedContents, fileContent); } finally { if (scanner != null) scanner.close(); } }

Target:
protected void assertContentEquals(IStorage storage, String expectedContents) throws Exception { try (Scanner scanner = new Scanner(storage.getContents())) { scanner.useDelimiter("\\A"); String fileContent = ""; if (scanner.hasNext()) { fileContent = scanner.next(); } assertEquals(expectedContents, fileContent); } }
Source:
public V computeIfPresent(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) { checkNotNull(key, NULL_KEY_IS_NOT_ALLOWED); while (true) { Data oldValueData = toData(getInternal(key)); if (oldValueData == null) { return null; } V oldValueClone = toObject(oldValueData); V newValue = remappingFunction.apply(key, oldValueClone); if (newValue != null) { if (replaceInternal(key, oldValueData, toData(newValue))) { return newValue; } } else if (removeInternal(key, oldValueData)) { return null; } } }

Target:
public V computeIfPresent(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) { checkNotNull(key, NULL_KEY_IS_NOT_ALLOWED); checkNotNull(key, NULL_BIFUNCTION_IS_NOT_ALLOWED); Version clusterVersion = getNodeEngine().getClusterService().getClusterVersion(); if (SerializationUtil.isClassStaticAndSerializable(remappingFunction) && clusterVersion.isGreaterOrEqual(Versions.V4_1)) { BiFunctionExecutingEntryProcessor<K, V> ep = new BiFunctionExecutingEntryProcessor<>(remappingFunction); return executeOnKey(key, ep); } else { return computeIfPresentLocally(key, remappingFunction); } }
Source:
protected android.app.Notification getNotification(@NonNull Context context, @NonNull Intent intent) { final BaseNotificationPayload payload = ParseHandleHelper.extractPayload(intent); if (null != payload && null != payload.getAction()) { switch (payload.getAction()) { case ParseHandleHelper.COURSE_ANNOUNCEMENT_ACTION: { final CourseUpdateNotificationPayload courseUpdateNotificationPayload = (CourseUpdateNotificationPayload) payload; getSegment(context).trackNotificationReceived(courseUpdateNotificationPayload.getCourseId()); return newNotificationBuilder(context, intent) .setContentTitle(context.getString(R.string.COURSE_ANNOUNCEMENT_NOTIFICATION_TITLE)) .setContentText(courseUpdateNotificationPayload.getCourseName()) .build(); } } } getSegment(context).trackNotificationReceived(""); return super.getNotification(context, intent); }

Target:
protected android.app.Notification getNotification(@NonNull Context context, @NonNull Intent intent) { final BaseNotificationPayload payload = ParseHandleHelper.extractPayload(intent); if (null != payload && null != payload.getAction()) { switch (payload.getAction()) { case ParseHandleHelper.COURSE_ANNOUNCEMENT_ACTION: { final CourseUpdateNotificationPayload courseUpdateNotificationPayload = (CourseUpdateNotificationPayload) payload; segment.trackNotificationReceived(courseUpdateNotificationPayload.getCourseId()); return newNotificationBuilder(context, intent) .setContentTitle(context.getString(R.string.COURSE_ANNOUNCEMENT_NOTIFICATION_TITLE)) .setContentText(courseUpdateNotificationPayload.getCourseName()) .build(); } } } segment.trackNotificationReceived(null); return super.getNotification(context, intent); }
Source:
public List<String> complete(final CommandContext context) { return context.getCause().first(Audience.class) .map(src -> SpongePaginationService.this.getPaginationState(src, false)) .map(paginations -> ImmutableList.copyOf(Iterables.transform(paginations.keys(), Object::toString))) .orElseGet(ImmutableList::of); }

Target:
public List<String> complete(final CommandContext context) { final Audience audience = context.getCause().getAudience(); final SourcePaginations paginations = SpongePaginationService.this.getPaginationState(audience, false); if (paginations != null) { return ImmutableList.copyOf(Iterables.transform(paginations.keys(), Object::toString)); } return ImmutableList.of(); }
Source:
public Observable<List<CenterInfo>> saveCenterSummaryInfo(final List<CenterInfo> centerInfos, final int centerId) { AsyncTask.THREAD_POOL_EXECUTOR.execute(new Runnable() { @Override public void run() { for (CenterInfo centerInfo : centerInfos) { centerInfo.setId(centerId); centerInfo.save(); } } }); return Observable.just(centerInfos); }

Target:
public Observable<List<CenterInfo>> saveCenterSummaryInfo(final List<CenterInfo> centerInfos, final int centerId) { return Observable.defer(new Func0<Observable<List<CenterInfo>>>() { @Override public Observable<List<CenterInfo>> call() { for (CenterInfo centerInfo : centerInfos) { centerInfo.setId(centerId); centerInfo.save(); } return Observable.just(centerInfos); } }); }
Source:
protected void unsetHttpClientFactory(final HttpClientFactory httpClientFactory) { if (HttpUtil.httpClientFactory == httpClientFactory) { HttpUtil.httpClientFactory = null; } }

Target:
protected void unsetHttpClientFactory(final HttpClientFactory httpClientFactory) { HttpUtil.httpClientFactory = null; }
Source:
public void testCreateFileUnauthorized() throws Exception { final AzureBlobFileSystem fs = this.getFileSystem(); Path testFilePath = new Path( TEST_READ_ONLY_FILE_PATH_PREFIX_0 + name.getMethodName()); intercept(AbfsAuthorizationException.class, () -> { fs.create(testFilePath).close(); }); }

Target:
public void testCreateFileUnauthorized() throws Exception { runTest(FileSystemOperations.CreatePath, true); }
Source:
void strAlgo() { StringMatchResult matchResult = redis.stralgo(StrAlgoArgs.Builder .strings("ohmytext", "mynewtext")); assertThat(matchResult.getMatchString()).isEqualTo("mytext"); matchResult = redis.stralgo(StrAlgoArgs.Builder .strings("ohmytext", "mynewtext").justLen()); assertThat(matchResult.getLen()).isEqualTo(6); matchResult = redis.stralgo(StrAlgoArgs.Builder .strings("ohmytext", "mynewtext").minMatchLen(4)); assertThat(matchResult.getMatchString()).isEqualTo("mytext"); matchResult = redis.stralgo(StrAlgoArgs.Builder .strings("ohmytext", "mynewtext").minMatchLen(4).withIdx().withMatchLen()); assertThat(matchResult.getMatches()).hasSize(1); assertThat(matchResult.getMatches().get(0).getMatchLen()).isEqualTo(4); Position a = matchResult.getMatches().get(0).getA(); Position b = matchResult.getMatches().get(0).getB(); assertThat(a.getStart()).isEqualTo(4); assertThat(a.getEnd()).isEqualTo(7); assertThat(b.getStart()).isEqualTo(5); assertThat(b.getEnd()).isEqualTo(8); assertThat(matchResult.getLen()).isEqualTo(6); matchResult = redis.stralgo(StrAlgoArgs.Builder .strings("a", "b").minMatchLen(4).withIdx().withMatchLen()); assertThat(matchResult.getMatchString()).isNullOrEmpty(); assertThat(matchResult.getLen()).isEqualTo(0); }

Target:
void strAlgo() { StringMatchResult matchResult = redis.stralgoLcs(StrAlgoArgs.Builder .strings("ohmytext", "mynewtext")); assertThat(matchResult.getMatchString()).isEqualTo("mytext"); matchResult = redis.stralgoLcs(StrAlgoArgs.Builder .strings("a", "b").minMatchLen(4).withIdx().withMatchLen()); assertThat(matchResult.getMatchString()).isNullOrEmpty(); assertThat(matchResult.getLen()).isEqualTo(0); }
Source:
public void testCreateEmailMessage() throws Exception{ URL url = Resources.getResource("conf/emailtest/azkaban.properties"); InputStream inputStream = new FileInputStream(url.getFile()); Properties properties = new Properties(); properties.load(inputStream); Props props = new Props(); props.put(properties); props.put("server.port","114"); props.put("jetty.use.ssl","false"); props.put("server.useSSL","false"); props.put("jetty.port","8786"); Emailer emailer = new Emailer(props); EmailMessage emailMessage = emailer.createEmailMessage("subject","text/html",senderList); assert(properties.getProperty("mail.user").equals(emailer.getMailUser())); int mailport = Integer.parseInt((String)properties.getOrDefault("mail.port","25")); assert emailer.getMailPort()== mailport; assert emailMessage.getMailPort() == mailport; }

Target:
public void testCreateEmailMessage(){ Emailer emailer = new Emailer(props); EmailMessage em = emailer.createEmailMessage("subject","text/html",receiveAddrList); assert em.getMailPort() == mailPort; }
Source:
public DataAccount restoreDataAccount(DataAccount dataAccount) throws DataAccessException { DataAccount restoredDataAccount = null; final String restoreDataAccountQuery = String .format("UPDATE `dataaccount` SET `username`='%s', `created`=NOW(), `password`=AES_ENCRYPT('%s',UNHEX('%s')), `properties`='%s', `deleted`='n' WHERE `id`='%d' AND `deleted`='y'", addslashes(dataAccount.username), addslashes(dataAccount.password), key(), addslashes(dataAccount.properties), dataAccount.id.longValue()); final String restoreUserDataAccountQuery = String.format("UPDATE `userdataaccount` SET `deleted`='n' WHERE `dataaccountid`=%d AND `deleted`='y'", dataAccount.id.longValue()); Connection dataAccountConnection = DatabaseServiceProvider.provide().getNamedConnection(DatabaseType.DatabaseTypeDataAccount.toString()); try { dataAccountConnection.connect(); dataAccountConnection.executeQuery(restoreDataAccountQuery); dataAccountConnection.executeQuery(restoreUserDataAccountQuery); if (dataAccountConnection.getAffectedRowCount() > 0) { restoredDataAccount = getDataAccount(dataAccount.id); } } finally { if (dataAccountConnection != null) { dataAccountConnection.disconnect(); } } if (restoredDataAccount != null) { enqueue(restoredDataAccount, 30, false); } return restoredDataAccount; }

Target:
public DataAccount restoreDataAccount(DataAccount dataAccount) throws DataAccessException { DataAccount restoredDataAccount = null; final String restoreDataAccountQuery = String .format("UPDATE `dataaccount` SET `created`=NOW(), `password`=AES_ENCRYPT('%s',UNHEX('%s')), `properties`='%s', `deleted`='n' WHERE `username`='%s'", addslashes(dataAccount.password), key(), addslashes(dataAccount.properties), addslashes(dataAccount.username)); Connection dataAccountConnection = DatabaseServiceProvider.provide().getNamedConnection(DatabaseType.DatabaseTypeDataAccount.toString()); try { dataAccountConnection.connect(); dataAccountConnection.executeQuery(restoreDataAccountQuery); if (dataAccountConnection.getAffectedRowCount() > 0) { dataAccount = getDataAccount(dataAccount.username, dataAccount.source.id); restoredDataAccount = getDataAccount(dataAccount.id); } } finally { if (dataAccountConnection != null) { dataAccountConnection.disconnect(); } } if (restoredDataAccount != null) { enqueue(restoredDataAccount, 30, false); } return restoredDataAccount; }
Source:
public final Object visitInvalidateCommand(InvocationContext ctx, InvalidateCommand command) throws Throwable { try { if (hasSkipLocking(command)) { return invokeNextInterceptor(ctx, command); } lockAllAndRecord(ctx, Arrays.stream(command.getKeys()), getLockTimeoutMillis(command)); return invokeNextInterceptor(ctx, command); } finally { if (!ctx.isInTxScope()) { lockManager.unlockAll(ctx); } } }

Target:
public final Object visitInvalidateCommand(InvocationContext ctx, InvalidateCommand command) throws Throwable { try { if (hasSkipLocking(command)) { return invokeNextInterceptor(ctx, command); } lockAllAndRecord(ctx, Arrays.asList(command.getKeys()), getLockTimeoutMillis(command)); return invokeNextInterceptor(ctx, command); } finally { if (!ctx.isInTxScope()) { lockManager.unlockAll(ctx); } } }
Source:
public void init(Context context) { Preconditions.checkNotNull(context, "Cannot pass null context"); tableContexts.values().forEach(ctx -> ctx.tableProvider.init(context)); initialized = true; }

Target:
public void init(Context context) { tableContexts.values().forEach(ctx -> ctx.tableProvider.init(context)); initialized = true; }
Source:
private int loadIntParam(String name, FilterConfig filterConfig, int defaultValue) { int result = defaultValue; String fParam = filterConfig.getInitParameter(name); if (fParam != null) { result = parseInt(fParam); } String sParam = System.getProperty("blazegraph." + filterConfig.getFilterName() + "." + name); if (sParam != null) { result = parseInt(sParam); } return result; }

Target:
private int loadIntParam(String name, FilterConfig filterConfig, int defaultValue) { String result = loadStringParam(name, filterConfig); return result != null ? parseInt(result) : defaultValue; }
Source:
public static void encodeNullsAsBits(SliceOutput sliceOutput, Block block) { boolean mayHaveNull = block.mayHaveNull(); sliceOutput.appendByte(mayHaveNull ? 1 : 0); if (!mayHaveNull) { return; } int positionCount = block.getPositionCount(); for (int position = 0; position < (positionCount & ~0b111); position += 8) { byte value = 0; value |= block.isNull(position) ? 0b1000_0000 : 0; value |= block.isNull(position + 1) ? 0b0100_0000 : 0; value |= block.isNull(position + 2) ? 0b0010_0000 : 0; value |= block.isNull(position + 3) ? 0b0001_0000 : 0; value |= block.isNull(position + 4) ? 0b0000_1000 : 0; value |= block.isNull(position + 5) ? 0b0000_0100 : 0; value |= block.isNull(position + 6) ? 0b0000_0010 : 0; value |= block.isNull(position + 7) ? 0b0000_0001 : 0; sliceOutput.appendByte(value); } if ((positionCount & 0b111) > 0) { byte value = 0; int mask = 0b1000_0000; for (int position = positionCount & ~0b111; position < positionCount; position++) { value |= block.isNull(position) ? mask : 0; mask >>>= 1; } sliceOutput.appendByte(value); } }

Target:
public static void encodeNullsAsBits(SliceOutput sliceOutput, Block block) { boolean mayHaveNull = block.mayHaveNull(); sliceOutput.writeBoolean(mayHaveNull); if (!mayHaveNull) { return; } int positionCount = block.getPositionCount(); for (int position = 0; position < (positionCount & ~0b111); position += 8) { byte value = 0; value |= block.isNull(position) ? 0b1000_0000 : 0; value |= block.isNull(position + 1) ? 0b0100_0000 : 0; value |= block.isNull(position + 2) ? 0b0010_0000 : 0; value |= block.isNull(position + 3) ? 0b0001_0000 : 0; value |= block.isNull(position + 4) ? 0b0000_1000 : 0; value |= block.isNull(position + 5) ? 0b0000_0100 : 0; value |= block.isNull(position + 6) ? 0b0000_0010 : 0; value |= block.isNull(position + 7) ? 0b0000_0001 : 0; sliceOutput.appendByte(value); } if ((positionCount & 0b111) > 0) { byte value = 0; int mask = 0b1000_0000; for (int position = positionCount & ~0b111; position < positionCount; position++) { value |= block.isNull(position) ? mask : 0; mask >>>= 1; } sliceOutput.appendByte(value); } }
Source:
private boolean isLocationOutdated() { if (locationProvider.getLastKnownLocation() != null) { return System.currentTimeMillis() - locationProvider.getLastKnownLocation().getTime() > OsmAndLocationProvider.LOCATION_SHELF_LIFE_FOR_ICON; } return false; }

Target:
private boolean isLocationOutdated() { if (locationProvider.getLastKnownLocation() != null && updatesCounter == 0) { updatesCounter++; return System.currentTimeMillis() - locationProvider.getLastKnownLocation().getTime() > OsmAndLocationProvider.STALE_LOCATION_TIMEOUT_FOR_ICON; } else { if (updatesCounter == UPDATES_BEFORE_CHECK_LOCATION) { updatesCounter = 0; } else { updatesCounter++; } } return locationOutdated; }
Source:
public ValidationResult canRebalance(GlusterVolumeEntity volumeEntity) { int replicaCount = 0; List<GlusterBrickEntity> bricks = volumeEntity.getBricks(); if (volumeEntity.getVolumeType().isReplicatedType()) { replicaCount = volumeEntity.getReplicaCount(); } else { replicaCount = 1; } int brickIndex = 0, replicaIndex = 0; while (brickIndex < bricks.size()) { for (replicaIndex = 0; replicaIndex < replicaCount; replicaIndex++) { if (bricks.get(brickIndex + replicaIndex).isOnline()) { brickIndex = brickIndex + replicaCount; break; } } if (replicaIndex == replicaCount) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_ONE_OR_MORE_BRICKS_ARE_DOWN); } } return ValidationResult.VALID; }

Target:
public ValidationResult canRebalance(GlusterVolumeEntity volumeEntity) { int replicaCount = 1; List<GlusterBrickEntity> bricks = volumeEntity.getBricks(); if (volumeEntity.getVolumeType().isReplicatedType()) { replicaCount = volumeEntity.getReplicaCount(); } int brickIndex = 0, replicaIndex = 0; while (brickIndex < bricks.size()) { for (replicaIndex = 0; replicaIndex < replicaCount; replicaIndex++) { if (bricks.get(brickIndex + replicaIndex).isOnline()) { brickIndex = brickIndex + replicaCount; break; } } if (replicaIndex == replicaCount) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_ONE_OR_MORE_BRICKS_ARE_DOWN); } } return ValidationResult.VALID; }
Source:
private void performDiscardChanges() { for (final IResource res : getSelectedResources()) { final Repository repository = getRepository(true); String workingDirPath = repository.getWorkDir().getAbsolutePath().toString(); String resPath = res.getLocation().toOSString(); resPath = resPath.replaceFirst(workingDirPath, ""); resPath = resPath.substring(1); try { Entry e = repository.getIndex().getEntry(resPath); repository.getIndex().checkoutEntry(repository.getWorkDir(), e); res.refreshLocal(0, new NullProgressMonitor()); } catch (IOException e1) { ErrorDialog .openError( getShell(), "Error during checkout", "Some of the selected resources could not be checked out", new Status(IStatus.ERROR, TeamUIPlugin.ID, 1, TeamUIMessages.TeamAction_internal, e1)); } catch (CoreException e) { ErrorDialog .openError( getShell(), "Error during refresh", "Some of the selected resources could not be refreshed", new Status(IStatus.ERROR, TeamUIPlugin.ID, 1, TeamUIMessages.TeamAction_internal, e)); } } }

Target:
private void performDiscardChanges() { for (final IResource res : getSelectedResources()) { final Repository repository = getRepository(true); String workingDirPath = repository.getWorkDir().getAbsolutePath().toString(); String resPath = res.getLocation().toOSString(); resPath = resPath.replaceFirst(workingDirPath, ""); resPath = resPath.substring(1); try { Entry e = repository.getIndex().getEntry(resPath); repository.getIndex().checkoutEntry(repository.getWorkDir(), e); res.refreshLocal(0, new NullProgressMonitor()); } catch (IOException e1) { ErrorDialog .openError( getShell(), UIText.DiscardChangesAction_confirmActionTitle, UIText.DiscardChangesAction_confirmActionMessage, new Status(IStatus.ERROR, TeamUIPlugin.ID, 1, TeamUIMessages.TeamAction_internal, e1)); } catch (CoreException e) { ErrorDialog .openError( getShell(), UIText.DiscardChangesAction_refreshErrorTitle, UIText.DiscardChangesAction_refreshErrorMessage, new Status(IStatus.ERROR, TeamUIPlugin.ID, 1, TeamUIMessages.TeamAction_internal, e)); } } }
Source:
public Long countByChannelModuleName(String moduleName) { DynamicChannelProvider provider = getChannelProvider(moduleName); if (provider != null) { return provider.countTriggers(); } return null; }

Target:
public Long countByChannelModuleName(String moduleName) { DynamicChannelProvider provider = getChannelProvider(moduleName); if (provider != null) { return provider.countTriggers(); } else { LOGGER.debug(PROVIDER_NOT_FOUND, moduleName); } return null; }
Source:
protected void addResponseHeaderForDownload(HttpCacheObject httpCacheObject, String originalFilename) { if (StringUtility.isNullOrEmpty(originalFilename)) { originalFilename = DEFAULT_FILENAME; } originalFilename = originalFilename.replaceAll("[\\x00-\\x1F]", ""); String isoFilename = getIsoFilename(originalFilename); isoFilename = StringUtility.replace(isoFilename, "\"", ""); if (StringUtility.isNullOrEmpty(isoFilename)) { isoFilename = DEFAULT_FILENAME; } httpCacheObject.addHttpResponseInterceptor(new HttpResponseHeaderContributor( "Content-Disposition", "attachment; filename=\"" + isoFilename + "\"; filename*=utf-8''" + IOUtility.urlEncode(originalFilename))); }

Target:
protected void addResponseHeaderForDownload(HttpCacheObject httpCacheObject, String originalFilename) { httpCacheObject.addHttpResponseInterceptor(new HttpResponseHeaderContributor( "Content-Disposition", getContentDispositionHeaderValue(originalFilename))); }
Source:
public Collection<Ref> call() throws GitAPIException, JGitInternalException { checkCallable(); Transport transport = null; FetchConnection fc = null; try { transport = Transport.open(repo, remote); transport.setOptionUploadPack(uploadPack); configure(transport); Collection<RefSpec> refSpecs = new ArrayList<RefSpec>(1); if (tags) refSpecs.add(new RefSpec( "refs/tags/*:refs/remotes/origin/tags/*")); if (heads) refSpecs.add(new RefSpec("refs/heads/*:refs/remotes/origin/*")); Collection<Ref> refs; Map<String, Ref> refmap = new HashMap<String, Ref>(); fc = transport.openFetch(); refs = fc.getRefs(); if (refSpecs.isEmpty()) for (Ref r : refs) refmap.put(r.getName(), r); else for (Ref r : refs) for (RefSpec rs : refSpecs) if (rs.matchSource(r)) { refmap.put(r.getName(), r); break; } return refmap.values(); } catch (URISyntaxException e) { throw new InvalidRemoteException(MessageFormat.format( JGitText.get().invalidRemote, remote)); } catch (NotSupportedException e) { throw new JGitInternalException( JGitText.get().exceptionCaughtDuringExecutionOfLsRemoteCommand, e); } catch (TransportException e) { Throwable cause = e.getCause(); if (cause != null) throw new org.eclipse.jgit.api.errors.TransportException( e.getMessage(), cause); else throw new org.eclipse.jgit.api.errors.TransportException( e.getMessage()); } finally { if (fc != null) fc.close(); if (transport != null) transport.close(); } }

Target:
public Collection<Ref> call() throws GitAPIException, JGitInternalException { checkCallable(); Transport transport = null; FetchConnection fc = null; try { transport = Transport.open(repo, remote); transport.setOptionUploadPack(uploadPack); configure(transport); Collection<RefSpec> refSpecs = new ArrayList<RefSpec>(1); if (tags) refSpecs.add(new RefSpec( "refs/tags/*:refs/remotes/origin/tags/*")); if (heads) refSpecs.add(new RefSpec("refs/heads/*:refs/remotes/origin/*")); Collection<Ref> refs; Map<String, Ref> refmap = new HashMap<String, Ref>(); fc = transport.openFetch(); refs = fc.getRefs(); if (refSpecs.isEmpty()) for (Ref r : refs) refmap.put(r.getName(), r); else for (Ref r : refs) for (RefSpec rs : refSpecs) if (rs.matchSource(r)) { refmap.put(r.getName(), r); break; } return refmap.values(); } catch (URISyntaxException e) { throw new InvalidRemoteException(MessageFormat.format( JGitText.get().invalidRemote, remote)); } catch (NotSupportedException e) { throw new JGitInternalException( JGitText.get().exceptionCaughtDuringExecutionOfLsRemoteCommand, e); } catch (TransportException e) { throw new org.eclipse.jgit.api.errors.TransportException( JGitText.get().exceptionCaughtDuringExecutionOfLsRemoteCommand, e); } finally { if (fc != null) fc.close(); if (transport != null) transport.close(); } }
Source:
public void testUpdateWithNoNetwork() throws Exception { VmNetworkInterface entity = getEntity(1, null); setUpGetEntityExpectations(2, entity); setUriInfo(setUpActionExpectations(VdcActionType.UpdateVmInterface, AddVmInterfaceParameters.class, new String[] { "VmId", "Interface.Id" }, new Object[] { PARENT_ID, GUIDS[1] }, true, true)); NIC nic = getNic(false); nic.setPortMirroring(null); nic = resource.update(nic); assertNotNull(nic); }

Target:
public void testUpdateWithNoNetwork() throws Exception { VmNetworkInterface entity = getEntity(1, null); setUpGetEntityExpectations(3, entity); setUriInfo(setUpActionExpectations(VdcActionType.UpdateVmInterface, AddVmInterfaceParameters.class, new String[] { "VmId", "Interface.Id" }, new Object[] { PARENT_ID, GUIDS[1] }, true, true)); NIC nic = getNic(false); nic.setNetwork(new Network()); nic.setPortMirroring(null); nic = resource.update(nic); assertNotNull(nic); }
Source:
public Optional<ConnectorNewTableLayout> getNewTableLayout(ConnectorSession session, ConnectorTableMetadata metadata) { ImmutableMap.Builder<String, RaptorColumnHandle> map = ImmutableMap.builder(); long columnId = 1; StorageTypeConverter storageTypeConverter = new StorageTypeConverter(typeManager); for (ColumnMetadata column : metadata.getColumns()) { requireNonNull(storageTypeConverter.toStorageType(column.getType()), "storage type cannot be null"); map.put(column.getName(), new RaptorColumnHandle(connectorId, column.getName(), columnId, column.getType())); columnId++; } Optional<DistributionInfo> distribution = getOrCreateDistribution(map.build(), metadata.getProperties()); if (!distribution.isPresent()) { return Optional.empty(); } List<String> partitionColumns = distribution.get().getBucketColumns().stream() .map(RaptorColumnHandle::getColumnName) .collect(toList()); ConnectorPartitioningHandle partitioning = getPartitioningHandle(distribution.get().getDistributionId()); return Optional.of(new ConnectorNewTableLayout(partitioning, partitionColumns)); }

Target:
public Optional<ConnectorNewTableLayout> getNewTableLayout(ConnectorSession session, ConnectorTableMetadata metadata) { ImmutableMap.Builder<String, RaptorColumnHandle> map = ImmutableMap.builder(); long columnId = 1; StorageTypeConverter storageTypeConverter = new StorageTypeConverter(typeManager); for (ColumnMetadata column : metadata.getColumns()) { checkState(storageTypeConverter.toStorageType(column.getType()) != null, "storage type cannot be null"); map.put(column.getName(), new RaptorColumnHandle(connectorId, column.getName(), columnId, column.getType())); columnId++; } Optional<DistributionInfo> distribution = getOrCreateDistribution(map.build(), metadata.getProperties()); if (!distribution.isPresent()) { return Optional.empty(); } List<String> partitionColumns = distribution.get().getBucketColumns().stream() .map(RaptorColumnHandle::getColumnName) .collect(toList()); ConnectorPartitioningHandle partitioning = getPartitioningHandle(distribution.get().getDistributionId()); return Optional.of(new ConnectorNewTableLayout(partitioning, partitionColumns)); }
Source:
public void testCheckpointingInflightData() throws Exception { SingleInputGate inputGate = new SingleInputGateBuilder().build(); List<Buffer> receivedBuffers = new ArrayList<>(); inputGate.registerBufferReceivedListener(new BufferReceivedListener() { @Override public void notifyBufferReceived(Buffer buffer, InputChannelInfo channelInfo) { receivedBuffers.add(buffer); } @Override public void notifyBarrierReceived(CheckpointBarrier barrier, InputChannelInfo channelInfo) }); ResultSubpartitionView subpartitionView = createResultSubpartitionView(true); TestingResultPartitionManager partitionManager = new TestingResultPartitionManager(subpartitionView); LocalInputChannel channel = createLocalInputChannel(inputGate, partitionManager); channel.requestSubpartition(0); channel.spillInflightBuffers(0L, ChannelStateWriter.NO_OP); assertEquals(receivedBuffers, Collections.emptyList()); Optional<InputChannel.BufferAndAvailability> bufferAndAvailability = channel.getNextBuffer(); assertTrue(bufferAndAvailability.isPresent()); assertEquals(receivedBuffers, Collections.singletonList(bufferAndAvailability.get().buffer())); }

Target:
public void testCheckpointingInflightData() throws Exception { SingleInputGate inputGate = new SingleInputGateBuilder().build(); List<Buffer> receivedBuffers = new ArrayList<>(); inputGate.registerBufferReceivedListener(new BufferReceivedListener() { @Override public void notifyBufferReceived(Buffer buffer, InputChannelInfo channelInfo) { receivedBuffers.add(buffer); } @Override public void notifyBarrierReceived(CheckpointBarrier barrier, InputChannelInfo channelInfo) }); ResultPartition parent = PartitionTestUtils.createPartition( ResultPartitionType.PIPELINED, NoOpFileChannelManager.INSTANCE); ResultSubpartition subpartition = parent.getAllPartitions()[0]; ResultSubpartitionView subpartitionView = subpartition.createReadView(() -> {}); TestingResultPartitionManager partitionManager = new TestingResultPartitionManager(subpartitionView); LocalInputChannel channel = createLocalInputChannel(inputGate, partitionManager); channel.requestSubpartition(0); channel.spillInflightBuffers(0L, ChannelStateWriter.NO_OP); assertEquals(receivedBuffers, Collections.emptyList()); subpartition.add(BufferBuilderTestUtils.createFilledFinishedBufferConsumer(1)); Optional<InputChannel.BufferAndAvailability> bufferAndAvailability = channel.getNextBuffer(); assertTrue(bufferAndAvailability.isPresent()); subpartition.add(BufferBuilderTestUtils.createEventBufferConsumer(33, Buffer.DataType.EVENT_BUFFER)); assertTrue(channel.getNextBuffer().isPresent()); assertEquals(receivedBuffers, Collections.singletonList(bufferAndAvailability.get().buffer())); }
Source:
private static boolean isVoltTypePresent(VoltXMLElement tableNode, VoltType lookupType, StringBuffer msg) { assert tableNode.name.equals("table"); String valueTypeStr; VoltType type; String columnName; for (VoltXMLElement subNode : tableNode.children) { if (subNode.name.equals("columns")) { for (VoltXMLElement columnNode : subNode.children) { if (columnNode.name.equals("column")) { valueTypeStr = columnNode.attributes.get("valuetype"); columnName = columnNode.attributes.get("name"); type = VoltType.typeFromString(valueTypeStr); if (lookupType == type) { msg.append("column name: '" + columnName + "', type: '" + valueTypeStr + "'"); return true; } } } } } return false; }

Target:
private static boolean isVoltTypePresent(VoltXMLElement tableNode, VoltType lookupType, StringBuffer msg) { assert(tableNode.name.equals("table")); String valueTypeStr; VoltType type; String columnName; boolean typeDetected = false; String separatorStr; for (VoltXMLElement subNode : tableNode.children) { if (subNode.name.equals("columns")) { for (VoltXMLElement columnNode : subNode.children) { if (columnNode.name.equals("column")) { valueTypeStr = columnNode.attributes.get("valuetype"); columnName = columnNode.attributes.get("name"); type = VoltType.typeFromString(valueTypeStr); if (lookupType == type) { if (msg != null) { separatorStr = (typeDetected == true)? ", " : " "; msg.append(separatorStr + "column name: '" + columnName + "' type: '" + valueTypeStr + "'"); } typeDetected = true; } } } } } return typeDetected; }
Source:
private boolean executeWithoutTransaction() { boolean functionReturnValue = false; boolean exceptionOccurred = true; try { logRunningCommand(); if (hasTaskHandlers()) { getCurrentTaskHandler().execute(); } else { executeCommand(); } functionReturnValue = getSucceeded(); exceptionOccurred = false; } catch (VdcBLLException e) { setCommandStatus(CommandStatus.FAILED); log.error(String.format("Command %1$s throw Vdc Bll exception. With error message %2$s", getClass().getName(), e.getMessage())); if (log.isDebugEnabled()) { log.debug(String.format("Command %1$s throw Vdc Bll exception", getClass().getName()), e); } processExceptionToClient(new VdcFault(e, e.getVdsError().getCode())); } catch (RuntimeException e) { setCommandStatus(CommandStatus.FAILED); processExceptionToClient(new VdcFault(e, VdcBllErrors.ENGINE)); log.error(String.format("Command %1$s throw exception", getClass().getName()), e); } finally { if (exceptionOccurred || !getSucceeded()) { setSucceeded(false); compensate(); } else { cleanUpCompensationData(); } } return functionReturnValue; }

Target:
private boolean executeWithoutTransaction() { boolean functionReturnValue = false; boolean exceptionOccurred = true; try { logRunningCommand(); if (hasTaskHandlers()) { getCurrentTaskHandler().execute(); } else { executeCommand(); } functionReturnValue = getSucceeded(); exceptionOccurred = false; } catch (VdcBLLException e) { log.error(String.format("Command %1$s throw Vdc Bll exception. With error message %2$s", getClass().getName(), e.getMessage())); if (log.isDebugEnabled()) { log.debug(String.format("Command %1$s throw Vdc Bll exception", getClass().getName()), e); } processExceptionToClient(new VdcFault(e, e.getVdsError().getCode())); } catch (RuntimeException e) { processExceptionToClient(new VdcFault(e, VdcBllErrors.ENGINE)); log.error(String.format("Command %1$s throw exception", getClass().getName()), e); } finally { if (exceptionOccurred || !getSucceeded()) { setCommandStatus(CommandStatus.FAILED); setSucceeded(false); compensate(); } else { cleanUpCompensationData(); } } return functionReturnValue; }
Source:
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list) { for (EnumPanelType panelType : EnumPanelType.values()) { list.add(new ItemStack(this, 1, panelType.ordinal())); System.out.println((new ItemStack(this, 1, panelType.ordinal())) + "daad"); } }

Target:
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list) { for (EnumPanelType panelType : EnumPanelType.values()) { list.add(new ItemStack(this, 1, panelType.ordinal())); } }